ABAP Programs

1. Simple ALV:
REPORT Y_D_ALV.

TABLES : vbap,vbak.

data: rptname like sy-repid,
w_shift type i.

type-pools: slis.

data: fcat type table of slis_fieldcat_alv with non-unique default key
with header line initial size 0,

fs_layo type slis_layout_alv,

fevents type table of slis_alv_event with non-unique default key
with header line initial size 0,

fheader type table of slis_listheader with non-unique default key
with header line initial size 0,

fexclude type table of slis_extab with non-unique default key
with header line initial size 0,

gt_sort type slis_t_sortinfo_alv.

data : alv_variant like disvariant,
layout type slis_layout_alv.


DATA : BEGIN OF i_vbap OCCURS 0,
vbeln TYPE vbap-vbeln,"CHAR
posnr TYPE vbap-posnr ,"NUMC
matnr TYPE vbap-matnr ,"CHAR
charg TYPE vbap-charg ,"CHAR
matkl TYPE vbap-matkl ,"CHAR
arktx TYPE vbap-arktx ,"CHAR
meins TYPE vbap-meins ,"UNIT
smeng TYPE vbap-smeng ,"QUAN
faksp TYPE vbap-faksp ,"CHAR
spart TYPE vbap-spart ,"CHAR
gsber TYPE vbap-gsber ,"CHAR
netwr TYPE vbap-netwr ,"CURR
waerk TYPE vbap-waerk ,
antlf TYPE vbap-antlf ,
kztlf TYPE vbap-kztlf ,
abgru TYPE vbap-abgru,
chspl TYPE vbap-chspl ,
kwmeng TYPE vbap-kwmeng,
lsmeng TYPE vbap-lsmeng,
kbmeng TYPE vbap-kbmeng,
klmeng TYPE vbap-klmeng,
vrkme TYPE vbap-vrkme ,
umvkz TYPE vbap-umvkz ,
umvkn TYPE vbap-umvkn ,
brgew TYPE vbap-brgew ,
ntgew TYPE vbap-ntgew ,
gewei TYPE vbap-gewei ,
volum TYPE vbap-volum ,
voleh TYPE vbap-voleh ,
vbelv TYPE vbap-vbelv ,
posnv TYPE vbap-posnv ,
vgbel TYPE vbap-vgbel ,
vgpos TYPE vbap-vgpos ,
voref TYPE vbap-voref ,
upflu TYPE vbap-upflu ,
erlre TYPE vbap-erlre ,
lprio TYPE vbap-lprio ,
werks TYPE vbap-werks ,
lgort TYPE vbap-lgort ,
vstel TYPE vbap-vstel ,
erdat TYPE vbap-erdat ,
ernam TYPE vbap-ernam ,
erzet TYPE vbap-erzet ,
netpr TYPE vbap-netpr ,
kpein TYPE vbap-kpein ,
kmein TYPE vbap-kmein ,
shkzg TYPE vbap-shkzg ,
sktof TYPE vbap-sktof ,
mtvfp TYPE vbap-mtvfp ,
sumbd TYPE vbap-sumbd ,
kondm TYPE vbap-kondm ,
ktgrm TYPE vbap-ktgrm ,
provg TYPE vbap-provg ,
eannr TYPE vbap-eannr ,
prsok TYPE vbap-prsok ,
bwtar TYPE vbap-bwtar ,
bwtex TYPE vbap-bwtex ,
xchpf TYPE vbap-xchpf ,
xchar TYPE vbap-xchar ,
lfmng TYPE vbap-lfmng ,
stafo TYPE vbap-stafo ,
wavwr TYPE vbap-wavwr ,
kmpmg TYPE vbap-kmpmg ,
sobkz TYPE vbap-sobkz ,
stcur TYPE vbap-stcur ,
aedat TYPE vbap-aedat ,
audat TYPE vbak-audat,
var1 TYPE icon-id.
DATA : END OF i_vbap.

SELECT-OPTIONS:
p_audat FOR vbak-audat OBLIGATORY DEFAULT sy-datum TO sy-datum,
p_vkorg FOR vbak-vkorg OBLIGATORY NO INTERVALS NO-EXTENSION
DEFAULT '1100'.

parameter : variant type disvariant-variant.



at selection-screen on value-request for variant.
alv_variant-report = sy-repid.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = alv_variant
i_save = 'A'
importing
es_variant = alv_variant
exceptions
not_found = 2.
if sy-subrc = 2.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
variant = alv_variant-variant.
endif.

call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Hi this is durgesh'.

Start-of-selection.
SELECT B~vbeln B~posnr B~matnr B~charg B~matkl B~arktx B~meins
B~smeng B~faksp B~spart B~gsber B~netwr B~waerk B~antlf B~kztlf
B~abgru B~chspl
B~kwmeng B~lsmeng B~kbmeng B~klmeng B~vrkme B~umvkz B~umvkn B~brgew
B~ntgew B~gewei B~volum B~voleh B~vbelv B~posnv B~vgbel B~vgpos
B~voref B~upflu
B~erlre B~lprio B~werks B~lgort B~vstel B~erdat B~ernam B~erzet
B~netpr B~kpein B~kmein B~shkzg B~sktof B~mtvfp B~sumbd B~kondm
B~ktgrm B~provg B~eannr
B~prsok B~bwtar B~bwtex B~xchpf B~xchar B~lfmng B~stafo B~wavwr
B~kmpmg B~sobkz B~stcur B~aedat a~audat
INTO CORRESPONDING FIELDS OF TABLE i_vbap
FROM vbak as a INNER JOIN vbap as b on a~vbELN = B~VBELN
WHERE A~audat IN p_audat AND
A~vkorg IN p_vkorg.

IF sy-subrc NE 0.
MESSAGE 'No Data Found...' TYPE 'S'.
EXIT.
ENDIF.


layout-zebra = 'X'.
*layout-no_vline = 'X'. "Vertical Lines between columns will not be
* "shown
*layout-no_hline = 'X'. "Horizontal Lines between columns will not
* "be shown
*layout-edit = 'X'. "Columns can be edit in Grid at run time
*layout-no_colhead = 'X'. "Columns Heading will not be shown


perform build_field_catalog.
rptname = sy-repid.

alv_variant-report = rptname.
alv_variant-variant = variant.

* TO Show Logo in Report
*perform show_pic in program ('Z_LOGO_SCREEN') using sy-repid.


call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = rptname "program name
i_callback_user_command = 'USER_COMMAND'
* i_callback_pf_status_set = 'SM04_SET_STATUS'
"disable
"menubar
is_layout = layout"layout of grid
it_fieldcat = fcat[]"field catalog
it_excluding = fexclude[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'"user specific
is_variant = alv_variant" variant of grid
it_events = fevents[]"top of page
tables
t_outtab = i_vbap[]"final table name
exceptions
program_error = 1
others = 2.

*call function 'REUSE_ALV_GRID_DISPLAY'
* exporting
* i_callback_program = sy-repid
** is_layout = layout
* it_fieldcat = fcat[]
* i_default = 'X'
* i_save = 'A'
* is_variant = alv_variant
* tables
* t_outtab = i_vbap[]
* exceptions
* program_error = 1
* others = 2.
*----------------------------------------------------------------------*
form topofpage.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = fheader[].

* I_LOGO =
* I_END_OF_LIST_GRID =

endform. "TOPOFPAGE

*&--------------------------------------------------------------------*
*& FORM USER_COMMAND
*&--------------------------------------------------------------------*
* TEXT
*---------------------------------------------------------------------*
* -->R_UCOMM TEXT
* -->RS_SELFIELDTEXT
*---------------------------------------------------------------------*
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.

read table i_vbap index rs_selfield-tabindex.
if sy-subrc = 0.
set parameter id 'AUN' field i_vbap-vbeln.
call transaction 'VA03'." and skip first screen.
endif.

endform. "USER_COMMAND

*&---------------------------------------------------------------------*
*& Form build_field_catalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form build_field_catalog .
data: w_dthigh(10).

*
* call function 'REUSE_ALV_FIELDCATALOG_MERGE'
* exporting
* i_program_name = sy-repid
* i_internal_tabname = 'I_FINAL'
* i_inclname = sy-repid
* changing
* ct_fieldcat = fcat[].

clear fcat.
fcat-fieldname = 'VBELN'."Field name of Final Table
fcat-outputlen = 11. " Size of Field in Grid
fcat-seltext_s = 'Sales '." For Name of Colunm in Grid
fcat-seltext_m = 'Sales Order No'.
fcat-seltext_l = 'Sales Order No'. " For Tool Tip
* fcat-no_zero = 'X'."All Zero in start of Sales Order Number wll
"be suppressed.
* fcat-checkbox = 'X'. "Field will be shown as Checkboxx
* fcat-no_out = 'X'. "This field will not be show but
"can be select from select layout
* fcat-input = 'X'. "Not Clear
* fcat-icon = 'X'. "display icons
fcat-ddictxt = 'M'."M= fcat-seltext_m, S=fcat-seltext_s,
"L=fcat-seltext_l
fcat-inttype = 'C'. "Alignment N for Right C For Left
fcat-key = 'X'. "Fix the Column.(Col.will not drag
fcat-datatype = 'CHAR'. "Type of field in table
* fcat-do_sum = 'X'. "will display sum of this column
append fcat.

clear fcat.
fcat-fieldname = 'POSNR'.
fcat-outputlen = 10.
fcat-seltext_s = 'Item'.
fcat-seltext_m = 'Item'.
fcat-seltext_l = 'Item'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-key = 'X'.
fcat-datatype = 'NUMC'.
append fcat.
*
clear fcat.
fcat-fieldname = 'MATNR'.
fcat-outputlen = 15.
fcat-seltext_s = 'Material Number '.
fcat-seltext_m = 'Material Number '.
fcat-seltext_l = 'Material Number '.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-key = 'X'.
fcat-datatype = 'CHAR'.
append fcat.
*
clear fcat.
fcat-fieldname = 'CHARG'.
fcat-outputlen = 15.
fcat-seltext_s = 'Batch Numb'.
fcat-seltext_m = 'Batch Numb'.
fcat-seltext_l = 'Batch Numb'.
fcat-ddictxt = 'L'.
fcat-inttype = 'C'.
fcat-key = 'X'.
fcat-datatype = 'CHAR'.
append fcat.

clear fcat.
fcat-fieldname = 'MATKL'.
fcat-outputlen = 25.
fcat-seltext_s = 'MGroup '.
fcat-seltext_m = 'MGroup '.
fcat-seltext_l = 'MGroup '.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
* fcat-emphasize = 'C200'.
append fcat.

clear fcat.
fcat-fieldname = 'ARKTX'.
fcat-outputlen = 15.
fcat-seltext_s = 'Description '.
fcat-seltext_m = 'Description '.
fcat-seltext_l = 'Description '.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
append fcat.
*
clear fcat.
fcat-fieldname = 'MEINS'.
fcat-outputlen = 5.
fcat-seltext_s = 'UOM'.
fcat-seltext_m = 'UOM'.
fcat-seltext_l = 'UOM'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'UNIT'.
append fcat.

clear fcat.
fcat-fieldname = 'SMENG'.
fcat-outputlen = 5.
fcat-seltext_s = 'Scale Quantity '.
fcat-seltext_m = 'Scale Quantity '.
fcat-seltext_l = 'Scale Quantity '.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'QUAN'.
* fcat-emphasize = 'C200'.
append fcat.

clear fcat.
fcat-fieldname = 'FAKSP'.
fcat-outputlen = 5.
fcat-seltext_s = 'Bi'.
fcat-seltext_m = 'Bi'.
fcat-seltext_l = 'Bi'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
* fcat-emphasize = 'C200'.
append fcat.
*
clear fcat.
fcat-fieldname = 'SPART'.
fcat-outputlen = 10.
fcat-seltext_s = 'Di'.
fcat-seltext_m = 'Di'.
fcat-seltext_l = 'Di'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
* fcat-emphasize = 'C200'.
append fcat.

clear fcat.
fcat-fieldname = 'GSBER'.
fcat-outputlen = 20.
fcat-seltext_s = 'Area'.
fcat-seltext_m = 'Area'.
fcat-seltext_l = 'Area'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
* fcat-emphasize = 'C200'.
append fcat.

clear fcat.
fcat-fieldname = 'NETWR'.
fcat-outputlen = 35.
fcat-seltext_s = 'Net Value'.
fcat-seltext_m = 'Net Value'.
fcat-seltext_l = 'Net Value'.
* fcat-ddictxt = 'M'.
fcat-datatype = 'CURR'.

* fcat-emphasize = 'C200'.
append fcat.
*
*
* clear fcat.
* fcat-fieldname = 'WAERK'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'Curr.'.
* fcat-seltext_m = 'Curr.'.
* fcat-seltext_l = 'Curr.'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'CHAR'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'ANTLF'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'M'.
* fcat-seltext_m = 'M'.
* fcat-seltext_l = 'M'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'CHAR'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'KZTLF'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'P'.
* fcat-seltext_m = 'P'.
* fcat-seltext_l = 'P'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'CHAR'.
** fcat-emphasize = 'C200'.
* append fcat.
**
* clear fcat.
* fcat-fieldname = 'ABGRU'.
* fcat-outputlen = 5.
* fcat-seltext_s = 'Rr'.
* fcat-seltext_m = 'Rr'.
* fcat-seltext_l = 'Rr'.
* fcat-ddictxt = 'Rr'.
* fcat-inttype = 'Rr'.
* fcat-datatype = 'Rr'.
** fcat-emphasize = 'Rr'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'CHSPL'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'b'.
* fcat-seltext_m = 'b'.
* fcat-seltext_l = 'b'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'DATS'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'KWMENG'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'sales Unit'.
* fcat-seltext_m = 'sales Unit'.
* fcat-seltext_l = 'sales Unit'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'DATS'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'LSMENG'.
* fcat-outputlen = 15.
* fcat-seltext_s = 'Requires Quantity'.
* fcat-seltext_m = 'Requires Quantity'.
* fcat-seltext_l = 'Requires Quantity'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'KBMENG'.
* fcat-outputlen = 10.
* fcat-seltext_s = 'Dilivered Quantity'.
* fcat-seltext_m = 'Dilivered Quantity'.
* fcat-seltext_l = 'Dilivered Quantity'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'KLMENG'.
* fcat-outputlen = 10.
* fcat-seltext_s = 'confirm quantity '.
* fcat-seltext_m = 'confirm quantity '.
* fcat-seltext_l = 'confirm quantity '.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
**
* clear fcat.
* fcat-fieldname = 'VRKME'.
* fcat-outputlen = 10.
* fcat-seltext_s = 'sal'.
* fcat-seltext_m = 'sal'.
* fcat-seltext_l = 'sal'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
*
* clear fcat.
* fcat-fieldname = 'UMVKG'.
* fcat-outputlen = 5.
* fcat-seltext_s = 'numrtr'.
* fcat-seltext_m = 'numrtr'.
* fcat-seltext_l = 'numrtr'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'UMVKN'.
* fcat-outputlen = 10.
* fcat-seltext_s = 'Conver'.
* fcat-seltext_m = 'Conver'.
* fcat-seltext_l = 'Conver'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'CHAR'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'BRGEW'.
* fcat-outputlen = 5.
* fcat-seltext_s = 'Gross Wight'.
* fcat-seltext_m = 'Gross Wight'.
* fcat-seltext_l = 'Gross Wight'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'NTGEW'.
* fcat-outputlen = 10.
* fcat-seltext_s = 'Net Weight'.
* fcat-seltext_m = 'Net Weight'.
* fcat-seltext_l = 'Net Weight'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'NUMC'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'GEWIE'.
* fcat-outputlen = 5.
* fcat-seltext_s = 'uni'.
* fcat-seltext_m = 'uni'.
* fcat-seltext_l = 'uni'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'CHAR'.
** fcat-emphasize = 'C200'.
* append fcat.
*
* clear fcat.
* fcat-fieldname = 'AUDAT'.
* fcat-outputlen = 5.
* fcat-seltext_s = 'Date'.
* fcat-seltext_m = 'Date'.
* fcat-seltext_l = 'Date'.
* fcat-ddictxt = 'M'.
* fcat-inttype = 'C'.
* fcat-datatype = 'DATS'.
** fcat-datatype = 'DAT'.
** fcat-emphasize = 'C200'.
* append fcat.



*************** To Show Header Description of Reportt****************
fheader-typ = 'H'.

fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
append fheader.
clear fheader.

* To show in Italic Style
fheader-typ = 'A' .

fheader-info = 'Pachpahar Road'.
append fheader.
clear fheader.

* To Show in small character
* Info is Char 60 Colunm
* typ is Char 1 Column
fheader-typ = 'S'.
fheader-info = ' List of Sale Orders for Testing in ALV Report'.
append fheader.
clear fheader.

fheader-typ = 'S'.
data : trptdt(10) type c.
data : xdt type string.
write : sy-datum to trptdt.
concatenate 'Report run date : ' trptdt into xdt separated by space.

fheader-typ = 'S'.
fheader-info = xdt.
append fheader.
clear fheader.
************************************************************************
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = fevents[]
exceptions
list_type_wrong = 1
others = 2.

* This Statement will print the Heading on Pages
read table fevents with key name = 'TOP_OF_PAGE'.
if sy-subrc = 0.
fevents-form = 'TOPOFPAGE'.
modify fevents index sy-tabix.
clear fevents.
endif.

* BREAK Stildev01.
read table fevents with key name = 'USER_COMMAND'.
if sy-subrc = 0.
fevents-form = 'USER_COMMAND'.
modify fevents index sy-tabix.
clear fevents.
endif.
endform.

2. ALV Using Field Catalog:
Note: Using field catalog function we have to define final table by using keyword “LIKE” rather than
“TYPE”

*&---------------------------------------------------------------------*
*& Report Y_D_ALV1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT Y_D_ALV1.


TABLES : vbak.

data: rptname like sy-repid.
* w_shift type i.

type-pools: slis.

data: fcat type table of slis_fieldcat_alv with non-unique default key
with header line initial size 0,

fevents type table of slis_alv_event with non-unique default key
with header line initial size 0,

fheader type table of slis_listheader with non-unique default key
with header line initial size 0,

fexclude type table of slis_extab with non-unique default key
with header line initial size 0,

gt_sort type slis_t_sortinfo_alv.

data : alv_variant like disvariant,
layout type slis_layout_alv.


DATA : BEGIN OF i_vbap OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr ,
matnr LIKE vbap-matnr ,
charg LIKE vbap-charg ,
matkl LIKE vbap-matkl ,
arktx LIKE vbap-arktx ,
meins LIKE vbap-meins ,
smeng LIKE vbap-smeng ,
faksp LIKE vbap-faksp ,
spart LIKE vbap-spart ,
gsber LIKE vbap-gsber ,
netwr LIKE vbap-netwr ,
waerk LIKE vbap-waerk ,
antlf LIKE vbap-antlf ,
kztlf LIKE vbap-kztlf ,
abgru LIKE vbap-abgru,
chspl LIKE vbap-chspl ,
kwmeng LIKE vbap-kwmeng,
lsmeng LIKE vbap-lsmeng,
kbmeng LIKE vbap-kbmeng,
klmeng LIKE vbap-klmeng,
vrkme LIKE vbap-vrkme ,
umvkz LIKE vbap-umvkz ,
umvkn LIKE vbap-umvkn ,
brgew LIKE vbap-brgew ,
ntgew LIKE vbap-ntgew ,
gewei LIKE vbap-gewei ,
volum LIKE vbap-volum ,
voleh LIKE vbap-voleh ,
vbelv LIKE vbap-vbelv ,
posnv LIKE vbap-posnv ,
vgbel LIKE vbap-vgbel ,
vgpos LIKE vbap-vgpos ,
voref LIKE vbap-voref ,
upflu LIKE vbap-upflu ,
erlre LIKE vbap-erlre ,
lprio LIKE vbap-lprio ,
werks LIKE vbap-werks ,
lgort LIKE vbap-lgort ,
vstel LIKE vbap-vstel ,
erdat LIKE vbap-erdat ,
ernam LIKE vbap-ernam ,
erzet LIKE vbap-erzet ,
netpr LIKE vbap-netpr ,
kpein LIKE vbap-kpein ,
kmein LIKE vbap-kmein ,
shkzg LIKE vbap-shkzg ,
sktof LIKE vbap-sktof ,
mtvfp LIKE vbap-mtvfp ,
sumbd LIKE vbap-sumbd ,
kondm LIKE vbap-kondm ,
ktgrm LIKE vbap-ktgrm ,
provg LIKE vbap-provg ,
eannr LIKE vbap-eannr ,
prsok LIKE vbap-prsok ,
bwtar LIKE vbap-bwtar ,
bwtex LIKE vbap-bwtex ,
xchpf LIKE vbap-xchpf ,
xchar LIKE vbap-xchar ,
lfmng LIKE vbap-lfmng ,
stafo LIKE vbap-stafo ,
wavwr LIKE vbap-wavwr ,
kmpmg LIKE vbap-kmpmg ,
sobkz LIKE vbap-sobkz ,
stcur LIKE vbap-stcur ,
aedat LIKE vbap-aedat ,
audat LIKE vbak-audat.
* var1 TYPE icon-id.
DATA : END OF i_vbap.

SELECT-OPTIONS:
p_audat FOR vbak-audat OBLIGATORY DEFAULT sy-datum TO sy-datum,
p_vkorg FOR vbak-vkorg OBLIGATORY NO INTERVALS NO-EXTENSION
DEFAULT '1100'.

parameter : variant type disvariant-variant.



at selection-screen on value-request for variant.
alv_variant-report = sy-repid.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = alv_variant
i_save = 'A'
importing
es_variant = alv_variant
exceptions
not_found = 2.
if sy-subrc = 2.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
variant = alv_variant-variant.
endif.

call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Hi this is durgesh'.

Start-of-selection.
SELECT B~vbeln B~posnr B~matnr B~charg B~matkl B~arktx B~meins
B~smeng B~faksp B~spart B~gsber B~netwr B~waerk B~antlf B~kztlf
B~abgru B~chspl
B~kwmeng B~lsmeng B~kbmeng B~klmeng B~vrkme B~umvkz B~umvkn B~brgew
B~ntgew B~gewei B~volum B~voleh B~vbelv B~posnv B~vgbel B~vgpos
B~voref B~upflu
B~erlre B~lprio B~werks B~lgort B~vstel B~erdat B~ernam B~erzet
B~netpr B~kpein B~kmein B~shkzg B~sktof B~mtvfp B~sumbd B~kondm
B~ktgrm B~provg B~eannr
B~prsok B~bwtar B~bwtex B~xchpf B~xchar B~lfmng B~stafo B~wavwr
B~kmpmg B~sobkz B~stcur B~aedat a~audat
INTO CORRESPONDING FIELDS OF TABLE i_vbap
FROM vbak as a INNER JOIN vbap as b on a~vbELN = B~VBELN
WHERE A~audat IN p_audat AND
A~vkorg IN p_vkorg.

IF sy-subrc NE 0.
MESSAGE 'No Data Found...' TYPE 'S'.
EXIT.
ENDIF.


layout-zebra = 'X'.

perform build_field_catalog.
rptname = sy-repid.

alv_variant-report = rptname.
alv_variant-variant = variant.

* TO Show Logo in Report
*perform show_pic in program ('Z_LOGO_SCREEN') using sy-repid.


call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = rptname "program name
i_callback_user_command = 'USER_COMMAND'
* i_callback_pf_status_set = 'SM04_SET_STATUS'
"disable
"menubar
is_layout = layout"layout of grid
it_fieldcat = fcat[]"field catalog
it_excluding = fexclude[]"remove icon from toolbar
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'"user specific
is_variant = alv_variant" variant of grid
i_grid_title = 'DURGESH'"Display Title of grid
it_events = fevents[]"top of page
tables
t_outtab = i_vbap[]"final table name
exceptions
program_error = 1
others = 2.


*----------------------------------------------------------------------*
form topofpage.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = fheader[].

* I_LOGO =
* I_END_OF_LIST_GRID =

endform. "TOPOFPAGE

*&--------------------------------------------------------------------*
*& FORM USER_COMMAND
*&--------------------------------------------------------------------*
* TEXT
*---------------------------------------------------------------------*
* -->R_UCOMM TEXT
* -->RS_SELFIELDTEXT
*---------------------------------------------------------------------*
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.

read table i_vbap index rs_selfield-tabindex.
if sy-subrc = 0.
set parameter id 'AUN' field i_vbap-vbeln.
call transaction 'VA03'." and skip first screen.
endif.


endform. "USER_COMMAND

*&---------------------------------------------------------------------*
*& Form build_field_catalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form build_field_catalog .
* data: w_dthigh(10).
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'I_VBAP'
i_inclname = sy-repid
changing
ct_fieldcat = fcat[]
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.

if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

*************** To Show Header Description of Reportt****************
fheader-typ = 'H'.

fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
append fheader.
clear fheader.

* To show in Italic Style
fheader-typ = 'A' .

fheader-info = 'Pachpahar Road'.
append fheader.
clear fheader.

fheader-typ = 'S'.
fheader-info = ' List of Sale Orders for Testing in ALV Report'.
append fheader.
clear fheader.

fheader-typ = 'S'.
data : trptdt(10) type c.
data : xdt type string.
write : sy-datum to trptdt.
concatenate 'Report run date : ' trptdt into xdt separated by space.

fheader-typ = 'S'.
fheader-info = xdt.
append fheader.
clear fheader.
************************************************************************
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = fevents[]
exceptions
list_type_wrong = 1
others = 2.

* This Statement will print the Heading on Pages
read table fevents with key name = 'TOP_OF_PAGE'.
if sy-subrc = 0.
fevents-form = 'TOPOFPAGE'.
modify fevents index sy-tabix.
clear fevents.
endif.

fexclude-fcode = '&ABC'.
append fexclude.
clear fexclude.
endform.

3. Advance ALV:
*&---------------------------------------------------------------------*
*& Report Z_MM_REP_BTMCSTK *
*&---------------------------------------------------------------------*
*& v.j *
*& BTM Lot Wise Current & Special Stock Report *
*&---------------------------------------------------------------------*

report z_mm_rep_btmcstk message-id zmsg.

tables : mchb,t148,mara.
type-pools : slis.

data : begin of i_mchb occurs 50,
matnr like mchb-matnr,
werks like mchb-werks,
lgort like mchb-lgort,
charg like mchb-charg,
lvorm like mchb-lvorm,
clabs like mchb-clabs, "Valuated Unrestricted-Use Stock
cumlm like mchb-cumlm, "Stock in transfer
cinsm like mchb-cinsm, "Stock in Quality Inspection
ceinm like mchb-ceinm, "Total Stock of All Restricted Batches
cspem like mchb-cspem, "Blocked Stock
cretm like mchb-cretm, "Blocked Stock Returns
end of i_mchb,

begin of i_mska occurs 50,
matnr like mska-matnr,
werks like mska-werks,
lgort like mska-lgort,
charg like mska-charg,
sobkz like mska-sobkz,
kalab like mska-kalab, " Valuated Unrestricted-Use Stock
kains like mska-kains, " Stock in Quality Inspection
kaspe like mska-kaspe, " Blocked Stock
end of i_mska,

begin of i_matnr occurs 50,
matnr like mara-matnr,
mtart like mara-mtart,
matkl like mara-matkl,
werks like marc-werks,
end of i_matnr,

begin of i_makt occurs 10,
matnr like mara-matnr,
maktx like makt-maktx,
end of i_makt,

begin of i_out occurs 0,
matnr like mchb-matnr,
charg like mchb-charg,
maktx like makt-maktx,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mchb-werks,
lgort like mchb-lgort,
lotno like ausp-atwrt,
sobkz like mska-sobkz,
clabs like mchb-clabs, "Valuated Unrestricted-Use Stock
cumlm like mchb-cumlm, "Stock in transfer
cinsm like mchb-cinsm, "Stock in Quality Inspection
ceinm like mchb-ceinm, "Total Stock of All Restricted Batches
cspem like mchb-cspem, "Blocked Stock
cretm like mchb-cretm, "Blocked Stock Returns
end of i_out,

begin of i_mch1 occurs 50,
matnr like mch1-matnr,
charg like mch1-charg,
cuobj_bm like ausp-objek,
end of i_mch1,

begin of i_ausp occurs 50,
objek type ausp-objek,
atinn type ausp-atinn,
atwrt type ausp-atwrt,
end of i_ausp,

v_atinn type cabn-atinn,
v_atnam type cabn-atnam value 'LOT_NO',
v_lines type i.
*-> ALV
data : alv_variant like disvariant,
fcat type table of slis_fieldcat_alv with header line,
layout type slis_layout_alv.


selection-screen begin of block b1 with frame title text-001.
select-options : werks for mchb-werks,
lgort for mchb-lgort,
charg for mchb-charg,
sobkz for t148-sobkz modif id gp1.
selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-002.
select-options : matnr for mara-matnr,
mtart for mara-mtart,
matkl for mara-matkl.
selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-004.
parameters : variant type disvariant-variant.
selection-screen end of block b3.

selection-screen begin of block b4 with frame title text-003.
parameters : rd1 radiobutton group rad user-command rd default 'X',
rd2 radiobutton group rad,
rd3 radiobutton group rad.
selection-screen end of block b4.

*-> Hide Special Stock
at selection-screen output.
loop at screen.
if rd1 = 'X'.
if screen-group1 = 'GP1'.
screen-input = 0.
screen-active = 0.
screen-required = 1.
modify screen.
endif.
endif.
endloop.
*-> ALV Layout
at selection-screen on value-request for variant.
alv_variant-report = sy-repid.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = alv_variant
i_save = 'A'
importing
es_variant = alv_variant
exceptions
not_found = 2.
if sy-subrc = 2.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
variant = alv_variant-variant.
endif.


*-> Program Start
start-of-selection.
*-> Mandatory Fields
if werks[] is initial.
message i011 with 'Maintain Plant'.
exit.
endif.
if mtart[] is initial.
message i011 with 'Maintain Material type'.
exit.
endif.

*-> Get the character Name
v_atnam = 'LOT_NO'.
select single atinn
from cabn
into v_atinn
where atnam = v_atnam.

*-> Data Selection

*-> Select main Stock from mchb table
if rd3 ne 'X'.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Read Current Stock'.
select matnr
werks
lgort
charg
lvorm
clabs
cumlm
cinsm
ceinm
cspem
cretm
from mchb
into table i_mchb
where matnr in matnr
and werks in werks
and lgort in lgort
and charg in charg
and lvorm eq space.
if sy-subrc <> 0.
message i011 with 'No Stock'.
endif.
endif.

delete i_mchb where clabs is initial
and cumlm is initial
and cinsm is initial
and ceinm is initial
and cspem is initial
and cretm is initial.

if rd1 ne 'X'.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Read Current Special Stock'.
select matnr
werks
lgort
charg
sobkz
kalab " Valuated Unrestricted-Use Stock
kains " Stock in Quality Inspection
kaspe " blocked stock
from mska
into table i_mska
where matnr in matnr
and werks in werks
and lgort in lgort
and charg in charg
and sobkz in sobkz.
if sy-subrc <> 0.
message i011 with 'No Special Stock'.
endif.
endif.
delete i_mska where kalab is initial " Unrestricted-Stock
and kains is initial " Stock in Qual Inspection
and kaspe is initial. " blocked stock

if i_mchb[] is initial and i_mska[] is initial.
message s011 with 'NO Data'.
exit.
endif.


call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Read Material Master'.

select mara~matnr
mara~mtart
mara~matkl
marc~werks
into table i_matnr
from mara
join marc
on marc~matnr = mara~matnr
where mara~matnr in matnr
and mara~mtart in mtart
and mara~matkl in matkl
and marc~werks in werks.
if sy-subrc = 0.
select matnr
maktx
from makt
into table i_makt
for all entries in i_matnr
where matnr eq i_matnr-matnr.
endif.

call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Calculate Stock'.

sort i_matnr by matnr.
sort i_makt by matnr.

loop at i_mchb.
read table i_makt with key matnr = i_mchb-matnr
binary search.
read table i_matnr with key matnr = i_mchb-matnr
binary search.
if sy-subrc = 0.
i_out-matnr = i_mchb-matnr.
i_out-werks = i_mchb-werks.
i_out-lgort = i_mchb-lgort.
i_out-charg = i_mchb-charg.
i_out-maktx = i_makt-maktx.
i_out-mtart = i_matnr-mtart.
i_out-matkl = i_matnr-matkl.
i_out-clabs = i_mchb-clabs. "Unrestricted-Stock
i_out-cumlm = i_mchb-cumlm. "Stock in transfer
i_out-cinsm = i_mchb-cinsm. "Stock in Quality Inspection
i_out-ceinm = i_mchb-ceinm. "Total Stk of All Restricted Batche
i_out-cspem = i_mchb-cspem. "Blocked Stock
i_out-cretm = i_mchb-cretm. "Blocked Stock Returns
append i_out.
clear : i_out,i_matnr.
endif.
endloop.
sort i_matnr by matnr.
sort i_makt by matnr.

loop at i_mska.
read table i_makt with key matnr = i_mska-matnr
binary search.
read table i_matnr with key matnr = i_mska-matnr
binary search.

if sy-subrc = 0.
i_out-matnr = i_mska-matnr.
i_out-werks = i_mska-werks.
i_out-lgort = i_mska-lgort.
i_out-charg = i_mska-charg.
i_out-maktx = i_makt-maktx.
i_out-mtart = i_matnr-mtart.
i_out-matkl = i_matnr-matkl.
i_out-sobkz = i_mska-sobkz.
i_out-clabs = i_mska-kalab. "Unrestricted-Stock
i_out-cinsm = i_mska-kains. "Stock in Quality Inspection
i_out-cspem = i_mska-kaspe. "Blocked Stock
append i_out.
clear : i_out,i_matnr.
endif.
endloop.

free : i_mchb,i_mska.
sort i_out by matnr charg.

call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Read Batch Classification'.

if i_out[] is not initial.
select matnr
charg
cuobj_bm
from mch1
into table i_mch1
for all entries in i_out
where matnr = i_out-matnr
and charg = i_out-charg.
endif.

if i_mch1[] is not initial.
select objek
atinn
atwrt
from ausp
into table i_ausp
for all entries in i_mch1
where objek = i_mch1-cuobj_bm
and atinn = v_atinn.
endif.

call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = 'Prepare Final List'.

sort i_mch1 by matnr charg.
sort i_ausp by objek.

loop at i_out.
read table i_mch1 with key matnr = i_out-matnr
charg = i_out-charg
binary search.
read table i_ausp with key objek = i_mch1-cuobj_bm
binary search.

if sy-subrc = 0.
i_out-lotno = i_ausp-atwrt.
modify i_out transporting lotno.
endif.
clear : i_mch1,i_ausp.
endloop.

*-> ALV
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'I_OUT'
i_inclname = sy-repid
changing
ct_fieldcat = fcat[]
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

loop at fcat.
clear fcat-key.
if fcat-fieldname = 'LOTNO'.
fcat-seltext_s = fcat-seltext_m = fcat-seltext_l = 'Lot no'.
fcat-reptext_ddic = fcat-seltext_l.
fcat-ddictxt = 'L'.
fcat-outputlen = '10'.
endif.
if fcat-fieldname = 'SOBKZ'.
fcat-outputlen = '10'.
endif.
if fcat-fieldname = 'WERKS' or fcat-fieldname = 'LGORT'
or fcat-fieldname = 'MTART'.
fcat-outputlen = '6'.
endif.
modify fcat.
endloop.
layout-zebra = 'X'.

describe table i_out lines v_lines.

message s011 with v_lines 'Records'.

alv_variant-report = sy-repid.
alv_variant-variant = variant.

call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = fcat[]
i_default = 'X'
i_save = 'A'
is_variant = alv_variant
tables
t_outtab = i_out[]
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

4. Editable ALV:
*&---------------------------------------------------------------------*
*& Report yfdntn_RPT
*& By :
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report yfdntn_rpt.
tables : yfdntn,knkk.
type-pools slis.
data : i_fcat type table of slis_fieldcat_alv with header line,

fs_layo type slis_layout_alv,

fevents type table of slis_alv_event with non-unique default key
with header line initial size 0,

fheader type table of slis_listheader with non-unique default key
with header line initial size 0,

fexclude type table of slis_extab with non-unique default key
with header line initial size 0,

gt_sort type slis_t_sortinfo_alv.

data: begin of i_yfdntn occurs 0,
mandt like yfdntn-mandt ,
bukrs like yfdntn-bukrs ,
dbtno like yfdntn-dbtno ,
dnsno like yfdntn-dnsno ,
frmdt like yfdntn-frmdt ,
todat like yfdntn-todat ,
issdt like yfdntn-issdt ,
werks like yfdntn-werks ,
kunnr like yfdntn-kunnr ,
name1 like yfdntn-name1 ,
ort01 like yfdntn-ort01 ,
xblnr like yfdntn-xblnr ,
vbeln like yfdntn-vbeln ,
bldat like yfdntn-bldat ,
duedt like yfdntn-duedt ,
dued1 like yfdntn-dued1 ,
zterm like yfdntn-zterm ,
recdt like yfdntn-recdt ,
ldays like yfdntn-ldays ,
reamt like yfdntn-reamt ,
vzskz like yfdntn-vzskz ,
inamt like yfdntn-inamt ,
inrdt like yfdntn-inrdt ,
inram like yfdntn-inram ,
tdamt like yfdntn-tdamt ,
rmamt like yfdntn-rmamt ,
clrdc like yfdntn-clrdc ,
clrdt like yfdntn-clrdt ,
belnr like yfdntn-belnr ,
blamt like yfdntn-blamt ,
remark like yfdntn-remark.
data : end of i_yfdntn.

data : begin of i_knkk occurs 0,
kunnr type knkk-kunnr,
kkber type knkk-kkber,
sbgrp type knkk-sbgrp.
data : end of i_knkk.

data : begin of i_knk occurs 0,
kunnr type knkk-kunnr,
kkber type knkk-kkber,
sbgrp type knkk-sbgrp.
data : end of i_knk.

data : w_answer type c.
data : ind type sy-tabix,
t_flg type i value 0.

selection-screen begin of block blk with frame title text-001.
select-options: vbukrs for yfdntn-bukrs no-extension no intervals
obligatory,
vdbtno for yfdntn-dbtno obligatory,
vdnsno for yfdntn-dnsno no-display,
vfrmdt for yfdntn-frmdt no-display,
vtodat for yfdntn-todat no-display,
s_sbgrp for knkk-sbgrp no intervals obligatory,

vkunnr for yfdntn-kunnr ,
vissdt for yfdntn-issdt ,
vwerks for yfdntn-werks no-display.

selection-screen end of block blk.
*AUTHORITY-CHECK

*PARAMETERS carr TYPE spfli-carrid.
*
*AT SELECTION-SCREEN.
* AUTHORITY-CHECK OBJECT 'S_CARRID'
* ID 'CARRID' FIELD carr
* ID 'ACTVT' FIELD '03'.
*
* IF sy-subrc <> 0.
* MESSAGE 'No authorization' TYPE 'E'.
* ENDIF.
*
*--Company code validation
at selection-screen on vbukrs.
perform company_code_check.


at selection-screen on vdbtno.

if vdbtno-low is not initial.
loop at vdbtno where low is not initial.
find '*' in vdbtno-low.
if sy-subrc <> 0.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = vdbtno-low
importing
output = vdbtno-low.
modify vdbtno.
endif.
endloop.
endif.

if vdbtno-high is not initial.
loop at vdbtno where high is not initial.
find '*' in vdbtno-high.
if sy-subrc <> 0.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = vdbtno-high
importing
output = vdbtno-high.
modify vdbtno.
endif.
endloop.
endif.


at selection-screen on s_sbgrp.
if s_sbgrp-low = '*' .
select kunnr
kkber
sbgrp
into table i_knk
from knkk
where kkber = vbukrs.
sort i_knk.
delete adjacent duplicates from i_knk comparing kkber sbgrp.
loop at i_knk.
ind = sy-tabix.
authority-check object 'ZSBGRP'
id 'SBGRP' field i_knk-sbgrp.

if sy-subrc <> 0.
message 'No authorization for Credit Rep. group' type 'E'.

exit.
endif.
sy-tabix = ind.
endloop.
else.
loop at s_sbgrp.
ind = sy-tabix.

authority-check object 'ZSBGRP'
id 'SBGRP' field s_sbgrp-low.

if sy-subrc <> 0.
message 'No authorization for Credit Rep. group' type 'S'.
t_flg = 1.
exit.
endif.
sy-tabix = ind.
endloop.
endif.


start-of-selection.
*--------Authorization for Credit Rep. Group -------------------------
if s_sbgrp[] is not initial.
select kunnr
kkber
sbgrp
into table i_knkk
from knkk
where sbgrp in s_sbgrp and
kunnr in vkunnr.

if s_sbgrp-low <> '*'.
if i_knkk[] is initial.
message 'No Data Found...check Customer / Credit Group' type 'S'.
exit.
else.
clear : vkunnr.
loop at i_knkk.
ind = sy-tabix.
vkunnr-sign = 'I'.
vkunnr-option = 'EQ'.
vkunnr-low = i_knkk-kunnr.
append vkunnr.
sy-tabix = ind.
endloop.
endif.
endif.
endif.

*--------Authorization for Credit Rep. Group -------------------------

select bukrs
dbtno
dnsno
frmdt
todat
issdt
werks
kunnr
name1
ort01
xblnr
vbeln
bldat
duedt
dued1
zterm
recdt
ldays
reamt
vzskz
inamt
inrdt
inram
tdamt
rmamt
clrdc
clrdt
belnr
blamt
remark
into corresponding fields of table i_yfdntn
from yfdntn
where bukrs in vbukrs and
dbtno in vdbtno and
dnsno in vdnsno and
frmdt in vfrmdt and
todat in vtodat and
issdt in vissdt and
werks in vwerks and
kunnr in vkunnr.

perform: build_field_catalog.


end-of-selection.
data : i_ava type slis_t_event_exit with header line.

i_ava-ucomm = '&F03'.
i_ava-after = 'X'.
append i_ava.

call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = i_fcat[]
it_excluding = fexclude[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
it_event_exit = i_ava[]
it_events = fevents[]
tables
t_outtab = i_yfdntn[].

if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

*&---------------------------------------------------------------------*
*& Form BUILD_FIELD_CATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form build_field_catalog .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'I_YFDNTN'
i_inclname = sy-repid
changing
ct_fieldcat = i_fcat[].

perform modify_fcat.

* READ TABLE i_fcat WITH KEY fieldname = 'INRDT'.
* IF sy-subrc = 0.
* i_fcat-outputlen = '14'.
* i_fcat-edit = 'X'.
* i_fcat-input = 'X'.
* MODIFY i_fcat INDEX sy-tabix.
* ENDIF.

endform. " BUILD_FIELD_CATALOG
*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->R_UCOMM text
* -->RS_SELFIELD text
*----------------------------------------------------------------------*
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.

if r_ucomm = '&DATA_SAVE'.
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = 'Confirm Save...'
text_question = 'Do you want to Save Data ?'
text_button_1 = 'Yes'
icon_button_1 = 'ICON_SYSTEM_SAVE'
text_button_2 = 'No'
icon_button_2 = 'ICON_SYSTEM_CANCEL'
default_button = '1'
display_cancel_button = 'X'
start_column = 25
start_row = 6
popup_type = 'ICON_MESSAGE_QUESTION'
importing
answer = w_answer
exceptions
text_not_found = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

if w_answer eq '1'.
modify yfdntn from table i_yfdntn.
message 'Data Successfully Saved...' type 'S'.
endif.
elseif r_ucomm = '&F03'.
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = 'Confirm Save...'
text_question = 'Do you want to Save Data Before Exit ?'
text_button_1 = 'Yes'
icon_button_1 = 'ICON_SYSTEM_SAVE'
text_button_2 = 'No'
icon_button_2 = 'ICON_SYSTEM_CANCEL'
default_button = '2'
display_cancel_button = 'X'
start_column = 25
start_row = 6
popup_type = 'ICON_MESSAGE_CRITICAL'
importing
answer = w_answer
exceptions
text_not_found = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if w_answer eq '1'.
modify yfdntn from table i_yfdntn.
message 'Data Successfully Saved...' type 'S'.
endif.
endif.
clear : w_answer.
endform. "user_command
*&---------------------------------------------------------------------*
*& Form MODIFY_FCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form modify_fcat .
read table i_fcat with key fieldname = 'DBTNO'.
ind = sy-tabix.
i_fcat-seltext_s = 'DebNote No.'.
i_fcat-seltext_m = 'Debit Note No.'.
i_fcat-seltext_l = 'Debit Note No.'.
i_fcat-reptext_ddic = 'Debit Note No.'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'FRMDT'.
ind = sy-tabix.
i_fcat-seltext_s = 'From Date'.
i_fcat-seltext_m = 'Debit Note From Date'.
i_fcat-seltext_l = 'Debit Note From Date'.
i_fcat-reptext_ddic = 'Debit Note From Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'TODAT'.
ind = sy-tabix.
i_fcat-seltext_s = 'To Date'.
i_fcat-seltext_m = 'Debit Note To Date'.
i_fcat-seltext_l = 'Debit Note To Date'.
i_fcat-reptext_ddic = 'Debit Note To Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'ISSDT'.
ind = sy-tabix.
i_fcat-seltext_s = 'IssueDate'.
i_fcat-seltext_m = 'Debit Note IssueDate'.
i_fcat-seltext_l = 'Debit Note IssueDate'.
i_fcat-reptext_ddic = 'Debit Note IssueDate'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'VBELN'.
ind = sy-tabix.
i_fcat-seltext_s = 'Inv.Doc.'.
i_fcat-seltext_m = 'Invoice Document No.'.
i_fcat-seltext_l = 'Invoice Document No.'.
i_fcat-reptext_ddic = 'Invoice Document No.'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'LDAYS'.
ind = sy-tabix.
i_fcat-seltext_s = 'Days'.
i_fcat-seltext_m = 'No. of Days'.
i_fcat-seltext_l = 'No. of Days'.
i_fcat-reptext_ddic = 'No. of Days'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'REAMT'.
ind = sy-tabix.
i_fcat-seltext_s = 'Recd.Amount'.
i_fcat-seltext_m = 'Received Amount'.
i_fcat-seltext_l = 'Received Amount'.
i_fcat-reptext_ddic = 'Received Amount'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'VZSKZ'.
ind = sy-tabix.
i_fcat-seltext_s = 'RatOfIntt.'.
i_fcat-seltext_m = 'Interest Rate'.
i_fcat-seltext_l = 'Interest Rate'.
i_fcat-reptext_ddic = 'Interest Rate'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'INAMT'.
ind = sy-tabix.
i_fcat-seltext_s = 'IntrstAmt'.
i_fcat-seltext_m = 'Interest Amount'.
i_fcat-seltext_l = 'Interest Amount'.
i_fcat-reptext_ddic = 'Interest Amount'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'INRDT'.
ind = sy-tabix.
i_fcat-seltext_s = 'Intt.RecDt'.
i_fcat-seltext_m = 'Interest Rec. Date'.
i_fcat-seltext_l = 'Interest Received Date'.
i_fcat-reptext_ddic = 'Interest Received Date'.
i_fcat-outputlen = '14'.
i_fcat-edit = 'X'.
i_fcat-input = 'X'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'INRAM'.
ind = sy-tabix.
i_fcat-seltext_s = 'InttRecAmt'.
i_fcat-seltext_m = 'Interest Rec. Amount'.
i_fcat-seltext_l = 'Interest Received Amount'.
i_fcat-reptext_ddic = 'Interest Received Amount'.
i_fcat-outputlen = '14'.
i_fcat-edit = 'X'.
i_fcat-input = 'X'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'TDAMT'.
ind = sy-tabix.
i_fcat-seltext_s = 'TDSRecAmt'.
i_fcat-seltext_m = 'T.D.S. Rec. Amount'.
i_fcat-seltext_l = 'T.D.S. Received Amount'.
i_fcat-reptext_ddic = 'T.D.S. Received Amount'.
i_fcat-outputlen = '14'.
i_fcat-edit = 'X'.
i_fcat-input = 'X'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'REMARK'.
ind = sy-tabix.
i_fcat-seltext_s = 'Text'.
i_fcat-seltext_m = 'Text'.
i_fcat-seltext_l = 'Text'.
i_fcat-reptext_ddic = 'Text'.
i_fcat-outputlen = '14'.
i_fcat-edit = 'X'.
i_fcat-input = 'X'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'RMAMT'.
ind = sy-tabix.
i_fcat-seltext_s = 'BalanceAmt'.
i_fcat-seltext_m = 'Balance Amount'.
i_fcat-seltext_l = 'Balance Amount'.
i_fcat-reptext_ddic = 'Balance Amount'.
i_fcat-outputlen = '14'.
i_fcat-edit = 'X'.
i_fcat-input = 'X'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'NAME1'.
ind = sy-tabix.
i_fcat-seltext_s = 'Cust.Name'.
i_fcat-seltext_m = 'Customer Name'.
i_fcat-seltext_l = 'Customer Name'.
i_fcat-reptext_ddic = 'Customer Name'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'BLDAT'.
ind = sy-tabix.
i_fcat-seltext_s = 'Bill Date'.
i_fcat-seltext_m = 'Bill Date'.
i_fcat-seltext_l = 'Bill Date'.
i_fcat-reptext_ddic = 'Bill Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'DUEDT'.
ind = sy-tabix.
i_fcat-seltext_s = 'Due Date'.
i_fcat-seltext_m = 'Due Date'.
i_fcat-seltext_l = 'Due Date'.
i_fcat-reptext_ddic = 'Due Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'DUED1'.
ind = sy-tabix.
i_fcat-seltext_s = 'D.O. Date'.
i_fcat-seltext_m = 'D.O. Date'.
i_fcat-seltext_l = 'D.O. Date'.
i_fcat-reptext_ddic = 'D.O. Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'RECDT'.
ind = sy-tabix.
i_fcat-seltext_s = 'AmtRecDt'.
i_fcat-seltext_m = 'Amount Rec.Date'.
i_fcat-seltext_l = 'Amount Received Date'.
i_fcat-reptext_ddic = 'Amount Received Date'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'CLRDC'.
ind = sy-tabix.
i_fcat-seltext_s = 'Chequ/Ref'.
i_fcat-seltext_m = 'Cheque / Ref.No.'.
i_fcat-seltext_l = 'Cheque / Referance No.'.
i_fcat-reptext_ddic = 'Cheque / Referance No.'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'BELNR'.
ind = sy-tabix.
i_fcat-seltext_s = 'InvDocNo'.
i_fcat-seltext_m = 'Invoice Document No.'.
i_fcat-seltext_l = 'Invoice Document No.'.
i_fcat-reptext_ddic = 'Invoice Document No.'.
modify i_fcat index ind.

read table i_fcat with key fieldname = 'BLAMT'.
ind = sy-tabix.
i_fcat-seltext_s = 'InvAmt.'.
i_fcat-seltext_m = 'Invoice Amount'.
i_fcat-seltext_l = 'Invoice Amount'.
i_fcat-reptext_ddic = 'Invoice Amount'.
modify i_fcat index ind.


endform. " MODIFY_FCAT
*&---------------------------------------------------------------------*
*& Form COMPANY_CODE_CHECK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form company_code_check .

data : lv_bukrs like bkpf-bukrs,
v_butxt like t001-butxt.

*-- checking company code no is exists or no
select bukrs butxt
from t001 up to 1 rows
into (lv_bukrs,v_butxt )
where bukrs in vbukrs.
endselect.

if sy-subrc <> 0.
message 'Please check Company Code' type 'E'.
endif. "IF sy-subrc <> 0
clear lv_bukrs.

authority-check object 'F_BKPF_BUK'
id 'ACTVT' field '03'
id 'BUKRS' field vbukrs-low.
if sy-subrc ne 0.
message 'No Authorization for Company Code' type 'E'.
endif.


endform. " COMPANY_CODE_CHECK

5. ALV With Checkbox:
*&---------------------------------------------------------------------*
*& Report Z_BAGGING
*&
*&---------------------------------------------------------------------*
*& Developed By : Durgesh Singh
*& Developed On : 23.05.2012
*&---------------------------------------------------------------------*
REPORT Z_BAGGING NO STANDARD PAGE HEADING LINE-SIZE 84.
TYPE-POOLS : SLIS.
TABLES : EKKN,ZBAG_S.
DATA : FCAT TYPE TABLE OF SLIS_FIELDCAT_ALV WITH NON-UNIQUE DEFAULT
KEY WITH HEADER LINE INITIAL SIZE 0,
FEVENT TYPE TABLE OF SLIS_ALV_EVENT WITH NON-UNIQUE DEFAULT
KEY WITH HEADER LINE INITIAL SIZE 0,
FHEADER TYPE TABLE OF SLIS_LISTHEADER WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FLAYOUT TYPE STANDARD TABLE OF SLIS_LAYOUT_ALV WITH NON-UNIQUE
DEFAULT KEY WITH HEADER LINE INITIAL SIZE 0.
DATA : BEGIN OF I_EKKN OCCURS 0,
EBELN TYPE EKKN-EBELN,
EBELP TYPE EKKN-EBELP,
VBELN TYPE EKKN-VBELN,
VBELP TYPE EKKN-VBELP,
MENGE TYPE EKKN-MENGE,
END OF I_EKKN.
DATA : BEGIN OF I_TEMP OCCURS 0,
EBELN TYPE EKKN-EBELN,
EBELP TYPE EKKN-EBELP,
VBELN TYPE EKKN-VBELN,
VBELP TYPE EKKN-VBELP,
MENGE TYPE EKKN-MENGE,
END OF I_TEMP.
DATA : I_FINAL TYPE ZBAG_S OCCURS 0 WITH HEADER LINE.
DATA: FM_NAME TYPE RS38L_FNAM,
VVBELN TYPE STRING.
SELECTION-SCREEN BEGIN OF BLOCK BLK02 WITH FRAME TITLE TEXT-007.
PARAMETERS : V_R1 RADIOBUTTON GROUP G1 USER-COMMAND ACT DEFAULT 'X',
V_R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK BLK02.
SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-001.
PARAMETERS : V_EBELN TYPE EKKN-EBELN MODIF ID A,
V_VBELN TYPE EKKN-VBELN MODIF ID B,
V_VBELP TYPE EKKN-VBELP MODIF ID B.
SELECTION-SCREEN END OF BLOCK BLK01.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF V_R1 = 'X'.
IF SCREEN-GROUP1 = 'B'.
SCREEN-ACTIVE = 0.
ENDIF.
ELSE.
IF SCREEN-GROUP1 = 'A'.
SCREEN-ACTIVE = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
START-OF-SELECTION.
IF V_R1 = 'X' AND V_EBELN = SPACE.
MESSAGE 'Enter production order No.' TYPE 'I'.
EXIT.
ELSEIF V_R2 = 'X'.
IF V_VBELN = SPACE OR V_VBELP = SPACE.
MESSAGE 'Enter sales order and sales item' TYPE 'I'.
EXIT.
ENDIF.
ENDIF.
IF V_R1 = 'X'.
PERFORM GET_DATA.
IF I_EKKN[] IS NOT INITIAL.
PERFORM DISPLAY_REPORT.
ELSE.
MESSAGE 'No Record Found!' TYPE 'I'.
EXIT.
ENDIF.
ELSE.
I_FINAL-CHECK = 'X'.
I_FINAL-VBELN = V_VBELN.
I_FINAL-VBELP = V_VBELP.
APPEND I_FINAL.
CLEAR I_FINAL.
PERFORM DISPLAY_BARCODE.
ENDIF.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_DATA .
SELECT EBELN
EBELP
VBELN
VBELP
MENGE
INTO TABLE I_EKKN FROM EKKN WHERE EBELN = V_EBELN.
IF I_EKKN[] IS NOT INITIAL.
I_TEMP[] = I_EKKN[].
SORT I_TEMP BY VBELN VBELP ASCENDING.
DELETE ADJACENT DUPLICATES FROM I_TEMP COMPARING VBELN VBELP.
LOOP AT I_TEMP.
CLEAR : I_TEMP-MENGE.
MOVE-CORRESPONDING I_TEMP TO I_FINAL.
LOOP AT I_EKKN WHERE VBELN = I_TEMP-VBELN AND VBELP = I_TEMP-VBELP
.
I_FINAL-MENGE = I_FINAL-MENGE + I_EKKN-MENGE.
ENDLOOP.
APPEND I_FINAL.
CLEAR : I_FINAL.
ENDLOOP.
ENDIF.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_REPORT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_REPORT .
PERFORM FIELD_CATALOG.
PERFORM GIRD_DISPLAY.
ENDFORM. " DISPLAY_REPORT
*&---------------------------------------------------------------------*
*& Form FIELD_CATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELD_CATALOG .
FCAT-FIELDNAME = 'CHECK'.
FCAT-SELTEXT_S = TEXT-006.
FCAT-SELTEXT_M = TEXT-006.
FCAT-SELTEXT_L = TEXT-006.
FCAT-REPTEXT_DDIC = TEXT-006.
FCAT-CHECKBOX = 'X'.
FCAT-EDIT = 'X'.
APPEND FCAT.
CLEAR FCAT.
FCAT-FIELDNAME = 'EBELN'.
FCAT-SELTEXT_S = TEXT-002.
FCAT-SELTEXT_M = TEXT-002.
FCAT-SELTEXT_L = TEXT-002.
FCAT-REPTEXT_DDIC = TEXT-002.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
CLEAR FCAT.
FCAT-FIELDNAME = 'VBELN'.
FCAT-SELTEXT_S = TEXT-003.
FCAT-SELTEXT_M = TEXT-003.
FCAT-SELTEXT_L = TEXT-003.
FCAT-REPTEXT_DDIC = TEXT-003.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
CLEAR FCAT.
FCAT-FIELDNAME = 'VBELP'.
FCAT-SELTEXT_S = TEXT-004.
FCAT-SELTEXT_M = TEXT-004.
FCAT-SELTEXT_L = TEXT-004.
FCAT-REPTEXT_DDIC = TEXT-004.
FCAT-OUTPUTLEN = '10'.
APPEND FCAT.
CLEAR FCAT.
FCAT-FIELDNAME = 'MENGE'.
FCAT-SELTEXT_S = TEXT-005.
FCAT-SELTEXT_M = TEXT-005.
FCAT-SELTEXT_L = TEXT-005.
FCAT-REPTEXT_DDIC = TEXT-005.
FCAT-OUTPUTLEN = '10'.
APPEND FCAT.
CLEAR FCAT.
ENDFORM. " FIELD_CATALOG
*&---------------------------------------------------------------------*
*& Form GIRD_DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GIRD_DISPLAY .
FLAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = FLAYOUT
IT_FIELDCAT = FCAT[]
I_DEFAULT = 'X'
TABLES
T_OUTTAB = I_FINAL[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " GIRD_DISPLAY
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF1.
CALL METHOD REF1->CHECK_CHANGED_DATA.
CASE R_UCOMM.
WHEN 'BARC'.
READ TABLE I_FINAL WITH KEY CHECK = 'X'.
IF SY-SUBRC = 0.
PERFORM DISPLAY_BARCODE.
ELSE.
MESSAGE 'Select at least on row' TYPE 'I'.
EXIT.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND
*&---------------------------------------------------------------------*
*& Form PF_STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZLBLN'.
ENDFORM. " PF_STATUS
*&---------------------------------------------------------------------*
*& Form DISPLAY_BARCODE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_BARCODE .
DELETE I_FINAL WHERE CHECK = SPACE.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'Z_BAGGING_BARCODE'
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION FM_NAME
TABLES
I_FINAL = I_FINAL[].
ENDFORM. " DISPLAY_BARCODE

6. ALV With Colour:
*&---------------------------------------------------------------------*
*& Report ZDEMO_ALV1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZDEMO_ALV1.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: begin of imara occurs 0,
matnr type mara-matnr,
mtart type mara-mtart,
maktx type makt-maktx,
color_line(4) type c,
tcolor type slis_t_specialcol_alv, "cell
end of imara.
data: xcolor type slis_specialcol_alv.
start-of-selection.
perform get_data.
perform write_report.
************************************************************************
* Get_Data
************************************************************************
form get_data.
imara-matnr = 'ABC'.
imara-mtart = 'ZCFG'.
imara-maktx = 'This is description for ABC'.
append imara.
imara-matnr = 'DEF'.
imara-mtart = 'ZCFG'.
imara-maktx = 'This is description for DEF'.
append imara.
imara-matnr = 'GHI'.
imara-mtart = 'ZCFG'.
imara-maktx = 'This is description for GHI'.
append imara.
loop at imara.
if sy-tabix = 1.
imara-color_line = 'C410'. " color line
endif.
if sy-tabix = 2. "color CELL
clear xcolor.
xcolor-fieldname = 'MTART'.
xcolor-color-col = '7'.
xcolor-color-int = '1'. "Intensified on/off
xcolor-color-inv = '0'.
append xcolor to imara-tcolor.
endif.
modify imara.
endloop.
endform.
************************************************************************
* WRITE_REPORT
************************************************************************
form write_report.
data: layout type slis_layout_alv.
layout-coltab_fieldname = 'TCOLOR'.
layout-info_fieldname = 'COLOR_LINE'.
perform build_field_catalog.
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
is_layout = layout
it_fieldcat = fieldcat
tables
t_outtab = imara.
endform.
************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Number'.
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Type'.
fc_tmp-fieldname = 'MTART'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '4'.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material'.
fc_tmp-fieldname = 'MAKTX'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '40'.
fc_tmp-emphasize = 'C610'. " color column
append fc_tmp to fieldcat.
endform.
*Here is the color code chart as well.
*****************************************************************
* Colour code : *
* Colour is a 4-char field where : *
* - 1st char = C (color property) *
* - 2nd char = color code (from 0 to 7) *
* 0 = background color *
* 1 = blue *
* 2 = gray *
* 3 = yellow *
* 4 = blue/gray *
* 5 = green *
* 6 = red *
* 7 = orange *
* - 3rd char = intensified (0=off, 1=on) *
* - 4th char = inverse display (0=off, 1=on) *
* *
* Colour overwriting priority : *
* 1. Line *
* 2. Cell
*3. Column *
*C110
*C210
*C310
*C410
*C510
*C610
*C710
*C810
*C010
****************************************************************************

7. ALV in Module Pool:
Driver Program
*&---------------------------------------------------------------------*
*& Report ZRFGLBALANCE_N
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZRFGLBALANCE_N MESSAGE-ID ZDMSG.
TYPE-POOLS : SLIS,TPIT.
TABLES: SKAT, SKB1, BSIS,T001,GLT0,TGSBT,BSEG.
*--------Table Declaration
DATA : BEGIN OF I_GLDETAIL OCCURS 0,
HKONT TYPE BSIS-HKONT,
BUKRS TYPE BSIS-BUKRS,
GJAHR TYPE BSIS-GJAHR,
GSBER TYPE BSIS-GSBER,
MONAT TYPE BSIS-MONAT,
DMBTR TYPE BSIS-DMBTR,
SHKZG TYPE BSIS-SHKZG,
XNEGP TYPE BSIS-XNEGP,
END OF I_GLDETAIL,
BEGIN OF I_GLSUMMARY OCCURS 0,
MONAT LIKE BSIS-XREF3,
DMBTR LIKE BSIS-DMBTR,
CMBTR LIKE BSIS-DMBTR,
BMBTR LIKE BSIS-DMBTR,
UMBTR LIKE BSIS-DMBTR,
END OF I_GLSUMMARY,
BEGIN OF I_GLT0 OCCURS 0,
BUKRS TYPE GLT0-BUKRS,
RYEAR TYPE GLT0-RYEAR,
RACCT TYPE GLT0-RACCT,
TSLVT TYPE GLT0-TSLVT,
END OF I_GLT0,
BEGIN OF I_BSEG OCCURS 0,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
BUZEI TYPE BSEG-BUZEI,
LIFNR TYPE BSEG-LIFNR,
VNAME TYPE LFA1-NAME1,
MATNR TYPE BSEG-MATNR,
MENGE TYPE BSEG-MENGE,
KUNNR TYPE BSEG-KUNNR,
CNAME TYPE KNA1-NAME1,
ANLN1 TYPE BSEG-ANLN1,
ANLN2 TYPE BSEG-ANLN2,
EBELN TYPE BSEG-EBELN,
EBELP TYPE BSEG-EBELP,
ETEN2 TYPE BSEG-ETEN2,
FILKD TYPE BSEG-FILKD,
POSN2 TYPE BSEG-POSN2,
VBEL2 TYPE BSEG-VBEL2,
VBELN TYPE BSEG-VBELN,
END OF I_BSEG.
DATA : WA LIKE LINE OF I_GLSUMMARY.
*--------Structure Declaration
DATA : IT_LIST LIKE ZRFPOSXEXT OCCURS 1 WITH HEADER LINE,
I_RDTXT TYPE TLINE OCCURS 0 WITH HEADER LINE.
*--------Variable Declaration For ALV
DATA : FCAT TYPE LVC_T_FCAT WITH HEADER LINE.
DATA : I_FIELDCAT TYPE TABLE OF SLIS_FIELDCAT_ALV WITH NON-UNIQUE DEFAULT
KEY WITH HEADER LINE INITIAL SIZE 0,
FEVENT TYPE TABLE OF SLIS_ALV_EVENT WITH NON-UNIQUE DEFAULT
KEY WITH HEADER LINE INITIAL SIZE 0,
FHEADER TYPE TABLE OF SLIS_LISTHEADER WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FLAYOUT TYPE STANDARD TABLE OF SLIS_LAYOUT_ALV WITH NON-UNIQUE
DEFAULT KEY WITH HEADER LINE INITIAL SIZE 0.
*--------Variable Declaration
DATA : TEMP TYPE BSIS-DMBTR,
CFBL TYPE BSIS-DMBTR,
CNT TYPE BSIS-MONAT,
TDEB TYPE BSIS-DMBTR,
TCRD TYPE BSIS-DMBTR,
TDIF TYPE BSIS-DMBTR,
VGLN TYPE SKAT-TXT20,
VCOM TYPE T001-BUTXT,
VBUS TYPE TGSBT-GTEXT,
VFYR TYPE BSIS-GJAHR,
VDCR TYPE C,
MONT(10) TYPE C,
RCNT TYPE I.
DATA :V_TXTNAME TYPE THEAD-TDNAME,
GTEXT(60) TYPE C,
IGUI TYPE I.
DATA : CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
GRID TYPE REF TO CL_GUI_ALV_GRID,
L_UCOMM TYPE SY-UCOMM,
V_GJAHR TYPE BSIS-GJAHR.
*--------Constant Declaration
CONSTANTS : C_BACK TYPE SY-UCOMM VALUE 'BACK',
C_EXIT TYPE SY-UCOMM VALUE 'EXIT',
C_CANC TYPE SY-UCOMM VALUE 'CANC',
VID TYPE THEAD-TDID VALUE '0001',
VOBJ TYPE THEAD-TDOBJECT VALUE 'DOC_ITEM',
C_GUICNT LIKE SY-TABIX VALUE 100.
*--------Selection Screen Declaration
SELECT-OPTIONS: VHKONT FOR BSIS-HKONT NO INTERVALS,
VBUKRS FOR T001-BUKRS NO INTERVALS,
VGJAHR FOR BSIS-GJAHR NO INTERVALS NO-EXTENSION,
VGSBER FOR BSIS-GSBER NO INTERVALS.
*--------Class Definition
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS: HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IM
PORTING E_ROW E_COLUMN.
ENDCLASS. "LCL_EVENT_HANDLER DEFINITION
*--------Class Implementationn
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD HANDLE_DOUBLE_CLICK.
READ TABLE I_GLSUMMARY INDEX E_ROW-INDEX INTO WA.
IF WA-MONAT = 'Balance Carryforward'.
MESSAGE S002.
EXIT.
ELSE.
IF E_COLUMN = 'MONAT' AND WA-BMBTR = 0.
MESSAGE I003.
EXIT.
ELSEIF E_COLUMN = 'DMBTR' AND WA-DMBTR = 0.
MESSAGE I003.
EXIT.
ELSEIF E_COLUMN = 'CMBTR' AND WA-CMBTR = 0.
MESSAGE I003.
EXIT.
ELSEIF E_COLUMN = 'BMBTR' AND WA-BMBTR = 0.
MESSAGE I003.
EXIT.
ELSE.
PERFORM OUT_PUT_LIST USING WA E_COLUMN.
PERFORM FIELD_CATALOG_FOR_DOUBLE_CLICK.
PERFORM DISPLAY_DATA_FOR_DOUBLE_CLICK.
ENDIF.
ENDIF.
CLEAR : WA.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
START-OF-SELECTION.
IF VHKONT-LOW IS INITIAL.
MESSAGE I005.
EXIT.
ELSEIF VBUKRS-LOW IS INITIAL.
MESSAGE I006.
EXIT.
ELSEIF VGJAHR-LOW IS INITIAL.
MESSAGE I007.
EXIT.
ENDIF.
PERFORM GET_DATA.
IF I_GLDETAIL[] IS NOT INITIAL.
PERFORM PROCESS_DATA.
PERFORM FIELD_CATALOG_BUILD.
CALL SCREEN 100.
ENDIF.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_DATA .
SELECT HKONT
BUKRS
GJAHR
GSBER
MONAT
DMBTR
SHKZG
XNEGP
INTO CORRESPONDING FIELDS OF TABLE I_GLDETAIL FROM BSIS
WHERE HKONT IN VHKONT AND
BUKRS IN VBUKRS AND
GJAHR EQ VGJAHR-LOW AND
GSBER IN VGSBER.
IF I_GLDETAIL[] IS INITIAL.
MESSAGE I000.
RETURN.
ENDIF.
SELECT BUKRS
RYEAR
RACCT
TSLVT
INTO TABLE I_GLT0 FROM GLT0
WHERE BUKRS IN VBUKRS AND
RYEAR EQ VGJAHR-LOW AND
RACCT IN VHKONT AND
RBUSA IN VGSBER.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form PROCESS_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PROCESS_DATA .
V_GJAHR = VGJAHR-LOW.
CLEAR : CFBL.
LOOP AT I_GLT0.
CFBL = CFBL + I_GLT0-TSLVT.
ENDLOOP.
I_GLSUMMARY-MONAT = '00'.
I_GLSUMMARY-UMBTR = CFBL.
APPEND I_GLSUMMARY.
LOOP AT I_GLDETAIL.
I_GLSUMMARY-MONAT = I_GLDETAIL-MONAT.
IF I_GLDETAIL-SHKZG = 'S' AND I_GLDETAIL-XNEGP = ' '.
I_GLSUMMARY-DMBTR = I_GLDETAIL-DMBTR.
I_GLSUMMARY-CMBTR = 0.
ELSEIF I_GLDETAIL-SHKZG = 'S' AND I_GLDETAIL-XNEGP = 'X'.
I_GLSUMMARY-CMBTR = I_GLDETAIL-DMBTR * -1.
I_GLSUMMARY-DMBTR = 0.
ELSEIF I_GLDETAIL-SHKZG = 'H' AND I_GLDETAIL-XNEGP = ' '.
I_GLSUMMARY-CMBTR = I_GLDETAIL-DMBTR.
I_GLSUMMARY-DMBTR = 0.
ELSEIF I_GLDETAIL-SHKZG = 'H' AND I_GLDETAIL-XNEGP = 'X'.
I_GLSUMMARY-DMBTR = I_GLDETAIL-DMBTR * -1.
I_GLSUMMARY-CMBTR = 0.
ENDIF.
I_GLSUMMARY-BMBTR = ( I_GLSUMMARY-DMBTR - I_GLSUMMARY-CMBTR ).
COLLECT I_GLSUMMARY.
ENDLOOP.
DO 17 TIMES.
CNT = CNT + 1.
READ TABLE I_GLSUMMARY WITH KEY MONAT = CNT.
IF SY-SUBRC IS NOT INITIAL.
CLEAR : I_GLSUMMARY.
I_GLSUMMARY-MONAT = CNT.
APPEND I_GLSUMMARY.
ELSE.
TDEB = TDEB + I_GLSUMMARY-DMBTR.
TCRD = TCRD + I_GLSUMMARY-CMBTR.
TDIF = TDIF + I_GLSUMMARY-BMBTR.
ENDIF.
ENDDO.
SORT I_GLSUMMARY BY MONAT.
LOOP AT I_GLSUMMARY.
IF I_GLSUMMARY-MONAT = '00'.
I_GLSUMMARY-MONAT = 'Balance Carryforward'.
TEMP = I_GLSUMMARY-UMBTR.
ELSE.
I_GLSUMMARY-UMBTR = TEMP + I_GLSUMMARY-BMBTR.
TEMP = I_GLSUMMARY-UMBTR.
ENDIF.
MODIFY I_GLSUMMARY.
ENDLOOP.
LOOP AT I_GLSUMMARY WHERE MONAT = '17'.
I_GLSUMMARY-MONAT = 'Total'.
I_GLSUMMARY-DMBTR = TDEB.
I_GLSUMMARY-CMBTR = TCRD.
I_GLSUMMARY-BMBTR = TDIF.
MODIFY I_GLSUMMARY.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*&---------------------------------------------------------------------*
*& Form FIELD_CATALOG_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELD_CATALOG_BUILD .
FCAT-FIELDNAME = 'MONAT'.
FCAT-REPTEXT = 'Period'.
FCAT-OUTPUTLEN = '10'.
FCAT-EMPHASIZE = 'C110'.
APPEND FCAT.
CLEAR FCAT.
FCAT-FIELDNAME = 'DMBTR'.
FCAT-REPTEXT = 'Debit'.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
FCAT-FIELDNAME = 'CMBTR'.
FCAT-REPTEXT = 'Credit'.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
FCAT-FIELDNAME = 'BMBTR'.
FCAT-REPTEXT = 'Balance'.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
FCAT-FIELDNAME = 'UMBTR'.
FCAT-REPTEXT = 'Cum. balance'.
FCAT-OUTPUTLEN = '15'.
APPEND FCAT.
ENDFORM. " FIELD_CATALOG_BUILD
INCLUDE ZRFGLBALANCE_N_STATUS_0100O02.
*&---------------------------------------------------------------------*
*& Form OUT_PUT_LIST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_WA text
*----------------------------------------------------------------------*
FORM OUT_PUT_LIST USING P_WA P_E_COLUMN.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Fetching Data For List'.
IF WA-MONAT = 'Total'.
SELECT HKONT
BUKRS
GJAHR
GSBER
MONAT
DMBTR
SHKZG
XNEGP
WAERS AS HWAER
BLDAT
BELNR
ZUONR
BUZEI
AUFNR
AUGBL
AUGDT
BSCHL
BSTAT
BUDAT
DMBE2
DMBE3
BUZID
KOSTL
MWSKZ
PRCTR
SGTXT
VALUT
VBUND
WERKS
XBLNR
XREF3
PROJK
BUPLA
PROPMANO
INTO CORRESPONDING FIELDS OF TABLE IT_LIST
FROM BSIS
WHERE HKONT IN VHKONT AND
BUKRS IN VBUKRS AND
GJAHR EQ V_GJAHR AND
GSBER IN VGSBER .
ELSE.
SELECT HKONT
BUKRS
GJAHR
GSBER
MONAT
DMBTR
SHKZG
XNEGP
WAERS AS HWAER
BLDAT
BELNR
ZUONR
BUZEI
AUFNR
AUGBL
AUGDT
BSCHL
BSTAT
BUDAT
DMBE2
DMBE3
BUZID
KOSTL
MWSKZ
PRCTR
SGTXT
VALUT
VBUND
WERKS
XBLNR
XREF3
PROJK
BUPLA
PROPMANO
INTO CORRESPONDING FIELDS OF TABLE IT_LIST
FROM BSIS
WHERE HKONT IN VHKONT AND
BUKRS IN VBUKRS AND
GJAHR EQ V_GJAHR AND
GSBER IN VGSBER AND
MONAT EQ WA-MONAT.
ENDIF.
SELECT BUKRS
BELNR
GJAHR
BUZEI
LIFNR
MATNR
MENGE
KUNNR
ANLN1
ANLN2
EBELN
EBELP
ETEN2
FILKD
POSN2
VBEL2
VBELN
INTO CORRESPONDING FIELDS OF TABLE I_BSEG
FROM BSEG FOR ALL ENTRIES IN IT_LIST
WHERE BUKRS = IT_LIST-BUKRS AND
BELNR = IT_LIST-BELNR AND
GJAHR = IT_LIST-GJAHR AND
BUZEI = IT_LIST-BUZEI.
LOOP AT I_BSEG.
SELECT SINGLE NAME1 FROM LFA1 INTO I_BSEG-VNAME WHERE LIFNR = I_BSEGLIFNR.
SELECT SINGLE NAME1 FROM KNA1 INTO I_BSEG-CNAME WHERE KUNNR = I_BSEGKUNNR.
MODIFY I_BSEG.
ENDLOOP.
IF P_E_COLUMN = 'CMBTR'.
DELETE IT_LIST WHERE ( SHKZG = 'S' AND XNEGP = SPACE ) OR ( SHKZG = 'H'
AND XNEGP = 'X' ).
ELSEIF P_E_COLUMN = 'DMBTR'.
DELETE IT_LIST WHERE ( SHKZG = 'H' AND XNEGP = SPACE ) OR ( SHKZG = 'S'
AND XNEGP = 'X' ).
ENDIF.
LOOP AT IT_LIST.
RCNT = RCNT + 1.
IF IT_LIST-SHKZG = 'H'.
IT_LIST-DMBTR = IT_LIST-DMBTR * -1.
ENDIF.
READ TABLE I_BSEG WITH KEY BUKRS = IT_LIST-BUKRS
BELNR = IT_LIST-BELNR
GJAHR = IT_LIST-GJAHR
BUZEI = IT_LIST-BUZEI.
IF SY-SUBRC IS INITIAL.
IT_LIST-LIFNR = I_BSEG-LIFNR.
IT_LIST-KUNNR = I_BSEG-KUNNR.
IT_LIST-MATNR = I_BSEG-MATNR.
IT_LIST-MENGE = I_BSEG-MENGE.
IT_LIST-VNAME = I_BSEG-VNAME.
IT_LIST-CNAME = I_BSEG-CNAME.
IT_LIST-ANLN1 = I_BSEG-ANLN1.
IT_LIST-ANLN2 = I_BSEG-ANLN2.
IT_LIST-EBELN = I_BSEG-EBELN.
IT_LIST-EBELP = I_BSEG-EBELP.
IT_LIST-ETEN2 = I_BSEG-ETEN2.
IT_LIST-FILKD = I_BSEG-FILKD.
IT_LIST-POSN2 = I_BSEG-POSN2.
IT_LIST-VBEL2 = I_BSEG-VBEL2.
IT_LIST-VBELN = I_BSEG-VBELN.
ENDIF.
CONCATENATE IT_LIST-GJAHR '/' WA-MONAT INTO MONT.
IT_LIST-YMONT = MONT.
CONCATENATE IT_LIST-BUKRS IT_LIST-BELNR IT_LIST-GJAHR IT_LISTBUZEI
INTO V_TXTNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = VID
LANGUAGE = SY-LANGU
NAME = V_TXTNAME
OBJECT = VOBJ
TABLES
LINES = I_RDTXT[]
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC EQ 0.
READ TABLE I_RDTXT INDEX 1.
IF SY-SUBRC IS INITIAL.
IT_LIST-LGTXT = I_RDTXT-TDLINE.
ENDIF.
ENDIF.
MODIFY IT_LIST.
CLEAR : MONT,V_TXTNAME.
ENDLOOP.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'List Being Generated'.
ENDFORM. " OUT_PUT_LIST
*&---------------------------------------------------------------------*
*& Form FIELD_CATALOG_FOR_DOUBLE_CLICK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELD_CATALOG_FOR_DOUBLE_CLICK .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'ZRFPOSXEXT'
CHANGING
CT_FIELDCAT = I_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
LOOP AT I_FIELDCAT WHERE FIELDNAME = 'LGTXT'.
I_FIELDCAT-SELTEXT_S = 'Long Text'.
I_FIELDCAT-SELTEXT_M = 'Long Text'.
I_FIELDCAT-SELTEXT_L = 'Long Text'.
I_FIELDCAT-REPTEXT_DDIC = 'Long Text'.
MODIFY I_FIELDCAT.
CLEAR :I_FIELDCAT.
ENDLOOP.
ENDFORM. " FIELD_CATALOG_FOR_DOUBLE_CLICK
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA_FOR_DOUBLE_CLICK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_DATA_FOR_DOUBLE_CLICK .
CLEAR : RCNT.
DESCRIBE TABLE IT_LIST[] LINES RCNT.
MESSAGE S004 WITH RCNT.
FLAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = I_FIELDCAT[]
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_DEFAULT = 'X'
IS_LAYOUT = FLAYOUT
TABLES
T_OUTTAB = IT_LIST[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " DISPLAY_DATA_FOR_DOUBLE_CLICK
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
READ TABLE IT_LIST INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC IS INITIAL.
SET PARAMETER ID 'BLN' FIELD IT_LIST-BELNR.
SET PARAMETER ID 'BUK' FIELD IT_LIST-BUKRS.
SET PARAMETER ID 'GJR' FIELD IT_LIST-GJAHR.
SET PARAMETER ID 'BUZ' FIELD IT_LIST-BUZEI.
CALL TRANSACTION 'FB09D' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM. " USER_COMMAND
Screen 100
PAI
MOVE SY-UCOMM TO L_UCOMM.
CASE SY-UCOMM.
WHEN C_BACK.
LEAVE TO SCREEN 0.
WHEN SY-UCOMM.
LEAVE TO SCREEN 0.
WHEN SY-UCOMM.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
PBO
DATA : GR_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
SET PF-STATUS 'ZSTS'.
SET TITLEBAR 'ZTITL'.
CREATE OBJECT CONTAINER1
EXPORTING
CONTAINER_NAME = 'CUSTOM1'.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTAINER1.
CREATE OBJECT GR_EVENT_HANDLER.
*——Registering handler methods to handle alv grid event
SET HANDLER GR_EVENT_HANDLER->HANDLE_DOUBLE_CLICK FOR GRID.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = I_GLSUMMARY[]
IT_FIELDCATALOG = FCAT[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
CLEAR : CNT.
*-------------Account
DESCRIBE TABLE VHKONT LINES CNT.
IF CNT = '01'.
READ TABLE VHKONT INDEX 1.
BSIS-HKONT = VHKONT-LOW.
SELECT SINGLE TXT20 INTO VGLN FROM SKAT WHERE SAKNR =
VHKONT-LOW.
SHIFT BSIS-HKONT LEFT DELETING LEADING '0'.
ELSE.
BSIS-HKONT = '*'.
ENDIF.
*-------------Company Code
READ TABLE VBUKRS INDEX 1.
T001-BUKRS = VBUKRS-LOW.
SELECT SINGLE BUTXT INTO VCOM FROM T001 WHERE BUKRS = VBUKRS-LOW.
*-------------Business Area
IF VGSBER[] IS NOT INITIAL.
CLEAR : CNT.
DESCRIBE TABLE VGSBER LINES CNT.
IF CNT = '01'.
READ TABLE VGSBER INDEX 1.
BSIS-GSBER = VGSBER-LOW.
SELECT SINGLE GTEXT INTO VBUS FROM TGSBT WHERE GSBER = VGSBER-LOW
AND SPRAS = 'EN'.
ELSE.
BSIS-GSBER = '*'.
ENDIF.
ELSE.
BSIS-GSBER = '*'.
ENDIF.
*-------------Fiscal Year
VGJAHR = VGJAHR+3(4).
*------------All documents in currency
VDCR = '*'.
*------------Display currency




































8. ALV Autorefresh:
*&---------------------------------------------------------------------*
*& Report Z_TEST_DURGESH
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
"REPORT Z_TEST_DURGESH.
REPORT zpwtest8.
CLASS lcl_timer DEFINITION DEFERRED .
DATA : i_ekpo TYPE TABLE OF ekpo .
DATA : ob_grid TYPE REF TO cl_gui_alv_grid ,
ob_recev TYPE REF TO lcl_timer ,
ob_timer TYPE REF TO cl_gui_timer .
*----------------------------------------------------------------------*
* CLASS lcl_receiver DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_timer DEFINITION.
PUBLIC SECTION.
METHODS:
handle_finished FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_receiver DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_receiver IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_timer IMPLEMENTATION.
METHOD handle_finished.
PERFORM refresh_data .
MESSAGE s003(z001) WITH 'Report refreshed at' sy-uzeit.
CALL METHOD ob_timer->run.
ENDMETHOD. "handle_finished
ENDCLASS. "lcl_receiver IMPLEMENTATION
*--------------------------------------------------------------------*
* Start of Selection
*--------------------------------------------------------------------*
START-OF-SELECTION .
PERFORM select_data .
*--------------------------------------------------------------------*
* End of Selection
*--------------------------------------------------------------------*
END-OF-SELECTION .
* Step 1 : Initialise Time control
CREATE OBJECT ob_timer.
* Step 2 : Initialise object to receive event
CREATE OBJECT ob_recev.
* Step 3 : Couple event to method
SET HANDLER ob_recev->handle_finished FOR ob_timer. "
* Step 4 : Set Interval in seconds
ob_timer->interval = 20 .
* Step 5 : Start Timer
CALL METHOD ob_timer->run.
PERFORM display_data .
*--------------------------------------------------------------------*
*& Form Select_Date
*--------------------------------------------------------------------*
FORM select_data .
SELECT *
APPENDING TABLE i_ekpo
FROM ekpo .
ENDFORM. "SELECT_DATA
*&---------------------------------------------------------------------*
*& Form refresh_data
*&---------------------------------------------------------------------*
FORM refresh_data .
* Get grid reference
IF ob_grid IS INITIAL .
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ob_grid.
ENDIF.
IF ob_grid IS NOT INITIAL. "Sanity Test
PERFORM select_data .
CALL METHOD ob_grid->refresh_table_display.
ENDIF.
ENDFORM. "refresh_data
*&---------------------------------------------------------------------*
*& Form display_data
*&---------------------------------------------------------------------*
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_structure_name = 'EKPO'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM . "display_data

9. Default Variant:
*&---------------------------------------------------------------------*
*& Report Z_TEST_DURGESH
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST_DURGESH.
data: report type rsvar-report value 'Z_LOOSE_STOCK_DOWNLOAD',
variant type rsvar-variant .
variant = 'DLD'.
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
REPORT = 'Z_LOOSE_STOCK_DOWNLOAD'
VARIANT = variant
EXCEPTIONS
VARIANT_NOT_EXISTENT = 1
VARIANT_OBSOLETE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
submit (report) via selection-screen
and return.
else.
submit (report) via selection-screen
using selection-set variant
and return.
ENDIF.

10. Download Data:
**********************************************************************
* Title : GIA Report Check.
* Desription : GIA Report Check.
* Type : REPORT
* T code : ZGIA
* Author : Durgesh Singh
* Functional : Rakesh Churri
* Date : 19/03/2011
* Version : 1
* Modifications :
**********************************************************************
REPORT ZSD_GIA_REPORT MESSAGE-ID ZGIA NO STANDARD PAGE HEADING.
TYPE-POOLS: TRUXS.
TABLES: ZSD_GIA, SSCRFIELDS, MCHB,ZLARGE_STONE_HDR,ZLARGE_STONE_ITM,EKBE,ZFLU
ORES_CODE.
*INCLUDE cntl.
TYPES: BEGIN OF T_ITTAB,
REPORT(13) TYPE C,
WEIGHT(8) TYPE C,
CHARG(10) TYPE C,
END OF T_ITTAB.
DATA : BEGIN OF I_ERROR OCCURS 0,
REPORT(13) TYPE C,
CHARG(10) TYPE C,
WEIGHT(8) TYPE C,
ERROR(50) TYPE C,
END OF I_ERROR.
data : val3 TYPE string,
val4 TYPE string.
DATA : BEGIN OF I_ZLARGE_HDR OCCURS 0.
INCLUDE STRUCTURE ZLARGE_STONE_HDR.
DATA : END OF I_ZLARGE_HDR.
DATA : BEGIN OF I_ZLARGE_ITM OCCURS 0.
INCLUDE STRUCTURE ZLARGE_STONE_ITM.
DATA : END OF I_ZLARGE_ITM.
DATA : BEGIN OF I_TEMP OCCURS 0.
INCLUDE STRUCTURE ZSD_GIA.
DATA : END OF I_TEMP.
DATA : BEGIN OF I_ERROR1 OCCURS 0,
REPORT(13) TYPE C,
CHARG(10) TYPE C,
WEIGHT(8) TYPE C,
ERROR(50) TYPE C,
FLG TYPE C,
END OF I_ERROR1.
FIELD-SYMBOLS: TYPE T_ITTAB .
DATA: IT_FILE TYPE T_ITTAB OCCURS 0 WITH HEADER LINE,
WA_FILE TYPE ZSD_GIA,
VAL1 TYPE I VALUE 0,
sapno TYPE ZLARGE_STONE_HDR-sapno,
litem TYPE i,
litem1 TYPE i,
rval TYPE i.
DATA: URL(250) TYPE C,"STRING,
PATH(50) TYPE C."string.
DATA:STATUS_CODE TYPE C,
STATUS_TEXT TYPE C,
P_FILE TYPE RLGRAP-FILENAME,
FLG TYPE I VALUE 0.
TYPES: BEGIN OF T_DATATAB,
COL1(30) TYPE C,
COL2(50) TYPE C,
END OF T_DATATAB.
DATA: IT_DATATAB TYPE STANDARD TABLE OF T_DATATAB WITH HEADER LINE,
EXCEL2 TYPE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE,
EXCEL3 TYPE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE,
WA_GIA TYPE ZSD_GIA,
WEIGHT(8) TYPE C,
TDATE(10) TYPE C,
WA_DATATAB TYPE T_DATATAB.
DATA: TCHARG TYPE EKET-CHARG.
DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA.
FIELD-SYMBOLS : TYPE T_DATATAB,
TYPE ALSMEX_TABLINE,
TYPE ALSMEX_TABLINE.
SELECTION-SCREEN: BEGIN OF BLOCK SCR_BLK WITH FRAME TITLE TEXT-002.
PARAMETER: PFILEIT LIKE RLGRAP-FILENAME OBLIGATORY MEMORY ID ITM.
*SKIP 2.
SELECTION-SCREEN: END OF BLOCK SCR_BLK.
*
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT. " ALV Variant
SELECTION-SCREEN END OF BLOCK B3.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFILEIT.
PERFORM F4_HELP_P_FILE_IT.
START-OF-SELECTION.
PERFORM UPLOAD_FILE.
PERFORM WEIGHT_VALIDATION.
IF I_ERROR[] IS INITIAL.
LOOP AT IT_FILE ASSIGNING .
FLG = 0.
SELECT SINGLE CHARG FROM EKBE INTO TCHARG
WHERE CHARG = -CHARG.
IF SY-SUBRC NE 0.
* MESSAGE E003 with -CHARG.
I_ERROR1-REPORT = -REPORT.
I_ERROR1-CHARG = -CHARG.
I_ERROR1-WEIGHT = -WEIGHT.
I_ERROR1-ERROR = 'Invalid Batch No.'.
I_ERROR1-FLG = 'E'.
APPEND I_ERROR1.
FLG = 1.
ENDIF.
IF FLG = 0.
CONCATENATE 'http://www2.gia.edu/reportcheck/index.cfm?fuseaction=h
ome.showReportVerification&reportno=' -REPORT INTO URL .
CONCATENATE URL '&weight=' INTO URL.
WEIGHT = -WEIGHT.
CONCATENATE URL WEIGHT INTO URL.
CONDENSE URL NO-GAPS.
* * URL = 'http://www.hrdantwerplink.be/?record_number=0900136600
1&weight=4.01&L='.
DATA:DATE TYPE SY-DATUM.
DATE = SY-DATUM.
* \192.168.155.3\gia " old dubai server path
PATH = '\192.168.160.3\gia

Related Interests

    .
    CONCATENATE PATH DATE INTO PATH.
    CONCATENATE PATH '.cfm' INTO PATH.
    CONDENSE URL NO-GAPS.
    CONDENSE PATH NO-GAPS.
    CALL FUNCTION 'HTTP_GET_FILE_DP'
    EXPORTING
    ABSOLUTE_URI = URL
    DOCUMENT_PATH = PATH
    IMPORTING
    STATUS_CODE = STATUS_CODE
    STATUS_TEXT = STATUS_TEXT
    * TABLES
    * RESPONSE_HEADERS =
    * EXCEPTIONS
    * DP_ERROR = 1
    * OTHERS = 2
    .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * WAIT UP TO 1 SECONDS.
    P_FILE = PATH.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = P_FILE
    I_BEGIN_COL = '1'
    I_BEGIN_ROW = '1'
    I_END_COL = '2'
    I_END_ROW = '31'
    TABLES
    INTERN = EXCEL2[].
    * EXCEPTIONS
    * INCONSISTENT_PARAMETERS = 1
    * UPLOAD_OLE = 2
    * OTHERS = 3
    .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM UPLOAD_TABLE.
    ENDIF.
    ENDLOOP.
    WRITE :/5 'Batch updated successully' COLOR 6.
    ULINE.
    FORMAT COLOR 1.
    WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
    ULINE.
    LOOP AT I_TEMP WHERE CUT IS NOT INITIAL AND CLARITY IS NOT INITIAL AND COLOR
    IS NOT INITIAL and shape is NOT INITIAL.
    IF VAL1 = 0.
    VAL1 = 1.
    FORMAT COLOR 3.
    ELSE.
    VAL1 = 0.
    FORMAT COLOR 6.
    ENDIF.
    WRITE :/5 I_TEMP-CHARG, 30 I_TEMP-REPORT, 50 I_TEMPWEIGHT,
    70(50) 'Record uploaded successfully'.
    ENDLOOP.
    ULINE.
    SKIP 3.
    WRITE :/5 'Error occured in batch' COLOR 5.
    ULINE.
    FORMAT COLOR 1.
    WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
    ULINE.
    LOOP AT I_ERROR1.
    IF VAL1 = 0.
    VAL1 = 1.
    FORMAT COLOR 3.
    ELSE.
    VAL1 = 0.
    FORMAT COLOR 6.
    ENDIF.
    WRITE :/5 I_ERROR1-CHARG, 30 I_ERROR1-REPORT, 50 I_ERROR1-
    WEIGHT, 70(50) I_ERROR1-ERROR.
    ENDLOOP.
    SKIP 3.
    WRITE :/5 'Batch uploaded with blank field' COLOR 5.
    ULINE.
    FORMAT COLOR 1.
    WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
    ULINE.
    LOOP AT I_TEMP WHERE CUT IS INITIAL or CLARITY IS INITIAL or COLOR IS INITIAL
    or shape is INITIAL.
    IF VAL1 = 0.
    VAL1 = 1.
    FORMAT COLOR 3.
    ELSE.
    VAL1 = 0.
    FORMAT COLOR 6.
    ENDIF.
    WRITE :/5 I_TEMP-CHARG, 30 I_TEMP-REPORT, 50 I_TEMPWEIGHT,
    70(50) 'Record updated with blank field'.
    ENDLOOP.
    ENDIF.
    ***********************************************************************
    *&---------------------------------------------------------------------*
    *& Form FILTER_TABLE
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM UPLOAD_TABLE .
    CLEAR : EXCEL3[].
    excel3[] = excel2[].
    delete ADJACENT DUPLICATES FROM excel2 COMPARING row.
    LOOP AT EXCEL2 ASSIGNING .
    CASE -VALUE.
    WHEN 'Date of Issue:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    CONDENSE -VALUE NO-GAPS.
    PERFORM CONVERT_DATE USING -VALUE CHANGING WA_GIA-ISDAT.
    ENDIF.
    WHEN 'Measurements:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-MGRMENT = -VALUE.
    ENDIF.
    "------Shape just above from measurment line-------------------------
    rval = ( -row - 1 ).
    READ TABLE excel3 ASSIGNING WITH KEY row = rval col = 1 .
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZSHAPE4 INTO WA_GIA-SHAPE WHERE DESCR = -
    VALUE.
    WHEN 'Carat Weight:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-WEIGHT = -WEIGHT.
    ENDIF.
    WHEN 'Color Grade:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-COLOR = -VALUE.
    ENDIF.
    WHEN 'Color:'.
    READ TABLE excel3 ASSIGNING WITH KEY value = ' Grade:'.
    IF sy-subrc eq 0.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    WA_GIA-COLOR = -VALUE.
    ENDIF.
    WHEN 'Clarity Grade:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-CLARITY = -VALUE.
    ENDIF.
    WHEN 'Cut Grade:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIA-CUT WHERE DESCR = -
    VALUE.
    ENDIF.
    WHEN 'Depth:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-DEPTHPER = -VALUE.
    ENDIF.
    WHEN 'Table:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-TABLEPER = -VALUE.
    ENDIF.
    WHEN 'Crown Angle:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    CLEAR : val3, val4.
    SPLIT -VALUE AT '°' INTO val3 val4.
    WA_GIA-CROWNANG = val3.
    ENDIF.
    WHEN 'Crown Height:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-CROWN_HEIGHT = -VALUE.
    ENDIF.
    WHEN 'Pavilion Angle:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    CLEAR : val3, val4.
    SPLIT -VALUE AT '°' INTO val3 val4.
    WA_GIA-PAVILINANG = val3.
    ENDIF.
    WHEN 'Pavilion Depth:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-PAVILIONDEP = -VALUE.
    ENDIF.
    WHEN 'Star length:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-STAR = -VALUE.
    ENDIF.
    WHEN 'Lower Half:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    WA_GIA-LOWERHALF = -VALUE.
    ENDIF.
    WHEN 'Girdle:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIAGIRDLE
    WHERE DESCR = -VALUE.
    ENDIF.
    WHEN 'Culet:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIACULETSIZE
    WHERE DESCR = -VALUE.
    ENDIF.
    WHEN 'Polish:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIAPOLISH
    WHERE DESCR = -VALUE.
    ENDIF.
    WHEN 'Symmetry:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIASYMMETRY
    WHERE DESCR = -VALUE.
    ENDIF.
    WHEN 'Fluorescence:'.
    READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
    IF sy-subrc eq 0.
    TRANSLATE -VALUE TO UPPER CASE.
    SELECT SINGLE FLUORES FROM ZFLUORES_CODE INTO WA_GIAFL
    WHERE DESCR = -VALUE.
    ENDIF.
    ENDCASE.
    ENDLOOP.
    "WA_GIA-SHAPE = 'TESTING'.
    WA_GIA-CHARG = -CHARG.
    WA_GIA-REPORT = -REPORT.
    WA_GIA-WEIGHT = -WEIGHT.
    MOVE-CORRESPONDING WA_GIA TO ZSD_GIA.
    *IF WA_GIA-CUT IS NOT INITIAL AND WA_GIA-CLARITY IS NOT INITIAL AND WA_GIACOLOR
    IS NOT INITIAL and WA_GIA-shape is NOT INITIAL.
    *-----------Enter Record in ZSD_GIA table.
    MODIFY ZSD_GIA.
    *-----------Enter Record in zlarge_stone_hdr table.
    SELECT SINGLE * INTO i_zlarge_hdr FROM zlarge_stone_hdr WHERE BATNO = WA_GI
    A-charg.
    IF sy-subrc is not INITIAL.
    SELECT MAX( SAPNO ) FROM zlarge_stone_hdr INTO sapno .
    i_zlarge_hdr-batno = WA_GIA-charg.
    i_zlarge_hdr-sapno = sapno + 1.
    i_zlarge_hdr-ERSDA = sy-datum.
    i_zlarge_hdr-ERNAM = sy-uname.
    MOVE-CORRESPONDING i_zlarge_hdr to zlarge_stone_hdr.
    modify zlarge_stone_hdr.
    ENDIF.
    *-----------Enter Record in zlarge_stone_itm table.
    SELECT SINGLE * INTO i_zlarge_itm FROM zlarge_stone_itm WHERE BATNO = WA_GIAcharg
    and lab = 'GIA'.
    IF sy-subrc is not INITIAL.
    SELECT MAX( SAPNO ) FROM zlarge_stone_hdr INTO sapno .
    SELECT count( * ) FROM zlarge_stone_itm INTO litem1 where batno = WA_GIAcharg
    and SEL = 'X'.
    SELECT count( * ) FROM zlarge_stone_itm INTO litem where batno = WA_GIAcharg.
    i_zlarge_itm-LITEM = ( litem + 1 ) * 10.
    i_zlarge_itm-SAPNO = sapno.
    i_zlarge_itm-batno = WA_GIA-charg.
    i_zlarge_itm-report = WA_GIA-report.
    i_zlarge_itm-WEIGHT = WA_GIA-WEIGHT.
    i_zlarge_itm-RESULTDAT = WA_GIA-ISDAT.
    i_zlarge_itm-MESURMNTS = WA_GIA-MGRMENT.
    i_zlarge_itm-COLOR = WA_GIA-COLOR.
    i_zlarge_itm-CLARITY = WA_GIA-CLARITY.
    i_zlarge_itm-CUT = WA_GIA-CUT.
    i_zlarge_itm-DEPTHPER = WA_GIA-DEPTHPER.
    i_zlarge_itm-TABLEPER = WA_GIA-TABLEPER.
    i_zlarge_itm-CROWNANG = WA_GIA-CROWNANG.
    i_zlarge_itm-CROWN_HEIGHT = WA_GIA-CROWN_HEIGHT.
    i_zlarge_itm-PAVILINANG = WA_GIA-PAVILINANG.
    i_zlarge_itm-PAVILIONDEP = WA_GIA-PAVILIONDEP.
    i_zlarge_itm-star = WA_GIA-star.
    i_zlarge_itm-LOWERHALF = WA_GIA-LOWERHALF.
    i_zlarge_itm-GIRDLE = WA_GIA-GIRDLE.
    i_zlarge_itm-CULETSIZE = WA_GIA-CULETSIZE.
    i_zlarge_itm-POLISH = WA_GIA-POLISH.
    i_zlarge_itm-SYMMETRY = WA_GIA-SYMMETRY.
    i_zlarge_itm-FL = WA_GIA-FL.
    i_zlarge_itm-SHAPE = WA_GIA-SHAPE.
    i_zlarge_itm-LAB = 'GIA'.
    IF litem1 EQ 0.
    i_zlarge_itm-SEL = 'X'.
    ENDIF.
    MOVE-CORRESPONDING i_zlarge_itm to zlarge_stone_itm.
    modify zlarge_stone_itm.
    ENDIF.
    *ENDIF.
    APPEND ZSD_GIA TO I_TEMP.
    CLEAR WA_GIA.
    ENDFORM. " FILTER_TABLE
    *&---------------------------------------------------------------------*
    *& Form F4_HELP_P_FILE_IT
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM F4_HELP_P_FILE_IT .
    DATA : V_FILE LIKE PFILEIT.
    * Display popup with files list to select
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = V_FILE.
    * if file is selected, then
    CHECK SY-SUBRC EQ 0.
    PFILEIT = V_FILE.
    ENDFORM. " F4_HELP_P_FILE_IT
    *&---------------------------------------------------------------------*
    *& Form UPLOAD_FILE
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM UPLOAD_FILE .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = PFILEIT
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = IT_FILE
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    IF IT_FILE[] IS INITIAL.
    MESSAGE E001.
    RETURN.
    ENDIF.
    IF SY-SUBRC NE 0 .
    MESSAGE E002.
    RETURN.
    ENDIF.
    ENDFORM. " UPLOAD_FILE
    *&---------------------------------------------------------------------*
    *& Form CONVERT_DATE
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * -->P_IT_DATATAB_COL2 text
    * <--P_WA_GIA_ISDAT text
    *----------------------------------------------------------------------*
    FORM CONVERT_DATE USING P_IT_DATATAB_COL2
    CHANGING P_WA_GIA_ISDAT.
    TDATE = P_IT_DATATAB_COL2.
    CALL FUNCTION 'Z_CONVERT_TO_INTERNAL_FORMAT1'
    EXPORTING
    IM_INPUT = TDATE
    IMPORTING
    EX_OUTPUT = P_WA_GIA_ISDAT
    * EXCEPTIONS
    * INVALID_DATE = 1
    * OTHERS = 2.
    .
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    .
    ENDFORM. " CONVERT_DATE
    *&---------------------------------------------------------------------*
    *& Form WEIGHT_VALIDATION
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM WEIGHT_VALIDATION .
    DATA : I_WT(3) TYPE C,
    D_WT(3) TYPE C,
    VAL TYPE I VALUE 0.
    LOOP AT IT_FILE.
    SPLIT IT_FILE-WEIGHT AT '.' INTO I_WT D_WT.
    IF STRLEN( D_WT ) NE 2.
    I_ERROR-REPORT = IT_FILE-REPORT.
    I_ERROR-CHARG = IT_FILE-CHARG.
    I_ERROR-WEIGHT = IT_FILE-WEIGHT.
    I_ERROR-ERROR = 'Decimal part of weight must be of length 2 only.'.
    APPEND I_ERROR.
    ENDIF.
    ENDLOOP.
    IF I_ERROR[] IS NOT INITIAL.
    ULINE.
    FORMAT COLOR 1.
    WRITE :/5 'Batch No', 30 'Report No', 50 'Weight', 70(50) 'Error'.
    ULINE.
    LOOP AT I_ERROR.
    IF VAL = 0.
    VAL = 1.
    FORMAT COLOR 3.
    ELSE.
    VAL = 0.
    FORMAT COLOR 6.
    ENDIF.
    WRITE :/5 I_ERROR-CHARG, 30 I_ERROR-REPORT, 50 I_ERRORWEIGHT,
    70(50) I_ERROR-ERROR.
    ENDLOOP.
    ENDIF.
    ENDFORM. " WEIGHT_VALIDATION

    11. Upload Data in Back Ground:
    *&---------------------------------------------------------------------*
    *& Report Z_LOOSE_STOCK_DOWNLOAD
    *&---------------------------------------------------------------------*
    *& Report For Finding Loose Stock Matching
    *& Developed By : Durgesh Singh
    *& Developed On : 24.08.2011
    *& Functional : Rakesh Churi
    *& T. Code :
    *& Modification :
    *&---------------------------------------------------------------------*
    REPORT Z_LOOSE_STOCK_DOWNLOAD.
    TABLES : MCHB, ZMCHB.
    DATA: BEGIN OF I_MCHB OCCURS 0,
    MATNR TYPE MCHB-MATNR,
    WERKS TYPE MCHB-WERKS,
    LGORT TYPE MCHB-LGORT,
    CHARG TYPE MCHB-CHARG,
    CLABS TYPE MCHB-CLABS,
    NORMT TYPE MARA-NORMT,
    MAKTX TYPE MAKT-MAKTX,
    END OF I_MCHB,
    BEGIN OF I_TAB OCCURS 0,
    MATNR(18) TYPE C,
    WERKS(4) TYPE C,
    LGORT(4) TYPE C,
    CHARG(10) TYPE C,
    CLABS(13) TYPE C,
    NORMT(18) TYPE C,
    MAKTX(40) TYPE C,
    TEMP(1) TYPE C,
    END OF I_TAB.
    DATA : I_ZMCHB TYPE STANDARD TABLE OF ZMCHB WITH HEADER LINE.
    DATA : E_FILE LIKE RLGRAP-FILENAME,
    HTAB(1) TYPE C,
    STR(110) TYPE C,
    LENG TYPE I,
    VAL TYPE I.
    SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-001.
    PARAMETERS : V_DLD RADIOBUTTON GROUP GRP1,
    V_UPD RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN END OF BLOCK BLK01.
    START-OF-SELECTION.
    IF V_DLD = 'X'.
    PERFORM DOWNLOAD.
    ELSE.
    PERFORM UPLOAD.
    ENDIF.
    *&---------------------------------------------------------------------*
    *& Form DOWNLOAD
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM DOWNLOAD .
    SELECT A~MATNR
    A~WERKS
    A~LGORT
    A~CHARG
    A~CLABS
    B~NORMT
    C~MAKTX
    INTO CORRESPONDING FIELDS OF TABLE I_MCHB
    FROM MCHB AS A LEFT JOIN MARA AS B
    ON A~MATNR = B~MATNR
    LEFT JOIN MAKT AS C
    ON A~MATNR = C~MATNR
    WHERE A~WERKS IN ('7100','8100','9200') AND
    A~CLABS NE 0 AND
    A~LGORT EQ 'DNAC'.
    SELECT MATNR
    WERKS
    LGORT
    CHARG
    CLABS
    NORMT
    MAKTX
    INTO CORRESPONDING FIELDS OF TABLE I_ZMCHB
    FROM ZMCHB WHERE CLABS NE 0.
    LOOP AT I_ZMCHB.
    MOVE-CORRESPONDING I_ZMCHB TO I_TAB.
    I_TAB-TEMP = '@'.
    APPEND I_TAB.
    ENDLOOP.
    LOOP AT I_MCHB.
    READ TABLE I_ZMCHB WITH KEY MATNR = I_MCHB-MATNR
    WERKS = I_MCHB-WERKS
    LGORT = I_MCHB-LGORT
    CHARG = I_MCHB-CHARG.
    IF SYSUBRC
    IS NOT INITIAL. " append data that exist in MCHB and not exist in table
    ZMCHB
    MOVE-CORRESPONDING I_MCHB TO I_TAB.
    I_TABTEMP
    = '@'. "temprary variable for frmat line at upload only.
    APPEND I_TAB.
    ENDIF.
    ENDLOOP.
    READ TABLE I_TAB WITH KEY WERKS = '8100'.
    IF SY-SUBRC IS INITIAL.
    "E_FILE = '\192.168.12.12\Downloads\RJCDLD.TXT'.
    E_FILE = '\192.168.50.36\Downloads\RJCDLD.TXT'.
    ELSE.
    "E_FILE = '\192.168.12.12\Downloads\FSGDLD.TXT'.
    E_FILE = '\192.168.12.7\Downloads\FSGDLD.TXT'.
    ENDIF.
    OPEN DATASET E_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT I_TAB.
    TRANSFER I_TAB TO E_FILE.
    ENDLOOP.
    CLOSE DATASET E_FILE.
    ENDFORM. " DOWNLOAD
    *&---------------------------------------------------------------------*
    *& Form UPLOAD
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM UPLOAD .
    * E_FILE = '\192.168.12.12\Downloads00DLD.TXT'.
    IF SY-MANDT = '009'.
    E_FILE = '\192.168.12.7\Downloads00DLD.TXT'.
    ELSEIF SY-MANDT = '007'.
    E_FILE = '\192.168.50.36\Downloads00DLD.TXT'.
    ENDIF.
    OPEN DATASET E_FILE FOR INPUT IN BINARY MODE.
    IF SY-SUBRC IS INITIAL.
    DO.
    READ DATASET E_FILE INTO STR LENGTH LENG .
    I_TAB-MATNR = STR+0(18).
    I_TAB-WERKS = STR+18(4).
    I_TAB-LGORT = STR+22(4).
    I_TAB-CHARG = STR+26(10).
    I_TAB-CLABS = STR+36(13).
    I_TAB-NORMT = STR+49(18).
    I_TAB-MAKTX = STR+67(40).
    APPEND I_TAB.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET E_FILE.
    DESCRIBE TABLE I_TAB LINES VAL.
    DELETE I_TAB INDEX VAL.
    IF SY-MANDT = '009'.
    LOOP AT I_TAB WHERE WERKS NE '8100'.
    MOVE-CORRESPONDING I_TAB TO I_ZMCHB.
    APPEND I_ZMCHB.
    ENDLOOP.
    ELSEIF SY-MANDT = '007'.
    LOOP AT I_TAB WHERE WERKS EQ '8100'.
    MOVE-CORRESPONDING I_TAB TO I_ZMCHB.
    APPEND I_ZMCHB.
    ENDLOOP.
    ENDIF.
    MODIFY ZMCHB FROM TABLE I_ZMCHB.
    ENDIF.
    ENDFORM. " UPLOAD

    12. Email Report:
    DATA: lt_mailrecipients TYPE STANDARD TABLE OF somlrec90 WITH HEADER LINE,
    lt_mailtxt TYPE STANDARD TABLE OF soli WITH HEADER LINE,
    lt_attachment TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
    lt_mailsubject TYPE sodocchgi1,
    lt_packing_list TYPE STANDARD TABLE OF zsopcklsti1 WITH HEADER LIN
    E,
    gv_cnt TYPE i,
    gd_subject like sodocchgi1-obj_descr,
    it_mess_att like solisti1 occurs 0 with header line.
    DATA : cts TYPE string,
    pcs TYPE string,
    weight1 TYPE string,
    diff1 TYPE string,
    subject TYPE string.
    DATA : BEGIN OF i_email OCCURS 0,
    emailid TYPE zemailid-EMAIL_ID,
    END OF i_email.
    SELECT email_id INTO TABLE i_email from zemailid.
    LOOP AT i_email.
    lt_mailrecipients-rec_type = 'U'.
    lt_mailrecipients-com_type = 'INT'.
    lt_mailrecipients-RECEIVER = i_email-emailid.
    APPEND lt_mailrecipients .
    CLEAR lt_mailrecipients .
    ENDLOOP.
    CLEAR : subject.
    Data: temp type string.
    Clear : temp.
    CONCATENATE '-' sloc into temp.
    * CONCATENATE 'PLEASE FIND ATTACHMENT FOR HKSTOCK
    STATUS FOR STORAGE LOCATION -
    ' sloc ' OF PLANT: ' plant1 ' AS ON: ' sdate ', ' stime
    * INTO subject. "Commented by raj
    CONCATENATE 'PLEASE FIND ATTACHMENT FOR HKSTOCK
    STATUS FOR STORAGE LOCATION' temp 'OF PLANT: ' plant1 'AS ON: ' sdate '
    , ' stime
    INTO subject SEPARATED BY SPACE.
    lt_mailtxt = subject. APPEND lt_mailtxt. CLEAR lt_mailtxt.
    APPEND lt_mailtxt. CLEAR lt_mailtxt.
    lt_mailtxt = 'Thanks,'. APPEND lt_mailtxt. CLEAR lt_mailtxt.
    lt_mailtxt = 'SAP'. APPEND lt_mailtxt. CLEAR lt_mailtxt.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    CONCATENATE 'STOCK STATUS FOR STORAGE LOCATION -
    ' sloc 'OF PLANT : ' plant1 'AS ON : ' sdate ' ' stime
    INTO lt_attachment.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    *"------------------------------Insert Record For DISPLAY System Inventory
    CONCATENATE 'Stock Batches not in System Inventory' ' '
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    CONCATENATE 'Batch No.' ' '
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    LOOP AT IT_PCODE INTO WA_PCODE.
    CONCATENATE wa_pcode-charg ' '
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    ENDLOOP.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    "------------------------------End Of DISPLAY System Inventory
    "------------------------------Insert Record For DISPLAY Physical Inventory
    CONCATENATE 'Stock Batches not in Physical Inventory' ' '
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    CONCATENATE 'Batch No.' 'Plant' 'Material No.' 'Material Description' 'Stor
    age Location' 'Qty in CTS' 'Qty in Pcs' 'Batch Description'
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    loop at IT_DATA_ST INTO WA_DATA .
    CLEAR : cts, pcs.
    cts = WA_DATA-CLABS.
    pcs = WA_DATA-ext_menge01.
    CONCATENATE WA_DATA-charg WA_DATA-werks WA_DATA-MATNR WA_DATAMAKTX
    WA_DATA-LGORT cts pcs WA_DATA-STATUS
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    ENDLOOP.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    "------------------------------End Of DISPLAY Physical Inventory
    *"------------------------------
    Insert Record For DISPLAY System and Physical Inventory
    CONCATENATE 'Stock Batches in System and Physical Inventory' ' '
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    CONCATENATE 'Batch No.' 'Plant' 'Material No.' 'Material Description' 'Stor
    age Location' 'Qty in CTS' 'Qty in Pcs' 'Phy. Weight' 'Difference'
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    LOOP AT IT_BCODE_WT INTO WA_SCODE.
    CLEAR : cts, pcs,weight1,diff1.
    cts = WA_SCODE-CLABS.
    pcs = WA_SCODE-ext_menge01.
    weight1 = WA_SCODE-weight.
    diff1 = WA_SCODE-DIFF.
    CONCATENATE WA_SCODE-charg WA_SCODE-werks WA_SCODE-MATNR WA_SCODEMAKTX
    WA_SCODE-LGORT cts pcs weight1 diff1
    INTO lt_attachment SEPARATED BY
    cl_abap_char_utilities=>horizontal_tab.
    CONCATENATE cl_abap_char_utilities=>newline lt_attachment
    INTO lt_attachment.
    APPEND lt_attachment. CLEAR lt_attachment.
    ENDLOOP.
    "------------------------------End Of DISPLAY System and Physical Inventory
    CLEAR : subject.
    CONCATENATE 'STOCK STATUS - ' ' SAP SYSTEM GENERATED EMAIL'
    INTO subject.
    lt_packing_list-transf_bin = SPACE.
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 0.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = LINES( lt_attachment ).
    lt_packing_list-doc_type = 'RAW'.
    APPEND lt_packing_list. CLEAR lt_packing_list.
    lt_packing_list-transf_bin = 'X'.
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 1.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = LINES( lt_attachment ).
    lt_packing_listdoc_
    type = 'XLS'. " You can give RAW incase if you want just a txt file.
    lt_packing_list-obj_name = 'ZBARCODE_WT'.
    lt_packing_list-obj_descr = 'ZBARCODE_WT'.
    lt_packing_list-doc_size = lt_packing_list-body_num * 255.
    APPEND lt_packing_list. CLEAR lt_packing_list.
    lt_mailsubject-obj_name = 'MAILATTCH'.
    lt_mailsubject-obj_langu = sy-langu.
    lt_mailsubject-obj_descr = subject.
    lt_mailsubject-sensitivty = 'F'.
    gv_cnt = LINES( lt_attachment ).
    lt_mailsubject-doc_size = ( gv_cnt -
    1 ) * 255 + STRLEN( lt_attachment ).
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = lt_mailsubject
    TABLES
    packing_list = lt_packing_list
    contents_bin = lt_attachment
    contents_txt = lt_mailtxt
    receivers = lt_mailrecipients
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    IF sy-subrc EQ 0.
    COMMIT WORK.
    SUBMIT rsconn01 WITH MODE = 'INT' AND RETURN.
    ENDIF.

    13. PDF On Screen 1:
    Driver Program
    *&---------------------------------------------------------------------*
    *& Report Z_PDF_CONVERT
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    REPORT Z_PDF_CONVERT NO STANDARD PAGE HEADING.
    DATA : GS_PRINT_PARMS TYPE PRI_PARAMS,
    L_VALID TYPE STRING,
    GS_TSP01 TYPE TSP01,
    GV_RQ2NAME TYPE TSP01-RQ2NAME.
    DATA: CONTROL TYPE SSFCTRLOP,
    ERRTAB TYPE TSFERROR,
    OUTPUT TYPE SSFCOMPOP,
    FMCNP TYPE RS38L_FNAM.
    PARAMETERS :
    VAL AS CHECKBOX.
    IF VAL = 'X'.
    CONCATENATE SY-REPID+0(9) SY-UNAME+0(3) INTO GV_RQ2NAME.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    DESTINATION = 'LOCL'
    LAYOUT = 'X_65_80'
    LINE_SIZE = '80'
    NO_DIALOG = 'X'
    IMPORTING
    OUT_PARAMETERS = GS_PRINT_PARMS
    VALID = L_VALID
    EXCEPTIONS
    ARCHIVE_INFO_NOT_FOUND = 1
    INVALID_PRINT_PARAMS = 2
    INVALID_ARCHIVE_PARAMS = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    GS_PRINT_PARMS-PRIMM = ' '.
    GS_PRINT_PARMS-PRCOP = '1'.
    DELETE FROM TSP01
    WHERE RQ2NAME EQ GV_RQ2NAME.
    SUBMIT Z_PDF_CONVERT TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    SPOOL PARAMETERS GS_PRINT_PARMS
    AND RETURN.
    SELECT SINGLE *
    FROM TSP01
    INTO GS_TSP01
    WHERE RQOWNER EQ SY-UNAME.
    IF SY-SUBRC EQ 0.
    CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
    EXPORTING
    SPOOLNO = GS_TSP01-RQIDENT
    NAME = GS_TSP01-RQO1NAME.
    DELETE TSP01 FROM GS_TSP01.
    COMMIT WORK AND WAIT.
    EXIT.
    ENDIF.
    ELSE.
    DATA: WA_OUTPUT_OPTIONS TYPE SSFCOMPOP.
    DATA :WA_JOB_OUTPUT_INFO TYPE SSFCRESCL,
    JOB_OUTPUT_OPTIONS TYPE SSFCRESOP.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'Z_TEST_DURGESH'
    IMPORTING
    FM_NAME = FMCNP
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    CONTROL-NO_DIALOG = 'X'.
    OUTPUT-TDDEST = 'LOCL'.
    OUTPUT-TDNEWID = 'X'.
    OUTPUT-TDIEXIT = 'X'.
    OUTPUT-TDFINAL = 'X'.
    OUTPUT-TDNOPRINT = ' '.
    CALL FUNCTION FMCNP
    EXPORTING
    USER_SETTINGS = ' '
    CONTROL_PARAMETERS = CONTROL
    OUTPUT_OPTIONS = OUTPUT
    IMPORTING
    JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO
    JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS.
    ENDIF.
    'Z_FM_PDF_DATADISPLAY'
    Import parameter - SPOOLNO TYPE TSP01-RQIDENT
    NAME TYPE RSTSTYPE-NAME
    Source Code –
    DATA: NUMBYTES TYPE I,
    PDFSPOOLID LIKE TSP01-RQIDENT,
    JOBNAME LIKE TBTCJOB-JOBNAME,
    JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
    OBJTYPE LIKE RSTSTYPE-TYPE,
    TYPE LIKE RSTSTYPE-TYPE,
    IS_OTF.
    DATA: PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = SY-MANDT
    NAME = NAME
    PART = 1
    IMPORTING
    TYPE = TYPE
    OBJTYPE = OBJTYPE
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4.
    IF OBJTYPE(3) = 'OTF'.
    IS_OTF = 'X'.
    ELSE.
    IS_OTF = SPACE.
    ENDIF.
    IF IS_OTF = 'X'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    SRC_SPOOLID = SPOOLNO
    NO_DIALOG = ' '
    IMPORTING
    PDF_BYTECOUNT = NUMBYTES
    PDF_SPOOLID = PDFSPOOLID
    BTC_JOBNAME = JOBNAME
    BTC_JOBCOUNT = JOBCOUNT
    TABLES
    PDF = PDF
    EXCEPTIONS
    ERR_NO_OTF_SPOOLJOB = 1
    ERR_NO_SPOOLJOB = 2
    ERR_NO_PERMISSION = 3
    ERR_CONV_NOT_POSSIBLE = 4
    ERR_BAD_DSTDEVICE = 5
    USER_CANCELLED = 6
    ERR_SPOOLERROR = 7
    ERR_TEMSEERROR = 8
    ERR_BTCJOB_OPEN_FAILED = 9
    ERR_BTCJOB_SUBMIT_FAILED = 10
    ERR_BTCJOB_CLOSE_FAILED = 11.
    ELSE.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
    SRC_SPOOLID = SPOOLNO
    NO_DIALOG = ' '
    IMPORTING
    PDF_BYTECOUNT = NUMBYTES
    PDF_SPOOLID = PDFSPOOLID
    BTC_JOBNAME = JOBNAME
    BTC_JOBCOUNT = JOBCOUNT
    TABLES
    PDF = PDF
    EXCEPTIONS
    ERR_NO_ABAP_SPOOLJOB = 1
    ERR_NO_SPOOLJOB = 2
    ERR_NO_PERMISSION = 3
    ERR_CONV_NOT_POSSIBLE = 4
    ERR_BAD_DESTDEVICE = 5
    USER_CANCELLED = 6
    ERR_SPOOLERROR = 7
    ERR_TEMSEERROR = 8
    ERR_BTCJOB_OPEN_FAILED = 9
    ERR_BTCJOB_SUBMIT_FAILED = 10
    ERR_BTCJOB_CLOSE_FAILED = 11.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'D:\durgesh.pdf'
    FILETYPE = 'BIN'
    TABLES
    DATA_TAB = PDF
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22.
    CALL SCREEN 100.
    Screen –
    PBO –
    SET PF-STATUS 'STS'.
    SET TITLEBAR 'TTL'.
    IF MY_MAIN_CONTAINER IS INITIAL.
    CREATE OBJECT MY_MAIN_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'CUSTOM_CNTL'
    EXCEPTIONS
    CNTL_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    EXIT.
    ELSE.
    " -----------------------------------
    " create PDF Viewer object
    CREATE OBJECT MY_PDF_VIEWER
    EXPORTING
    PARENT = MY_MAIN_CONTAINER
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    "could not create PDF Viewer
    ENDIF.
    ENDIF.
    DATA: VIEW_BUTTONS_ACTIVE TYPE CHAR01.
    IF MY_PDF_VIEWER->ACROBAT_VS_READER = ''.
    VIEW_BUTTONS_ACTIVE = 'X'.
    ENDIF.
    " -----------------------------------
    " create SAP toolbar for PDF Viewer
    CALL METHOD MY_PDF_VIEWER->CREATE_TOOLBAR
    EXPORTING
    TOOL_BUTTONS = 'X'
    VIEW_BUTTONS = VIEW_BUTTONS_ACTIVE
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    "could not create toolbar
    ENDIF.
    CREATE OBJECT L_EVENT_RECEIVER.
    SET HANDLER L_EVENT_RECEIVER->ON_DOCUMENT_SAVED FOR MY_PDF_VIEWER.
    SET HANDLER L_EVENT_RECEIVER->ON_VIEWING_FINISHED FOR MY_PDF_VIEWER.
    IF NOT MY_PDF_VIEWER->HTML_VIEWER IS INITIAL.
    CALL METHOD MY_PDF_VIEWER->OPEN_DOCUMENT
    EXPORTING
    URL = 'D:\durgesh.pdf'.
    ENDIF.
    ENDIF.
    PAI –
    CASE OKCODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE PROGRAM.
    WHEN 'LOADURL'.
    CALL METHOD MY_PDF_VIEWER->OPEN_DOCUMENT
    EXPORTING
    URL = 'http://p34198/myweb/Devfaq.pdf'.
    WHEN 'EVENT'.
    ENTRY1 = L_EVENT_RECEIVER->ENTRY_FIELD1.
    ENTRY2 = L_EVENT_RECEIVER->ENTRY_FIELD2.
    ENDCASE.
    14. PDF On Screen 2:
    Driver Program
    *&---------------------------------------------------------------------*
    *& Report Z_PDF_CONVERT
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    REPORT Z_PDF_CONVERT NO STANDARD PAGE HEADING.
    DATA : GS_PRINT_PARMS TYPE PRI_PARAMS,
    L_VALID TYPE STRING,
    GS_TSP01 TYPE TSP01,
    GV_RQ2NAME TYPE TSP01-RQ2NAME.
    DATA: CONTROL TYPE SSFCTRLOP,
    ERRTAB TYPE TSFERROR,
    OUTPUT TYPE SSFCOMPOP,
    FMCNP TYPE RS38L_FNAM.
    PARAMETERS :
    VAL AS CHECKBOX.
    IF VAL = 'X'.
    CONCATENATE SY-REPID+0(9) SY-UNAME+0(3) INTO GV_RQ2NAME.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    DESTINATION = 'LOCL'
    LAYOUT = 'X_65_80'
    LINE_SIZE = '80'
    NO_DIALOG = 'X'
    IMPORTING
    OUT_PARAMETERS = GS_PRINT_PARMS
    VALID = L_VALID
    EXCEPTIONS
    ARCHIVE_INFO_NOT_FOUND = 1
    INVALID_PRINT_PARAMS = 2
    INVALID_ARCHIVE_PARAMS = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    GS_PRINT_PARMS-PRIMM = ' '.
    GS_PRINT_PARMS-PRCOP = '1'.
    DELETE FROM TSP01
    WHERE RQOWNER EQ SY-UNAME.
    SUBMIT Z_PDF_CONVERT TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    SPOOL PARAMETERS GS_PRINT_PARMS
    AND RETURN.
    SELECT SINGLE *
    FROM TSP01
    INTO GS_TSP01
    WHERE RQOWNER EQ SY-UNAME.
    IF SY-SUBRC EQ 0.
    CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
    EXPORTING
    SPOOLNO = GS_TSP01-RQIDENT
    NAME = GS_TSP01-RQO1NAME.
    DELETE TSP01 FROM GS_TSP01.
    COMMIT WORK AND WAIT.
    EXIT.
    ENDIF.
    ELSE.
    DATA: WA_OUTPUT_OPTIONS TYPE SSFCOMPOP.
    DATA :WA_JOB_OUTPUT_INFO TYPE SSFCRESCL,
    JOB_OUTPUT_OPTIONS TYPE SSFCRESOP.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'Z_TEST_DURGESH'
    IMPORTING
    FM_NAME = FMCNP
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    CONTROL-NO_DIALOG = 'X'.
    OUTPUT-TDDEST = 'LOCL'.
    OUTPUT-TDNEWID = 'X'.
    OUTPUT-TDIEXIT = 'X'.
    OUTPUT-TDFINAL = 'X'.
    OUTPUT-TDNOPRINT = ' '.
    CALL FUNCTION FMCNP
    EXPORTING
    USER_SETTINGS = ' '
    CONTROL_PARAMETERS = CONTROL
    OUTPUT_OPTIONS = OUTPUT
    IMPORTING
    JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO
    JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS.
    ENDIF.
    'Z_FM_PDF_DATADISPLAY'
    Import parameter - SPOOLNO TYPE TSP01-RQIDENT
    NAME TYPE RSTSTYPE-NAME
    Source Code –
    FUNCTION Z_FM_PDF_DATADISPLAY.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *" IMPORTING
    *" REFERENCE(SPOOLNO) TYPE TSP01-RQIDENT
    *" REFERENCE(NAME) TYPE RSTSTYPE-NAME
    *"----------------------------------------------------------------------
    DATA: NUMBYTES TYPE I,
    PDFSPOOLID LIKE TSP01-RQIDENT,
    JOBNAME LIKE TBTCJOB-JOBNAME,
    JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
    OBJTYPE LIKE RSTSTYPE-TYPE,
    TYPE LIKE RSTSTYPE-TYPE,
    IS_OTF.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = SY-MANDT
    NAME = NAME
    PART = 1
    IMPORTING
    TYPE = TYPE
    OBJTYPE = OBJTYPE
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4.
    IF OBJTYPE(3) = 'OTF'.
    IS_OTF = 'X'.
    ELSEIF OBJTYPE(3) = 'TEX'.
    IS_OTF = SPACE.
    ELSE.
    IS_OTF = 'X'.
    ENDIF.
    IF IS_OTF = 'X'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    SRC_SPOOLID = SPOOLNO
    NO_DIALOG = ' '
    IMPORTING
    PDF_BYTECOUNT = NUMBYTES
    PDF_SPOOLID = PDFSPOOLID
    BTC_JOBNAME = JOBNAME
    BTC_JOBCOUNT = JOBCOUNT
    TABLES
    PDF = PDF
    EXCEPTIONS
    ERR_NO_OTF_SPOOLJOB = 1
    ERR_NO_SPOOLJOB = 2
    ERR_NO_PERMISSION = 3
    ERR_CONV_NOT_POSSIBLE = 4
    ERR_BAD_DSTDEVICE = 5
    USER_CANCELLED = 6
    ERR_SPOOLERROR = 7
    ERR_TEMSEERROR = 8
    ERR_BTCJOB_OPEN_FAILED = 9
    ERR_BTCJOB_SUBMIT_FAILED = 10
    ERR_BTCJOB_CLOSE_FAILED = 11.
    ELSE.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
    SRC_SPOOLID = SPOOLNO
    NO_DIALOG = ' '
    IMPORTING
    PDF_BYTECOUNT = NUMBYTES
    PDF_SPOOLID = PDFSPOOLID
    BTC_JOBNAME = JOBNAME
    BTC_JOBCOUNT = JOBCOUNT
    TABLES
    PDF = PDF
    EXCEPTIONS
    ERR_NO_ABAP_SPOOLJOB = 1
    ERR_NO_SPOOLJOB = 2
    ERR_NO_PERMISSION = 3
    ERR_CONV_NOT_POSSIBLE = 4
    ERR_BAD_DESTDEVICE = 5
    USER_CANCELLED = 6
    ERR_SPOOLERROR = 7
    ERR_TEMSEERROR = 8
    ERR_BTCJOB_OPEN_FAILED = 9
    ERR_BTCJOB_SUBMIT_FAILED = 10
    ERR_BTCJOB_CLOSE_FAILED = 11.
    ENDIF.
    * convert pdf to xstring string
    LOOP AT PDF INTO LS_PDF.
    ASSIGN LS_PDF TO CASTING.
    CONCATENATE LV_CONTENT INTO LV_CONTENT IN BYTE MODE.
    ENDLOOP.
    CALL SCREEN 100.
    ENDFUNCTION.
    Screen
    PBO –
    SET PF-STATUS 'STS'.
    SET TITLEBAR 'TTL'.
    CREATE OBJECT G_HTML_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'CUSTOM_CNTL'.
    CREATE OBJECT G_HTML_CONTROL
    EXPORTING
    PARENT = G_HTML_CONTAINER.
    * Convert xstring to binary table to pass to the LOAD_DATA method
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    BUFFER = LV_CONTENT
    TABLES
    BINARY_TAB = LT_DATA.
    * Load the HTML
    CALL METHOD G_HTML_CONTROL->LOAD_DATA(
    EXPORTING
    TYPE = 'application'
    SUBTYPE = 'pdf'
    IMPORTING
    ASSIGNED_URL = LV_URL
    CHANGING
    DATA_TABLE = LT_DATA
    EXCEPTIONS
    DP_INVALID_PARAMETER = 1
    DP_ERROR_GENERAL = 2
    CNTL_ERROR = 3
    OTHERS = 4 ).
    * Show it
    CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL IN_PLACE = 'X' ).
    PAI –
    CASE OKCODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE PROGRAM.
    ENDCASE.


    15. Program To Find User Exit:
    *&---------------------------------------------------------------------*
    *& Report Z_FIND_EXIT
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    REPORT Z_FIND_EXIT.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
    select single * from tadir where pgmid = 'R3TR'
    and object = 'PROG'
    and obj_name = tstc-pgmna.
    move : tadir-devclass to v_devclass.
    if sy-subrc ne 0.
    select single * from trdir where name = tstc-pgmna.
    if trdir-subc eq 'F'.
    select single * from tfdir where pname = tstc-pgmna.
    select single * from enlfdir where funcname =
    tfdir-funcname.
    select single * from tadir where pgmid = 'R3TR'
    and object = 'FUGR'
    and obj_name eq enlfdir-area.
    move : tadir-devclass to v_devclass.
    endif.
    endif.
    select * from tadir into table jtab
    where pgmid = 'R3TR'
    and object = 'SMOD'
    and devclass = v_devclass.
    select single * from tstct where sprsl eq sy-langu and
    tcode eq p_tcode.
    format color col_positive intensified off.
    write:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    skip.
    if not jtab[] is initial.
    write:/(95) sy-uline.
    format color col_heading intensified on.
    write:/1 sy-vline,
    2 'Exit Name',
    21 sy-vline ,
    22 'Description',
    95 sy-vline.
    write:/(95) sy-uline.
    loop at jtab.
    select single * from modsapt
    where sprsl = sy-langu and
    name = jtab-obj_name.
    format color col_normal intensified off.
    write:/1 sy-vline,
    2 jtab-obj_name hotspot on,
    21 sy-vline ,
    22 modsapt-modtext,
    95 sy-vline.
    endloop.
    write:/(95) sy-uline.
    describe table jtab.
    skip.
    format color col_total intensified on.
    write:/ 'No of Exits:' , sy-tfill.
    else.
    format color col_negative intensified on.
    write:/(95) 'No User Exit exists'.
    endif.
    else.
    format color col_negative intensified on.
    write:/(95) 'Transaction Code Does Not Exist'.
    endif.
    at line-selection.
    get cursor field field1.
    check field1(4) eq 'JTAB'.
    set parameter id 'MON' field sy-lisel+1(10).
    call transaction 'SMOD' and skip first screen.
    *---End of Program

    16. Selection Option in Module Pool:
    *&---------------------------------------------------------------------*
    *& Report Z_PO_UPLOAD
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    REPORT Z_PO_UPLOAD MESSAGE-ID zpoattach.
    TABLES : EKKO.
    DATA: BEGIN OF ITAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    END OF ITAB .
    DATA : LT_FIELDS TYPE TABLE OF DFIES,
    LS_FIELD TYPE DFIES,
    FLG TYPE I VALUE 1,
    OK_CODE TYPE SY-UCOMM,
    ebeln TYPE ekko-ebeln.
    SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
    PARAMETERS : VPATH TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF SCREEN 400.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR VPATH.
    PERFORM F4_HELP_P_FILE_IT.
    START-OF-SELECTION.
    CALL SCREEN 100.
    INCLUDE Z_PO_UPLOAD_STATUS_0100O01.
    INCLUDE Z_PO_UPLOAD_USER_COMMAND_01I01.
    INCLUDE Z_PO_UPLOAD_VALIDATEI01.
    *&---------------------------------------------------------------------*
    *& Form F4_HELP_P_FILE_IT
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM F4_HELP_P_FILE_IT .
    DATA : V_FILE LIKE VPATH.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = V_FILE.
    CHECK SY-SUBRC EQ 0.
    VPATH = V_FILE.
    ENDFORM. " F4_HELP_P_FILE_IT
    INCLUDE Z_PO_UPLOAD_RENAME_FILEF01.
    INCLUDE Z_PO_UPLOAD_COPYF01.

    17. Service PO Using BAPI:
    DATA : I_POHDR TYPE STANDARD TABLE OF BAPIMEPOHEADER WITH HEADER LINE,
    I_POHDRX TYPE STANDARD TABLE OF BAPIMEPOHEADERX WITH HEADER LINE,
    I_POITM TYPE STANDARD TABLE OF BAPIMEPOITEM WITH HEADER LINE,
    I_POITMX TYPE STANDARD TABLE OF BAPIMEPOITEMX WITH HEADER LINE,
    I_POSERVICE TYPE STANDARD TABLE OF BAPIESLLC WITH HEADER LINE,
    I_POACCOUNT TYPE STANDARD TABLE OF BAPIMEPOACCOUNT WITH HEADER LINE,
    I_POACCOUNTX TYPE STANDARD TABLE OF BAPIMEPOACCOUNTX WITH HEADER LINE,
    I_POSERVICEV TYPE STANDARD TABLE OF BAPIESKLC WITH HEADER LINE.
    DATA : PONO TYPE BAPIMEPOHEADER-PO_NUMBER,
    PCKG_NO TYPE BAPIMEPOITEM-PCKG_NO.
    REFRESH: I_POHDR[],I_POHDRX[],I_POITM[],I_POITMX[],I_POSERVICE[],
    I_POSERVICEV[],I_POACCOUNT[],I_POACCOUNTX[].
    CLEAR : ICNT,I_POHDR,I_POITM,I_POHDRX,I_POITMX,I_POSERVICE,I_POSERVICEV,
    I_POACCOUNT,I_POACCOUNTX.
    *--------Header data
    I_POHDR-COMP_CODE = 4000. "VBUKRS.
    I_POHDR-DOC_TYPE = 'ZLAB'.
    I_POHDR-ITEM_INTVL = '00010'.
    I_POHDR-VENDOR = LFA1-LIFNR.
    I_POHDR-PMNTTRMS = 'D060'. "EKKO-ZTERM.
    I_POHDR-PURCH_ORG = 4130. "VEKORG.
    I_POHDR-PUR_GROUP = 100. " VEKGRP.
    I_POHDR-CURRENCY = 'HKD'. "EKKO-WAERS.
    I_POHDR-DOC_DATE = PDATE.
    APPEND I_POHDR.
    I_POHDRX-COMP_CODE = 'X'.
    I_POHDRX-DOC_TYPE = 'X'.
    I_POHDRX-ITEM_INTVL = 'X'.
    I_POHDRX-VENDOR = 'X'.
    I_POHDRX-PMNTTRMS = 'X'.
    I_POHDRX-PURCH_ORG = 'X'.
    I_POHDRX-PUR_GROUP = 'X'.
    I_POHDRX-CURRENCY = 'X'.
    I_POHDRX-DOC_DATE = 'X'.
    APPEND I_POHDRX.
    *--------Line data
    LOOP AT IT_OUT1 INTO WA_OUT.
    ICNT = ICNT + 1.
    PCKG_NO = PCKG_NO + 1.
    I_POITM-PO_ITEM = ICNT * 10.
    I_POITM-PCKG_NO = PCKG_NO.
    I_POITM-ACCTASSCAT = 'K'.
    I_POITM-ITEM_CAT = 'D'.
    I_POITM-SHORT_TEXT = WA_OUT-CHARG.
    I_POITM-PLANT = WA_OUT-WERKS.
    I_POITM-BATCH = WA_OUT-CHARG.
    I_POITM-STGE_LOC = WA_OUT-LGORT.
    I_POITM-QUANTITY = WA_OUT-CLABS.
    I_POITM-MATL_GROUP = 'D11'.
    APPEND I_POITM.
    CLEAR :I_POITM.
    I_POITMX-PO_ITEM = ICNT * 10.
    I_POITMX-PCKG_NO = 'X'.
    I_POITMX-ACCTASSCAT = 'X'.
    I_POITMX-ITEM_CAT = 'X'.
    I_POITMX-SHORT_TEXT = 'X'.
    I_POITMX-PLANT = 'X'.
    I_POITMX-BATCH = 'X'.
    I_POITMX-STGE_LOC = 'X'.
    I_POITMX-QUANTITY = 'X'.
    I_POITMX-MATL_GROUP = 'X'.
    APPEND I_POITMX.
    CLEAR :I_POITMX.
    I_POSERVICE-PCKG_NO = PCKG_NO.
    I_POSERVICE-LINE_NO = '0000000001'.
    I_POSERVICE-OUTL_IND = 'X'.
    I_POSERVICE-SUBPCKG_NO = PCKG_NO + 1.
    I_POSERVICE-FROM_LINE = '1'.
    APPEND I_POSERVICE.
    CLEAR I_POSERVICE.
    PCKG_NO = PCKG_NO + 1.
    I_POSERVICE-PCKG_NO = PCKG_NO.
    I_POSERVICE-LINE_NO = '0000000002'.
    I_POSERVICE-SERVICE = '000000000003000000'.
    I_POSERVICE-QUANTITY = WA_OUT-CLABS.
    I_POSERVICE-BASE_UOM = 'AU'.
    I_POSERVICE-PRICE_UNIT = '1'.
    I_POSERVICE-GR_PRICE = 1000."ZMCHA_S-TOT_PRICE.
    I_POSERVICE-MATL_GROUP = 'POLISH'.
    APPEND I_POSERVICE.
    CLEAR I_POSERVICE.
    I_POSERVICEV-PCKG_NO = PCKG_NO.
    I_POSERVICEV-LINE_NO = '0000000002'.
    I_POSERVICEV-SERNO_LINE = '01'.
    I_POSERVICEV-SERIAL_NO = '01'.
    I_POSERVICEV-QUANTITY = WA_OUT-CLABS.
    APPEND I_POSERVICEV.
    I_POACCOUNT-PO_ITEM = ICNT * 10.
    I_POACCOUNT-SERIAL_NO = '01'.
    I_POACCOUNT-QUANTITY = WA_OUT-CLABS.
    I_POACCOUNT-GL_ACCOUNT = '0000800101'.
    I_POACCOUNT-COSTCENTER = '0041304001'.
    I_POACCOUNT-CO_AREA = 4000.
    I_POACCOUNT-NET_VALUE = 1000.
    APPEND I_POACCOUNT.
    I_POACCOUNTX-PO_ITEM = ICNT * 10.
    I_POACCOUNTX-SERIAL_NO = '01'.
    I_POACCOUNTX-QUANTITY = 'X'.
    I_POACCOUNTX-GL_ACCOUNT = 'X'.
    I_POACCOUNTX-COSTCENTER = 'X'.
    I_POACCOUNTX-CO_AREA = 'X'.
    I_POACCOUNTX-NET_VALUE = 'X'.
    APPEND I_POACCOUNTX.
    ENDLOOP.
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    POHEADER = I_POHDR
    POHEADERX = I_POHDRX
    IMPORTING
    EXPPURCHASEORDER = PONO
    TABLES
    RETURN = GT_RETURN
    POITEM = I_POITM
    POITEMX = I_POITMX
    POACCOUNT = I_POACCOUNT
    POACCOUNTX = I_POACCOUNTX
    POSERVICES = I_POSERVICE
    POSRVACCESSVALUES = I_POSERVICEV.
    READ TABLE GT_RETURN WITH KEY TYPE = 'E'.
    IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    CALL SCREEN 101 STARTING AT '15' '3'.
    MESSAGE ID 'ZGRN' TYPE 'E' NUMBER 001 .
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'.
    CLEAR TEXT2.
    CONCATENATE 'Document no.' GOODSMVT_HEADRET-MAT_DOC 'and PO no.' PONO
    INTO TEXT2 SEPARATED BY SPACE.
    MESSAGE S000 WITH TEXT2.
    PERFORM UPDATE_TABLE1 .
    LEAVE TO SCREEN 0.
    ENDIF.

    18. New Tab in PO Using BADI:
    Implement BADI (ME_GUI_PO_CUST & ME_PROCESS_PO_CUST) For Adding New Tab In PO Creation
    (ME21N)
    BADI ‐ ME_GUI_PO_CUST ‐>
    Subscribe Method ‐> (Create subscreen)
    method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
    data : i_subscribers like line of re_subscribers.
    check im_application = 'PO'.
    check im_element = 'HEADER'.
    clear : re_subscribers[].
    i_subscribers-name = subscreen1.
    i_subscribers-DYNPRO = '0100'.
    i_subscribers-program = 'SAPLZPOHDR'. (i.e. SAPL + ZPOHDR(function group))
    i_subscribers-STRUCT_NAME = 'CI_EKKODB'.
    i_subscribers-label = text-001.
    i_subscribers-POSITION = 5.
    i_subscribers-HEIGHT = 7.
    append i_subscribers to re_subscribers.
    endmethod.


    MAP_DYNPRO_FIELDS Method‐> (Create Field Catalog)
    method IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS.
    field-symbols : like line of ch_mapping.
    LOOP AT ch_mapping assigning .
    IF -fieldname = 'ZCUSTNAME'.
    -metafield = mmmfd_cust_01.
    elseif -fieldname = 'ZCUSTADR'.
    -metafield = mmmfd_cust_02.
    ENDIF.
    ENDLOOP.
    endmethod.
    TRANSPORT_FROM_MODEL Method‐>(Get Data From Table EKKO)


    TRANSPORT_FROM_MODEL Method‐>(Get Data From Table EKKO)
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL.
    DATA: l_header TYPE REF TO if_purchase_order_mm,
    ls_mepoheader TYPE mepoheader.
    check im_name = subscreen1.
    mmpur_dynamic_cast l_header im_model.
    check not l_header is initial.

    ls_mepoheader = l_header->get_data( ).
    move-corresponding ls_mepoheader to DYNP_DATA_PBO.
    endmethod.
    TRANSPORT_TO_DYNP Method‐> (Pass Data To Display Screen)
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP.
    check im_name = subscreen1.
    CALL FUNCTION 'ZPOHDR_MOVE_TO_SCREEN'
    EXPORTING
    DYNP_DATA_PBO = DYNP_DATA_PBO.
    endmethod.
    TRANSPORT_FROM_DYNP Method‐>(Fetch Data From Screen After Change or Containing same Value)
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP.
    check im_name = subscreen1.
    CALL FUNCTION 'ZPOHDR_FETCH_FROM_SCREEN'
    IMPORTING
    DYNP_DATA_PAI = DYNP_DATA_PAI.
    if DYNP_DATA_PAI ne DYNP_DATA_PBO.
    re_changed = 'X'.
    endif.
    endmethod


    TRANSPORT_TO_MODEL Method‐> (Save Data To
    Database)
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL.
    DATA: l_header TYPE REF TO if_purchase_order_mm,
    ls_mepoheader TYPE mepoheader.
    check im_name = subscreen1.
    mmpur_dynamic_cast l_header im_model.
    check not l_header is initial.
    ls_mepoheader = l_header->get_data( ).
    if DYNP_DATA_PAI ne DYNP_DATA_PBO.
    move-corresponding DYNP_DATA_PAI to ls_mepoheader.
    CALL METHOD l_header->set_data
    EXPORTING
    im_data = ls_mepoheader.
    endif.





    BADI ‐ ME_PROCESS_PO_CUST ‐>
    FIELDSELECTION_HEADER Method‐>
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.
    FIELD-SYMBOLS: LIKE LINE OF CH_FIELDSELECTION.
    if sy-tcode ='ME21N' OR sy-tcode ='ME22N'.
    READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
    MFD_CUST_01.
    IF SY-SUBRC IS INITIAL.
    -FIELDSTATUS = '.'. " change
    ENDIF.
    READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
    MFD_CUST_02.
    IF SY-SUBRC IS INITIAL.
    -FIELDSTATUS = '.'. " change
    ENDIF.
    else.
    READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
    MFD_CUST_01.
    IF SY-SUBRC IS INITIAL.
    -FIELDSTATUS = '*'. " display
    ENDIF.
    READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
    MFD_CUST_02.
    IF SY-SUBRC IS INITIAL.
    -FIELDSTATUS = '*'. " display
    ENDIF.
    ENDIF.
    endmethod.








    1. Classical Report:
    Classical reports are basically used for developing a such kind of reports which is used on daily Basis.
    Some important factors of classical reports is as follows:-

    a. AT Line Selection:

    DATA : BEGIN OF itab OCCURS 0.
    INCLUDE STRUCTURE zqmrr.
    DATA: END OF itab.
    START-OF-SELECTION.
    SELECT * INTO TABLE itab FROM zqmrr.
    LOOP AT itab.
    WRITE :/10 itab-werks,
    15 itab-mkmnr,
    25 itab-charg.
    ENDLOOP.
    AT LINE-SELECTION.
    WRITE:/ 'Rajasthan Textile Mills Bhawanimandi'.
    TOP-OF-PAGE DURING LINE-SELECTION.
    WRITE:/'hi'.

    b. AT User Command:
    At use command also can be acomplish by two way. First, Perform any action by Clicking any
    button(PF Status), Second Leaving Screen.
    I
    START-OF-SELECTION.
    SET PF-STATUS 'MYLIST'. // MYLIST is the GUI Status(PF Status)
    WRITE 'List line'.
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'SAV'.
    WRITE: / 'You worked on list', sy-listi,
    / 'You are on list', sy-lsind.
    ENDCASE.
    II
    form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
    read table i_vbap index rs_selfield-tabindex.
    if sy-subrc = 0.
    set parameter id 'AUN' field i_vbap-vbeln.
    call transaction 'VA03'." and skip first screen.
    endif.
    endform.
    Note:in second method we have to add this user command in REUSE_ALV_GRID_DISPLAY as follows -
    i_callback_user_command = 'USER_COMMAND'

    c. F4 Key Press:
    This is used for display help at selection screen i.e.when we pressed F4 key to display value at
    selection screen.

    at selection-screen on value-request for s_docno-low.
    select trntyp
    docno
    from j_1iexchdr
    into table i_are
    where trntyp eq 'ARE1'.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield = 'DOCNO'
    dynpprog = v_repid
    dynpnr = v_dynnr
    dynprofield = 'S_DOCNO-LOW'
    window_title = 'F4 Help For the ARE1 Document'
    value_org = 'S'
    tables
    value_tab = i_are.
    if sy-subrc <> 0.
    endif.

    d. Convert Output to PDF:
    This can be done in two different ways-
    I-Saving Output without dialog box:
    data : gs_print_parms type pri_params,
    l_valid type string,
    gs_tsp01 type tsp01,
    gv_rq2name type tsp01-rq2name.
    concatenate sy-repid+0(9) sy-uname+0(3) into gv_rq2name.
    call function 'GET_PRINT_PARAMETERS'
    exporting
    destination = 'LP02'
    layout = 'X_65_132'
    line_size = '132'
    no_dialog = 'X'
    importing
    out_parameters = gs_print_parms
    valid = l_valid
    exceptions
    archive_info_not_found = 1
    invalid_print_params = 2
    invalid_archive_params = 3
    others = 4.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    gs_print_parms-primm = ' '.
    gs_print_parms-prcop = '1'.
    submit y_chk_pmt_advs with pzbukr = pzbukr
    with pgjahr = pgjahr
    with phbkid = phbkid
    with phktid = phktid
    with pchecf in pchecf
    with pvblnr in pvblnr
    with ppridt in ppridt
    with pzaldt in pzaldt
    with opt2 = opt2
    with opt1 = space
    with opt3 = space
    with opt4 = space
    with opt5 = space
    to sap-spool without spool dynpro
    spool parameters gs_print_parms
    and return.
    select single *
    from tsp01
    into gs_tsp01
    where rq2name eq gv_rq2name
    and rqowner eq sy-uname.
    "ORDER BY rqcretime ASCENDING.
    if sy-subrc eq 0.
    submit rstxpdft4 with spoolno eq gs_tsp01-rqident
    with p_file eq 'CHKLST.PDF'
    and return.
    endif.
    delete from tsp01
    where rqident = gs_tsp01-rqident and
    rq2name eq gv_rq2name.
    exit.
    II-Display Output on screen:
    data : gs_print_parms type pri_params,
    l_valid type string,
    gs_tsp01 type tsp01,
    gv_rq2name type tsp01-rq2name.
    CONCATENATE sy-repid+0(9) sy-uname+0(3) INTO gv_rq2name.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    destination = 'LP02'
    layout = 'X_65_80'
    line_size = '80'
    no_dialog = 'X'
    IMPORTING
    out_parameters = gs_print_parms
    valid = l_valid
    EXCEPTIONS
    archive_info_not_found = 1
    invalid_print_params = 2
    invalid_archive_params = 3
    OTHERS = 4.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    gs_print_parms-primm = ' '.
    gs_print_parms-prcop = '1'.

    SUBMIT y_qm_lot_test WITH vwerk IN vwerk
    WITH vcharg IN vcharg
    WITH verste IN verste
    TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    SPOOL PARAMETERS gs_print_parms
    AND RETURN.
    SELECT SINGLE *
    FROM tsp01
    INTO gs_tsp01
    WHERE rq2name EQ gv_rq2name
    AND rqowner EQ sy-uname.
    IF sy-subrc EQ 0.
    CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
    EXPORTING
    spool = gs_tsp01-rqident
    delete = 'X'.
    DELETE tsp01 FROM gs_tsp01.
    COMMIT WORK AND WAIT.
    ENDIF.
    DELETE FROM tsp01
    WHERE rqident EQ gs_tsp01-rqident AND
    rq2name EQ gv_rq2name.
    EXIT.
    e. Color Printing:
    For printing color use following syntax:
    FORMAT COLOR 3

    2. ALV Report:
    ALV report is basically used for display data in grid form. This is more flexible report type in which
    user can re-arrange, sort or hide the coloumn. Main function used in grid is as follows-
    a. Declaring Data:
    data: rptname like sy-repid,
    w_shift type i.
    type-pools: slis.
    data: fcat type table of slis_fieldcat_alv with non-unique default key
    with header line initial size 0,
    layout type slis_layout_alv,
    fevents type table of slis_alv_event with non-unique default key
    with header line initial size 0,
    fheader type table of slis_listheader with non-unique default key
    with header line initial size 0,
    fexclude type table of slis_extab with non-unique default key
    with header line initial size 0,
    gt_sort type slis_t_sortinfo_alv.
    data : alv_variant like disvariant.
    b. Progress Indicator:
    call function 'SAPGUI_PROGRESS_INDICATOR'
    exporting
    text = 'Hi this is durgesh'.
    c.Display Variant:
    data : alv_variant like disvariant.
    parameter : variant type disvariant-variant.
    at selection-screen on value-request for variant.
    alv_variant-report = sy-repid.
    call function 'REUSE_ALV_VARIANT_F4'
    exporting
    is_variant = alv_variant
    i_save = 'A'
    importing
    es_variant = alv_variant
    exceptions
    not_found = 2.
    if sy-subrc = 2.
    message id sy-msgid type 'S' number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    variant = alv_variant-variant.
    endif.
    Note:
    1.Below statement will write just above Display Function-
    alv_variant-report = rptname.
    alv_variant-variant = variant.
    2.Add Following line in display function-
    is_variant = alv_variant
    3.i_save = 'A' for user specific
    i_save = 'X' for Not user specific i.e. default
    i_save = 'U' for Not user specific i.e. default
    d. Page Heading:
    form topofpage.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = fheader[].
    * I_LOGO =
    * I_END_OF_LIST_GRID =
    endform. "TOPOFPAGE
    fheader-typ = 'H'.
    fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
    append fheader.
    clear fheader.
    * To show in Italic Style
    fheader-typ = 'A' .
    fheader-info = 'Pachpahar Road'.
    append fheader.
    clear fheader.
    * To Show in small character
    * Info is Char 60 Colunm
    * typ is Char 1 Column
    fheader-typ = 'S'.
    fheader-info = ' List of Sale Orders for Testing in ALV Report'.
    append fheader.
    clear fheader.
    fheader-typ = 'S'.
    data : trptdt(10) type c.
    data : xdt type string.
    write : sy-datum to trptdt.
    concatenate 'Report run date : ' trptdt into xdt separated by space.
    fheader-typ = 'S'.
    fheader-info = xdt.
    append fheader.
    clear fheader.
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = fevents[]
    exceptions
    list_type_wrong = 1
    others = 2.
    read table fevents with key name = 'TOP_OF_PAGE'.
    if sy-subrc = 0.
    fevents-form = 'TOPOFPAGE'.
    modify fevents index sy-tabix.
    clear fevents.
    endif.
    e. Display Layout:
    Data :layout type slis_layout_alv.
    layout-zebra = 'X'.
    layout-no_vline = 'X'."Vertical Lines between columns will not shown
    layout-no_hline = 'X'."Horizontal Lines between columns will not shown
    layout-edit = 'X'. "Columns can be edit in Grid at run time
    layout-no_colhead = 'X'. "Columns Heading will not be shown
    In Display function add following lines-
    is_layout = layout
    f. Field Catalog:
    fcat-fieldname = 'VBELN'."Field name of Final Table
    fcat-outputlen = 11. " Size of Field in Grid
    fcat-seltext_s = 'Sales '." For Name of Colunm in Grid
    fcat-seltext_m = 'Sales Order No'.
    fcat-seltext_l = 'Sales Order No'. " For Tool Tip
    fcat-no_zero = 'X'."All Zero in start of Sales Order Number wll be suppressed
    fcat-checkbox = 'X'. "Field will be shown as Checkboxx
    fcat-no_out = 'X'. "This field will not be show but
    "can be select from select layout
    fcat-input = 'X'. "Not Clear
    fcat-icon = 'X'. "Not Clear
    fcat-ddictxt = 'M'. "M= fcat-seltext_m, S=fcat-seltext_s,
    "L=fcat-seltext_l
    fcat-inttype = 'C'. "Alignment N for Right C For Left
    fcat-key = 'X'. "Fix the Column.(Col.will not drag
    fcat-datatype = 'CHAR'. "Type of field in table
    fcat-emphasize = 'C200'. "For Show in Color
    fcat-do_sum = 'X'. "will display sum of this column
    g. Display Function:
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = rptname "program name
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'X'"'SM04_SET_STATUS'
    "disable menubar
    is_layout = layout"for promt message to leave scrren
    it_fieldcat = fcat[]"field catalog
    it_excluding = fexclude[]"remove icon from toolbar
    it_sort = gt_sort[]
    i_default = 'X'
    i_save = 'A'"user specific
    is_variant = alv_variant" variant of grid
    i_grid_title = 'DURGESH' "Display Title of grid
    it_events = fevents[]"top of page
    tables
    t_outtab = i_vbap[]"final table name
    exceptions
    program_error = 1
    others = 2.
    h. Field Catalog Function:
    FORM build_field_catalog .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_internal_tabname = 'I_FINAL'
    i_inclname = sy-repid
    CHANGING
    ct_fieldcat = fcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    fheader-typ = 'H'.
    fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
    APPEND fheader.
    CLEAR fheader.
    fheader-typ = 'A' .
    fheader-info = 'Pachpahar Road'.
    APPEND fheader.
    CLEAR fheader.
    fheader-typ = 'S'.
    fheader-info = ' List of Customer for Testing of ALV Report'.
    APPEND fheader.
    CLEAR fheader.
    fheader-typ = 'S'.
    DATA : trptdt(10) TYPE c.
    DATA : xdt TYPE string.
    WRITE : sy-datum TO trptdt.
    CONCATENATE 'Report run date : ' trptdt INTO xdt SEPARATED BY space.
    fheader-typ = 'S'.
    fheader-info = xdt.
    APPEND fheader.
    CLEAR fheader.
    fexclude-fcode = '&ABC'.
    append fexclude.
    clear fexclude.
    ENDFORM.
    i. Remove icon from toolbar:
    To remove icons from toolbar add following lines at end of field catalog. i.e just above ENDFORM of
    field catalog.
    fexclude-fcode = '&ABC'.
    append fexclude.
    clear fexclude.
    NOTE: if we have to remove icon from toolbar, then write above code and add following lines in
    DISPLAY FUNCTION
    it_excluding = fexclude[]

    3. Smart Forms:
    Smart forms is basically used for much attractive report.
    TABLES : bkpf, bseg.
    DATA: fm_name TYPE rs38l_fnam.
    DATA : BEGIN OF itab OCCURS 0,
    bukrs TYPE bkpf-bukrs,"company code
    gjahr TYPE bkpf-gjahr," Fisical year
    budat TYPE bkpf-budat," Posting date
    belnr TYPE bkpf-belnr." Document No.
    DATA : END OF itab.
    DATA : tbudt1 TYPE bkpf-budat.
    DATA : tbudt2 TYPE bkpf-budat.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-t01.
    SELECT-OPTIONS:
    pbukrs FOR bkpf-bukrs NO INTERVALS NO-EXTENSION
    OBLIGATORY DEFAULT '1000',
    pgjahr FOR bkpf-gjahr NO INTERVALS NO-EXTENSION
    OBLIGATORY DEFAULT sy-datum,
    pbudat FOR bkpf-budat DEFAULT sy-datum to sy-datum.
    SELECTION-SCREEN END OF BLOCK blk.

    INITIALIZATION.
    IF pbudat-high IS INITIAL.
    pbudat-high = pbudat-low.
    ENDIF.

    START-OF-SELECTION.
    SELECT bukrs
    gjahr
    budat
    belnr
    INTO TABLE itab
    FROM bkpf
    WHERE bukrs IN pbukrs AND
    gjahr IN pgjahr AND
    budat IN pbudat.
    IF itab[] IS INITIAL.
    MESSAGE 'No Data Found...' TYPE 'S'.
    ELSE.
    CLEAR : itab[].
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Y_SMART' "smart form name
    IMPORTING
    fm_name = fm_name.

    CALL FUNCTION fm_name
    EXPORTING
    "smart form field driver program field
    vbukrs = pbukrs-low
    vgjahr = pgjahr-low
    vbudat1 = pbudat-low
    vbudat2 = pbudat-high.
    ENDIF.
    Note:
    if we have to export table from driver program to smartforms, then do following steps-
    1.Define structure for table in driver program that has to be exported in smartforms.

    DATA : BEGIN OF i_final OCCURS 0.
    INCLUDE STRUCTURE zqmrr.
    DATA : END OF i_final.

    2.We have to export i_final table, so we have define structure for it. If we will define table then it will
    generate error.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Y_SMT'
    IMPORTING
    fm_name = fm_name.
    CALL FUNCTION fm_name
    EXPORTING
    swerks = vwerks-low == variable exporting
    TABLES
    ifinal = i_final[]. == Table exporting

    Now go to forminterface tables tab abd define exported internal table.

    PDF Conversion of Smartforms:

    tables : zqmrr.
    data : begin of i_tab occurs 0,
    werks type zqmrr-werks,
    erdat type zqmrr-erdat,
    charg type zqmrr-charg,
    mkmnr type zqmrr-mkmnr,
    sumplus type zqmrr-sumplus,
    prueflos type zqmrr-prueflos.
    data : end of i_tab.
    data: fm_name type rs38l_fnam.
    data: wa_ctrlop type ssfctrlop,
    wa_outopt type ssfcompop.
    data: t_otfdata type ssfcrescl,
    t_pdf_tab like tline occurs 0 with header line.
    data: t_otf type itcoo occurs 0 with header line.
    data: w_filesize type string.
    data: w_bin_filesize type i.
    selection-screen begin of block blk01 with frame title text-001.
    parameters :
    vwerks type zqmrr-werks obligatory,
    verdat type zqmrr-erdat obligatory default sy-datum.
    selection-screen end of block blk01.
    selection-screen begin of block blk02 with frame title text-002.
    parameters :
    r1 as checkbox.
    selection-screen end of block blk02.
    start-of-selection.
    select werks
    erdat
    charg
    mkmnr
    sumplus
    prueflos
    from zqmrr
    into table i_tab
    where werks eq vwerks and
    erdat eq verdat.
    if sy-subrc ne 0.
    message 'No Record Found' type 'S'.
    exit.
    else.
    if r1 ne 'X'.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'Y_QM_DAILY_RPT1'
    importing
    fm_name = fm_name
    exceptions
    no_form = 1
    no_function_module = 2
    others = 3.
    call function fm_name
    exporting
    swerks = vwerks
    serdat = verdat.
    else.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'Y_QM_DAILY_RPT'
    importing
    fm_name = fm_name
    exceptions
    no_form = 1
    no_function_module = 2
    others = 3.
    wa_ctrlop-getotf = 'X'.
    wa_ctrlop-no_dialog = 'X'.
    wa_outopt-tdnoprev = 'X'.
    call function fm_name
    exporting
    swerks = vwerks
    serdat = verdat
    control_parameters = wa_ctrlop
    output_options = wa_outopt
    user_settings = 'X'
    importing
    job_output_info = t_otfdata
    exceptions
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    others = 5.

    t_otf[] = t_otfdata-otfdata[].
    call function 'CONVERT_OTF'
    exporting
    format = 'PDF'
    max_linewidth = 132
    importing
    bin_filesize = w_bin_filesize
    tables
    otf = t_otf
    lines = t_pdf_tab
    exceptions
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    others = 4.
    call function 'WS_DOWNLOAD'
    exporting
    bin_filesize = w_bin_filesize
    filename = 'D:\sqc_rpt.PDF'
    filetype = 'BIN'
    importing
    filelength = w_filesize
    tables
    data_tab = t_pdf_tab
    exceptions
    file_open_error = 1
    file_write_error = 2
    invalid_filesize = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    others = 10.
    if sy-subrc <> 0.
    message 'Report has not been saved succesully.' type 'S'.
    else.
    message 'Report has been saved in D drive succesully.' type 'S'.
    endif.
    endif.
    endif.

    4. Hierarchical Report:

    Hierarchical Report is used for diaplay report in tree format.
    DATA : node_tab LIKE snodetext OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF i_qals OCCURS 0,
    prueflos TYPE qals-prueflos,
    werk TYPE qals-werk,
    enstehdat TYPE qals-enstehdat,
    selmatnr TYPE qals-selmatnr,
    charg TYPE qals-charg,
    ktextmat TYPE qals-ktextmat.
    DATA : END OF i_qals.
    CLEAR : node_tab, node_tab[].
    SELECT prueflos
    werk
    enstehdat
    selmatnr
    charg
    ktextmat
    INTO TABLE i_qals FROM qals UP TO 40 ROWS WHERE selmatnr NE '' AND charg NE ''.
    node_tab-type = 'T'.
    node_tab-name = 'Lot Description'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '15'.
    APPEND node_tab.
    CLEAR node_tab.

    LOOP AT i_qals.
    node_tab-type = 'P'.
    node_tab-name = i_qals-prueflos.
    node_tab-tlevel = '02'.
    node_tab-nlength = '15'.
    APPEND node_tab.
    CLEAR node_tab.

    node_tab-type = 'P'.
    node_tab-name = i_qals-werk.
    node_tab-tlevel = '03'.
    node_tab-nlength = '06'.
    APPEND node_tab.
    CLEAR node_tab.

    node_tab-type = 'P'.
    node_tab-name = i_qals-enstehdat.
    node_tab-tlevel = '04'.
    node_tab-nlength = '10'.
    APPEND node_tab.
    CLEAR node_tab.

    node_tab-type = 'P'.
    node_tab-name = i_qals-selmatnr.
    node_tab-tlevel = '05'.
    node_tab-nlength = '10'.
    APPEND node_tab.
    CLEAR node_tab.


    node_tab-type = 'P'.
    node_tab-name = i_qals-charg.
    node_tab-tlevel = '06'.
    node_tab-nlength = '08'.
    APPEND node_tab.
    CLEAR node_tab.

    node_tab-type = 'P'.
    node_tab-name = i_qals-ktextmat.
    node_tab-tlevel = '07'.
    node_tab-nlength = '30'.
    APPEND node_tab.
    CLEAR node_tab.
    ENDLOOP.

    *node_tab-type = 'T'. "Node type
    *node_tab-name = 'Earth'. "Object name
    *node_tab-tlevel = '01'. "Node level
    *node_tab-nlength = '5'. "Output length of a hierarchy node
    *node_tab-color = '4'. "Color display of a hierarchy node
    *node_tab-text = 'Hello'. "Text/Icon/Symbol
    *node_tab-tlength ='5'. "Output length of a hierarchy node
    *node_tab-tcolor = 3. "Color display of a hierarchy node
    *APPEND node_tab.
    *CLEAR node_tab.
    *
    *node_tab-type = 'P'.
    *node_tab-name = 'Europe'.
    *node_tab-tlevel = '02'.
    *node_tab-nlength = '6'.
    *node_tab-color = '1'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 4.
    *APPEND node_tab.
    *CLEAR node_tab.

    *node_tab-type = 'P'.
    *node_tab-name = 'Germany'.
    *node_tab-tlevel = '03'.
    *node_tab-nlength = '7'.
    *node_tab-color = '4'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 4.
    *APPEND node_tab.
    *CLEAR node_tab.
    *
    *node_tab-type = 'P'.
    *node_tab-name = 'Berlin'.
    *node_tab-tlevel = '04'.
    *node_tab-nlength = '6'.
    *node_tab-color = '4'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 3.
    *APPEND node_tab.
    *CLEAR node_tab.
    *
    *node_tab-type = 'P'.
    *node_tab-name = 'Asia'.
    *node_tab-tlevel = '02'.
    *node_tab-nlength = '4'.
    *node_tab-color = '1'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 3.
    *APPEND node_tab.
    *CLEAR node_tab.
    *
    *node_tab-type = 'P'.
    *node_tab-name = 'India'.
    *node_tab-tlevel = '03'.
    *node_tab-nlength = '5'.
    *node_tab-color = '1'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 3.
    *APPEND node_tab.
    *CLEAR node_tab.
    *
    *node_tab-type = 'P'.
    *node_tab-name = 'Bombay'.
    *node_tab-tlevel = '04'.
    *node_tab-nlength = '6'.
    *node_tab-color = '1'.
    *node_tab-text = 'Hello'.
    *node_tab-tlength ='5'.
    *node_tab-tcolor = 3.
    *APPEND node_tab.
    *CLEAR node_tab.

    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    TABLES
    nodetab = node_tab.

    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    use_control = 'L'.

    Related Interests

      .
      CONCATENATE PATH DATE INTO PATH.
      CONCATENATE PATH '.cfm' INTO PATH.
      CONDENSE URL NO-GAPS.
      CONDENSE PATH NO-GAPS.
      CALL FUNCTION 'HTTP_GET_FILE_DP'
      EXPORTING
      ABSOLUTE_URI = URL
      DOCUMENT_PATH = PATH
      IMPORTING
      STATUS_CODE = STATUS_CODE
      STATUS_TEXT = STATUS_TEXT
      * TABLES
      * RESPONSE_HEADERS =
      * EXCEPTIONS
      * DP_ERROR = 1
      * OTHERS = 2
      .
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      * WAIT UP TO 1 SECONDS.
      P_FILE = PATH.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
      FILENAME = P_FILE
      I_BEGIN_COL = '1'
      I_BEGIN_ROW = '1'
      I_END_COL = '2'
      I_END_ROW = '31'
      TABLES
      INTERN = EXCEL2[].
      * EXCEPTIONS
      * INCONSISTENT_PARAMETERS = 1
      * UPLOAD_OLE = 2
      * OTHERS = 3
      .
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      PERFORM UPLOAD_TABLE.
      ENDIF.
      ENDLOOP.
      WRITE :/5 'Batch updated successully' COLOR 6.
      ULINE.
      FORMAT COLOR 1.
      WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
      ULINE.
      LOOP AT I_TEMP WHERE CUT IS NOT INITIAL AND CLARITY IS NOT INITIAL AND COLOR
      IS NOT INITIAL and shape is NOT INITIAL.
      IF VAL1 = 0.
      VAL1 = 1.
      FORMAT COLOR 3.
      ELSE.
      VAL1 = 0.
      FORMAT COLOR 6.
      ENDIF.
      WRITE :/5 I_TEMP-CHARG, 30 I_TEMP-REPORT, 50 I_TEMPWEIGHT,
      70(50) 'Record uploaded successfully'.
      ENDLOOP.
      ULINE.
      SKIP 3.
      WRITE :/5 'Error occured in batch' COLOR 5.
      ULINE.
      FORMAT COLOR 1.
      WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
      ULINE.
      LOOP AT I_ERROR1.
      IF VAL1 = 0.
      VAL1 = 1.
      FORMAT COLOR 3.
      ELSE.
      VAL1 = 0.
      FORMAT COLOR 6.
      ENDIF.
      WRITE :/5 I_ERROR1-CHARG, 30 I_ERROR1-REPORT, 50 I_ERROR1-
      WEIGHT, 70(50) I_ERROR1-ERROR.
      ENDLOOP.
      SKIP 3.
      WRITE :/5 'Batch uploaded with blank field' COLOR 5.
      ULINE.
      FORMAT COLOR 1.
      WRITE :/5 'Batch No', 30 'Report No.', 50 'Weight', 70(50) 'Message'.
      ULINE.
      LOOP AT I_TEMP WHERE CUT IS INITIAL or CLARITY IS INITIAL or COLOR IS INITIAL
      or shape is INITIAL.
      IF VAL1 = 0.
      VAL1 = 1.
      FORMAT COLOR 3.
      ELSE.
      VAL1 = 0.
      FORMAT COLOR 6.
      ENDIF.
      WRITE :/5 I_TEMP-CHARG, 30 I_TEMP-REPORT, 50 I_TEMPWEIGHT,
      70(50) 'Record updated with blank field'.
      ENDLOOP.
      ENDIF.
      ***********************************************************************
      *&---------------------------------------------------------------------*
      *& Form FILTER_TABLE
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM UPLOAD_TABLE .
      CLEAR : EXCEL3[].
      excel3[] = excel2[].
      delete ADJACENT DUPLICATES FROM excel2 COMPARING row.
      LOOP AT EXCEL2 ASSIGNING .
      CASE -VALUE.
      WHEN 'Date of Issue:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      CONDENSE -VALUE NO-GAPS.
      PERFORM CONVERT_DATE USING -VALUE CHANGING WA_GIA-ISDAT.
      ENDIF.
      WHEN 'Measurements:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-MGRMENT = -VALUE.
      ENDIF.
      "------Shape just above from measurment line-------------------------
      rval = ( -row - 1 ).
      READ TABLE excel3 ASSIGNING WITH KEY row = rval col = 1 .
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZSHAPE4 INTO WA_GIA-SHAPE WHERE DESCR = -
      VALUE.
      WHEN 'Carat Weight:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-WEIGHT = -WEIGHT.
      ENDIF.
      WHEN 'Color Grade:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-COLOR = -VALUE.
      ENDIF.
      WHEN 'Color:'.
      READ TABLE excel3 ASSIGNING WITH KEY value = ' Grade:'.
      IF sy-subrc eq 0.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      WA_GIA-COLOR = -VALUE.
      ENDIF.
      WHEN 'Clarity Grade:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-CLARITY = -VALUE.
      ENDIF.
      WHEN 'Cut Grade:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIA-CUT WHERE DESCR = -
      VALUE.
      ENDIF.
      WHEN 'Depth:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-DEPTHPER = -VALUE.
      ENDIF.
      WHEN 'Table:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-TABLEPER = -VALUE.
      ENDIF.
      WHEN 'Crown Angle:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      CLEAR : val3, val4.
      SPLIT -VALUE AT '°' INTO val3 val4.
      WA_GIA-CROWNANG = val3.
      ENDIF.
      WHEN 'Crown Height:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-CROWN_HEIGHT = -VALUE.
      ENDIF.
      WHEN 'Pavilion Angle:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      CLEAR : val3, val4.
      SPLIT -VALUE AT '°' INTO val3 val4.
      WA_GIA-PAVILINANG = val3.
      ENDIF.
      WHEN 'Pavilion Depth:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-PAVILIONDEP = -VALUE.
      ENDIF.
      WHEN 'Star length:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-STAR = -VALUE.
      ENDIF.
      WHEN 'Lower Half:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      WA_GIA-LOWERHALF = -VALUE.
      ENDIF.
      WHEN 'Girdle:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIAGIRDLE
      WHERE DESCR = -VALUE.
      ENDIF.
      WHEN 'Culet:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIACULETSIZE
      WHERE DESCR = -VALUE.
      ENDIF.
      WHEN 'Polish:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIAPOLISH
      WHERE DESCR = -VALUE.
      ENDIF.
      WHEN 'Symmetry:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE CODE_N FROM ZDESCR INTO WA_GIASYMMETRY
      WHERE DESCR = -VALUE.
      ENDIF.
      WHEN 'Fluorescence:'.
      READ TABLE excel3 ASSIGNING WITH KEY row = -row col = 2.
      IF sy-subrc eq 0.
      TRANSLATE -VALUE TO UPPER CASE.
      SELECT SINGLE FLUORES FROM ZFLUORES_CODE INTO WA_GIAFL
      WHERE DESCR = -VALUE.
      ENDIF.
      ENDCASE.
      ENDLOOP.
      "WA_GIA-SHAPE = 'TESTING'.
      WA_GIA-CHARG = -CHARG.
      WA_GIA-REPORT = -REPORT.
      WA_GIA-WEIGHT = -WEIGHT.
      MOVE-CORRESPONDING WA_GIA TO ZSD_GIA.
      *IF WA_GIA-CUT IS NOT INITIAL AND WA_GIA-CLARITY IS NOT INITIAL AND WA_GIACOLOR
      IS NOT INITIAL and WA_GIA-shape is NOT INITIAL.
      *-----------Enter Record in ZSD_GIA table.
      MODIFY ZSD_GIA.
      *-----------Enter Record in zlarge_stone_hdr table.
      SELECT SINGLE * INTO i_zlarge_hdr FROM zlarge_stone_hdr WHERE BATNO = WA_GI
      A-charg.
      IF sy-subrc is not INITIAL.
      SELECT MAX( SAPNO ) FROM zlarge_stone_hdr INTO sapno .
      i_zlarge_hdr-batno = WA_GIA-charg.
      i_zlarge_hdr-sapno = sapno + 1.
      i_zlarge_hdr-ERSDA = sy-datum.
      i_zlarge_hdr-ERNAM = sy-uname.
      MOVE-CORRESPONDING i_zlarge_hdr to zlarge_stone_hdr.
      modify zlarge_stone_hdr.
      ENDIF.
      *-----------Enter Record in zlarge_stone_itm table.
      SELECT SINGLE * INTO i_zlarge_itm FROM zlarge_stone_itm WHERE BATNO = WA_GIAcharg
      and lab = 'GIA'.
      IF sy-subrc is not INITIAL.
      SELECT MAX( SAPNO ) FROM zlarge_stone_hdr INTO sapno .
      SELECT count( * ) FROM zlarge_stone_itm INTO litem1 where batno = WA_GIAcharg
      and SEL = 'X'.
      SELECT count( * ) FROM zlarge_stone_itm INTO litem where batno = WA_GIAcharg.
      i_zlarge_itm-LITEM = ( litem + 1 ) * 10.
      i_zlarge_itm-SAPNO = sapno.
      i_zlarge_itm-batno = WA_GIA-charg.
      i_zlarge_itm-report = WA_GIA-report.
      i_zlarge_itm-WEIGHT = WA_GIA-WEIGHT.
      i_zlarge_itm-RESULTDAT = WA_GIA-ISDAT.
      i_zlarge_itm-MESURMNTS = WA_GIA-MGRMENT.
      i_zlarge_itm-COLOR = WA_GIA-COLOR.
      i_zlarge_itm-CLARITY = WA_GIA-CLARITY.
      i_zlarge_itm-CUT = WA_GIA-CUT.
      i_zlarge_itm-DEPTHPER = WA_GIA-DEPTHPER.
      i_zlarge_itm-TABLEPER = WA_GIA-TABLEPER.
      i_zlarge_itm-CROWNANG = WA_GIA-CROWNANG.
      i_zlarge_itm-CROWN_HEIGHT = WA_GIA-CROWN_HEIGHT.
      i_zlarge_itm-PAVILINANG = WA_GIA-PAVILINANG.
      i_zlarge_itm-PAVILIONDEP = WA_GIA-PAVILIONDEP.
      i_zlarge_itm-star = WA_GIA-star.
      i_zlarge_itm-LOWERHALF = WA_GIA-LOWERHALF.
      i_zlarge_itm-GIRDLE = WA_GIA-GIRDLE.
      i_zlarge_itm-CULETSIZE = WA_GIA-CULETSIZE.
      i_zlarge_itm-POLISH = WA_GIA-POLISH.
      i_zlarge_itm-SYMMETRY = WA_GIA-SYMMETRY.
      i_zlarge_itm-FL = WA_GIA-FL.
      i_zlarge_itm-SHAPE = WA_GIA-SHAPE.
      i_zlarge_itm-LAB = 'GIA'.
      IF litem1 EQ 0.
      i_zlarge_itm-SEL = 'X'.
      ENDIF.
      MOVE-CORRESPONDING i_zlarge_itm to zlarge_stone_itm.
      modify zlarge_stone_itm.
      ENDIF.
      *ENDIF.
      APPEND ZSD_GIA TO I_TEMP.
      CLEAR WA_GIA.
      ENDFORM. " FILTER_TABLE
      *&---------------------------------------------------------------------*
      *& Form F4_HELP_P_FILE_IT
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM F4_HELP_P_FILE_IT .
      DATA : V_FILE LIKE PFILEIT.
      * Display popup with files list to select
      CALL FUNCTION 'F4_FILENAME'
      IMPORTING
      FILE_NAME = V_FILE.
      * if file is selected, then
      CHECK SY-SUBRC EQ 0.
      PFILEIT = V_FILE.
      ENDFORM. " F4_HELP_P_FILE_IT
      *&---------------------------------------------------------------------*
      *& Form UPLOAD_FILE
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM UPLOAD_FILE .
      CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
      FILENAME = PFILEIT
      FILETYPE = 'DAT'
      TABLES
      DATA_TAB = IT_FILE
      EXCEPTIONS
      CONVERSION_ERROR = 1
      FILE_OPEN_ERROR = 2
      FILE_READ_ERROR = 3
      INVALID_TYPE = 4
      NO_BATCH = 5
      UNKNOWN_ERROR = 6
      INVALID_TABLE_WIDTH = 7
      GUI_REFUSE_FILETRANSFER = 8
      CUSTOMER_ERROR = 9
      OTHERS = 10.
      IF IT_FILE[] IS INITIAL.
      MESSAGE E001.
      RETURN.
      ENDIF.
      IF SY-SUBRC NE 0 .
      MESSAGE E002.
      RETURN.
      ENDIF.
      ENDFORM. " UPLOAD_FILE
      *&---------------------------------------------------------------------*
      *& Form CONVERT_DATE
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * -->P_IT_DATATAB_COL2 text
      * <--P_WA_GIA_ISDAT text
      *----------------------------------------------------------------------*
      FORM CONVERT_DATE USING P_IT_DATATAB_COL2
      CHANGING P_WA_GIA_ISDAT.
      TDATE = P_IT_DATATAB_COL2.
      CALL FUNCTION 'Z_CONVERT_TO_INTERNAL_FORMAT1'
      EXPORTING
      IM_INPUT = TDATE
      IMPORTING
      EX_OUTPUT = P_WA_GIA_ISDAT
      * EXCEPTIONS
      * INVALID_DATE = 1
      * OTHERS = 2.
      .
      IF SY-SUBRC <> 0.
      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      .
      ENDFORM. " CONVERT_DATE
      *&---------------------------------------------------------------------*
      *& Form WEIGHT_VALIDATION
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM WEIGHT_VALIDATION .
      DATA : I_WT(3) TYPE C,
      D_WT(3) TYPE C,
      VAL TYPE I VALUE 0.
      LOOP AT IT_FILE.
      SPLIT IT_FILE-WEIGHT AT '.' INTO I_WT D_WT.
      IF STRLEN( D_WT ) NE 2.
      I_ERROR-REPORT = IT_FILE-REPORT.
      I_ERROR-CHARG = IT_FILE-CHARG.
      I_ERROR-WEIGHT = IT_FILE-WEIGHT.
      I_ERROR-ERROR = 'Decimal part of weight must be of length 2 only.'.
      APPEND I_ERROR.
      ENDIF.
      ENDLOOP.
      IF I_ERROR[] IS NOT INITIAL.
      ULINE.
      FORMAT COLOR 1.
      WRITE :/5 'Batch No', 30 'Report No', 50 'Weight', 70(50) 'Error'.
      ULINE.
      LOOP AT I_ERROR.
      IF VAL = 0.
      VAL = 1.
      FORMAT COLOR 3.
      ELSE.
      VAL = 0.
      FORMAT COLOR 6.
      ENDIF.
      WRITE :/5 I_ERROR-CHARG, 30 I_ERROR-REPORT, 50 I_ERRORWEIGHT,
      70(50) I_ERROR-ERROR.
      ENDLOOP.
      ENDIF.
      ENDFORM. " WEIGHT_VALIDATION

      11. Upload Data in Back Ground:
      *&---------------------------------------------------------------------*
      *& Report Z_LOOSE_STOCK_DOWNLOAD
      *&---------------------------------------------------------------------*
      *& Report For Finding Loose Stock Matching
      *& Developed By : Durgesh Singh
      *& Developed On : 24.08.2011
      *& Functional : Rakesh Churi
      *& T. Code :
      *& Modification :
      *&---------------------------------------------------------------------*
      REPORT Z_LOOSE_STOCK_DOWNLOAD.
      TABLES : MCHB, ZMCHB.
      DATA: BEGIN OF I_MCHB OCCURS 0,
      MATNR TYPE MCHB-MATNR,
      WERKS TYPE MCHB-WERKS,
      LGORT TYPE MCHB-LGORT,
      CHARG TYPE MCHB-CHARG,
      CLABS TYPE MCHB-CLABS,
      NORMT TYPE MARA-NORMT,
      MAKTX TYPE MAKT-MAKTX,
      END OF I_MCHB,
      BEGIN OF I_TAB OCCURS 0,
      MATNR(18) TYPE C,
      WERKS(4) TYPE C,
      LGORT(4) TYPE C,
      CHARG(10) TYPE C,
      CLABS(13) TYPE C,
      NORMT(18) TYPE C,
      MAKTX(40) TYPE C,
      TEMP(1) TYPE C,
      END OF I_TAB.
      DATA : I_ZMCHB TYPE STANDARD TABLE OF ZMCHB WITH HEADER LINE.
      DATA : E_FILE LIKE RLGRAP-FILENAME,
      HTAB(1) TYPE C,
      STR(110) TYPE C,
      LENG TYPE I,
      VAL TYPE I.
      SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-001.
      PARAMETERS : V_DLD RADIOBUTTON GROUP GRP1,
      V_UPD RADIOBUTTON GROUP GRP1.
      SELECTION-SCREEN END OF BLOCK BLK01.
      START-OF-SELECTION.
      IF V_DLD = 'X'.
      PERFORM DOWNLOAD.
      ELSE.
      PERFORM UPLOAD.
      ENDIF.
      *&---------------------------------------------------------------------*
      *& Form DOWNLOAD
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM DOWNLOAD .
      SELECT A~MATNR
      A~WERKS
      A~LGORT
      A~CHARG
      A~CLABS
      B~NORMT
      C~MAKTX
      INTO CORRESPONDING FIELDS OF TABLE I_MCHB
      FROM MCHB AS A LEFT JOIN MARA AS B
      ON A~MATNR = B~MATNR
      LEFT JOIN MAKT AS C
      ON A~MATNR = C~MATNR
      WHERE A~WERKS IN ('7100','8100','9200') AND
      A~CLABS NE 0 AND
      A~LGORT EQ 'DNAC'.
      SELECT MATNR
      WERKS
      LGORT
      CHARG
      CLABS
      NORMT
      MAKTX
      INTO CORRESPONDING FIELDS OF TABLE I_ZMCHB
      FROM ZMCHB WHERE CLABS NE 0.
      LOOP AT I_ZMCHB.
      MOVE-CORRESPONDING I_ZMCHB TO I_TAB.
      I_TAB-TEMP = '@'.
      APPEND I_TAB.
      ENDLOOP.
      LOOP AT I_MCHB.
      READ TABLE I_ZMCHB WITH KEY MATNR = I_MCHB-MATNR
      WERKS = I_MCHB-WERKS
      LGORT = I_MCHB-LGORT
      CHARG = I_MCHB-CHARG.
      IF SYSUBRC
      IS NOT INITIAL. " append data that exist in MCHB and not exist in table
      ZMCHB
      MOVE-CORRESPONDING I_MCHB TO I_TAB.
      I_TABTEMP
      = '@'. "temprary variable for frmat line at upload only.
      APPEND I_TAB.
      ENDIF.
      ENDLOOP.
      READ TABLE I_TAB WITH KEY WERKS = '8100'.
      IF SY-SUBRC IS INITIAL.
      "E_FILE = '\192.168.12.12\Downloads\RJCDLD.TXT'.
      E_FILE = '\192.168.50.36\Downloads\RJCDLD.TXT'.
      ELSE.
      "E_FILE = '\192.168.12.12\Downloads\FSGDLD.TXT'.
      E_FILE = '\192.168.12.7\Downloads\FSGDLD.TXT'.
      ENDIF.
      OPEN DATASET E_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      LOOP AT I_TAB.
      TRANSFER I_TAB TO E_FILE.
      ENDLOOP.
      CLOSE DATASET E_FILE.
      ENDFORM. " DOWNLOAD
      *&---------------------------------------------------------------------*
      *& Form UPLOAD
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM UPLOAD .
      * E_FILE = '\192.168.12.12\Downloads00DLD.TXT'.
      IF SY-MANDT = '009'.
      E_FILE = '\192.168.12.7\Downloads00DLD.TXT'.
      ELSEIF SY-MANDT = '007'.
      E_FILE = '\192.168.50.36\Downloads00DLD.TXT'.
      ENDIF.
      OPEN DATASET E_FILE FOR INPUT IN BINARY MODE.
      IF SY-SUBRC IS INITIAL.
      DO.
      READ DATASET E_FILE INTO STR LENGTH LENG .
      I_TAB-MATNR = STR+0(18).
      I_TAB-WERKS = STR+18(4).
      I_TAB-LGORT = STR+22(4).
      I_TAB-CHARG = STR+26(10).
      I_TAB-CLABS = STR+36(13).
      I_TAB-NORMT = STR+49(18).
      I_TAB-MAKTX = STR+67(40).
      APPEND I_TAB.
      IF SY-SUBRC <> 0.
      EXIT.
      ENDIF.
      ENDDO.
      CLOSE DATASET E_FILE.
      DESCRIBE TABLE I_TAB LINES VAL.
      DELETE I_TAB INDEX VAL.
      IF SY-MANDT = '009'.
      LOOP AT I_TAB WHERE WERKS NE '8100'.
      MOVE-CORRESPONDING I_TAB TO I_ZMCHB.
      APPEND I_ZMCHB.
      ENDLOOP.
      ELSEIF SY-MANDT = '007'.
      LOOP AT I_TAB WHERE WERKS EQ '8100'.
      MOVE-CORRESPONDING I_TAB TO I_ZMCHB.
      APPEND I_ZMCHB.
      ENDLOOP.
      ENDIF.
      MODIFY ZMCHB FROM TABLE I_ZMCHB.
      ENDIF.
      ENDFORM. " UPLOAD

      12. Email Report:
      DATA: lt_mailrecipients TYPE STANDARD TABLE OF somlrec90 WITH HEADER LINE,
      lt_mailtxt TYPE STANDARD TABLE OF soli WITH HEADER LINE,
      lt_attachment TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
      lt_mailsubject TYPE sodocchgi1,
      lt_packing_list TYPE STANDARD TABLE OF zsopcklsti1 WITH HEADER LIN
      E,
      gv_cnt TYPE i,
      gd_subject like sodocchgi1-obj_descr,
      it_mess_att like solisti1 occurs 0 with header line.
      DATA : cts TYPE string,
      pcs TYPE string,
      weight1 TYPE string,
      diff1 TYPE string,
      subject TYPE string.
      DATA : BEGIN OF i_email OCCURS 0,
      emailid TYPE zemailid-EMAIL_ID,
      END OF i_email.
      SELECT email_id INTO TABLE i_email from zemailid.
      LOOP AT i_email.
      lt_mailrecipients-rec_type = 'U'.
      lt_mailrecipients-com_type = 'INT'.
      lt_mailrecipients-RECEIVER = i_email-emailid.
      APPEND lt_mailrecipients .
      CLEAR lt_mailrecipients .
      ENDLOOP.
      CLEAR : subject.
      Data: temp type string.
      Clear : temp.
      CONCATENATE '-' sloc into temp.
      * CONCATENATE 'PLEASE FIND ATTACHMENT FOR HKSTOCK
      STATUS FOR STORAGE LOCATION -
      ' sloc ' OF PLANT: ' plant1 ' AS ON: ' sdate ', ' stime
      * INTO subject. "Commented by raj
      CONCATENATE 'PLEASE FIND ATTACHMENT FOR HKSTOCK
      STATUS FOR STORAGE LOCATION' temp 'OF PLANT: ' plant1 'AS ON: ' sdate '
      , ' stime
      INTO subject SEPARATED BY SPACE.
      lt_mailtxt = subject. APPEND lt_mailtxt. CLEAR lt_mailtxt.
      APPEND lt_mailtxt. CLEAR lt_mailtxt.
      lt_mailtxt = 'Thanks,'. APPEND lt_mailtxt. CLEAR lt_mailtxt.
      lt_mailtxt = 'SAP'. APPEND lt_mailtxt. CLEAR lt_mailtxt.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      CONCATENATE 'STOCK STATUS FOR STORAGE LOCATION -
      ' sloc 'OF PLANT : ' plant1 'AS ON : ' sdate ' ' stime
      INTO lt_attachment.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      *"------------------------------Insert Record For DISPLAY System Inventory
      CONCATENATE 'Stock Batches not in System Inventory' ' '
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      CONCATENATE 'Batch No.' ' '
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      LOOP AT IT_PCODE INTO WA_PCODE.
      CONCATENATE wa_pcode-charg ' '
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      ENDLOOP.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      "------------------------------End Of DISPLAY System Inventory
      "------------------------------Insert Record For DISPLAY Physical Inventory
      CONCATENATE 'Stock Batches not in Physical Inventory' ' '
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      CONCATENATE 'Batch No.' 'Plant' 'Material No.' 'Material Description' 'Stor
      age Location' 'Qty in CTS' 'Qty in Pcs' 'Batch Description'
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      loop at IT_DATA_ST INTO WA_DATA .
      CLEAR : cts, pcs.
      cts = WA_DATA-CLABS.
      pcs = WA_DATA-ext_menge01.
      CONCATENATE WA_DATA-charg WA_DATA-werks WA_DATA-MATNR WA_DATAMAKTX
      WA_DATA-LGORT cts pcs WA_DATA-STATUS
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      ENDLOOP.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      "------------------------------End Of DISPLAY Physical Inventory
      *"------------------------------
      Insert Record For DISPLAY System and Physical Inventory
      CONCATENATE 'Stock Batches in System and Physical Inventory' ' '
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      CONCATENATE 'Batch No.' 'Plant' 'Material No.' 'Material Description' 'Stor
      age Location' 'Qty in CTS' 'Qty in Pcs' 'Phy. Weight' 'Difference'
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      LOOP AT IT_BCODE_WT INTO WA_SCODE.
      CLEAR : cts, pcs,weight1,diff1.
      cts = WA_SCODE-CLABS.
      pcs = WA_SCODE-ext_menge01.
      weight1 = WA_SCODE-weight.
      diff1 = WA_SCODE-DIFF.
      CONCATENATE WA_SCODE-charg WA_SCODE-werks WA_SCODE-MATNR WA_SCODEMAKTX
      WA_SCODE-LGORT cts pcs weight1 diff1
      INTO lt_attachment SEPARATED BY
      cl_abap_char_utilities=>horizontal_tab.
      CONCATENATE cl_abap_char_utilities=>newline lt_attachment
      INTO lt_attachment.
      APPEND lt_attachment. CLEAR lt_attachment.
      ENDLOOP.
      "------------------------------End Of DISPLAY System and Physical Inventory
      CLEAR : subject.
      CONCATENATE 'STOCK STATUS - ' ' SAP SYSTEM GENERATED EMAIL'
      INTO subject.
      lt_packing_list-transf_bin = SPACE.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num = 0.
      lt_packing_list-body_start = 1.
      lt_packing_list-body_num = LINES( lt_attachment ).
      lt_packing_list-doc_type = 'RAW'.
      APPEND lt_packing_list. CLEAR lt_packing_list.
      lt_packing_list-transf_bin = 'X'.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num = 1.
      lt_packing_list-body_start = 1.
      lt_packing_list-body_num = LINES( lt_attachment ).
      lt_packing_listdoc_
      type = 'XLS'. " You can give RAW incase if you want just a txt file.
      lt_packing_list-obj_name = 'ZBARCODE_WT'.
      lt_packing_list-obj_descr = 'ZBARCODE_WT'.
      lt_packing_list-doc_size = lt_packing_list-body_num * 255.
      APPEND lt_packing_list. CLEAR lt_packing_list.
      lt_mailsubject-obj_name = 'MAILATTCH'.
      lt_mailsubject-obj_langu = sy-langu.
      lt_mailsubject-obj_descr = subject.
      lt_mailsubject-sensitivty = 'F'.
      gv_cnt = LINES( lt_attachment ).
      lt_mailsubject-doc_size = ( gv_cnt -
      1 ) * 255 + STRLEN( lt_attachment ).
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
      document_data = lt_mailsubject
      TABLES
      packing_list = lt_packing_list
      contents_bin = lt_attachment
      contents_txt = lt_mailtxt
      receivers = lt_mailrecipients
      EXCEPTIONS
      too_many_receivers = 1
      document_not_sent = 2
      document_type_not_exist = 3
      operation_no_authorization = 4
      parameter_error = 5
      x_error = 6
      enqueue_error = 7
      OTHERS = 8.
      IF sy-subrc EQ 0.
      COMMIT WORK.
      SUBMIT rsconn01 WITH MODE = 'INT' AND RETURN.
      ENDIF.

      13. PDF On Screen 1:
      Driver Program
      *&---------------------------------------------------------------------*
      *& Report Z_PDF_CONVERT
      *&
      *&---------------------------------------------------------------------*
      *&
      *&
      *&---------------------------------------------------------------------*
      REPORT Z_PDF_CONVERT NO STANDARD PAGE HEADING.
      DATA : GS_PRINT_PARMS TYPE PRI_PARAMS,
      L_VALID TYPE STRING,
      GS_TSP01 TYPE TSP01,
      GV_RQ2NAME TYPE TSP01-RQ2NAME.
      DATA: CONTROL TYPE SSFCTRLOP,
      ERRTAB TYPE TSFERROR,
      OUTPUT TYPE SSFCOMPOP,
      FMCNP TYPE RS38L_FNAM.
      PARAMETERS :
      VAL AS CHECKBOX.
      IF VAL = 'X'.
      CONCATENATE SY-REPID+0(9) SY-UNAME+0(3) INTO GV_RQ2NAME.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
      DESTINATION = 'LOCL'
      LAYOUT = 'X_65_80'
      LINE_SIZE = '80'
      NO_DIALOG = 'X'
      IMPORTING
      OUT_PARAMETERS = GS_PRINT_PARMS
      VALID = L_VALID
      EXCEPTIONS
      ARCHIVE_INFO_NOT_FOUND = 1
      INVALID_PRINT_PARAMS = 2
      INVALID_ARCHIVE_PARAMS = 3
      OTHERS = 4.
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      GS_PRINT_PARMS-PRIMM = ' '.
      GS_PRINT_PARMS-PRCOP = '1'.
      DELETE FROM TSP01
      WHERE RQ2NAME EQ GV_RQ2NAME.
      SUBMIT Z_PDF_CONVERT TO SAP-SPOOL WITHOUT SPOOL DYNPRO
      SPOOL PARAMETERS GS_PRINT_PARMS
      AND RETURN.
      SELECT SINGLE *
      FROM TSP01
      INTO GS_TSP01
      WHERE RQOWNER EQ SY-UNAME.
      IF SY-SUBRC EQ 0.
      CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
      EXPORTING
      SPOOLNO = GS_TSP01-RQIDENT
      NAME = GS_TSP01-RQO1NAME.
      DELETE TSP01 FROM GS_TSP01.
      COMMIT WORK AND WAIT.
      EXIT.
      ENDIF.
      ELSE.
      DATA: WA_OUTPUT_OPTIONS TYPE SSFCOMPOP.
      DATA :WA_JOB_OUTPUT_INFO TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
      FORMNAME = 'Z_TEST_DURGESH'
      IMPORTING
      FM_NAME = FMCNP
      EXCEPTIONS
      NO_FORM = 1
      NO_FUNCTION_MODULE = 2
      OTHERS = 3.
      CONTROL-NO_DIALOG = 'X'.
      OUTPUT-TDDEST = 'LOCL'.
      OUTPUT-TDNEWID = 'X'.
      OUTPUT-TDIEXIT = 'X'.
      OUTPUT-TDFINAL = 'X'.
      OUTPUT-TDNOPRINT = ' '.
      CALL FUNCTION FMCNP
      EXPORTING
      USER_SETTINGS = ' '
      CONTROL_PARAMETERS = CONTROL
      OUTPUT_OPTIONS = OUTPUT
      IMPORTING
      JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO
      JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS.
      ENDIF.
      'Z_FM_PDF_DATADISPLAY'
      Import parameter - SPOOLNO TYPE TSP01-RQIDENT
      NAME TYPE RSTSTYPE-NAME
      Source Code –
      DATA: NUMBYTES TYPE I,
      PDFSPOOLID LIKE TSP01-RQIDENT,
      JOBNAME LIKE TBTCJOB-JOBNAME,
      JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
      OBJTYPE LIKE RSTSTYPE-TYPE,
      TYPE LIKE RSTSTYPE-TYPE,
      IS_OTF.
      DATA: PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
      EXPORTING
      AUTHORITY = 'SP01'
      CLIENT = SY-MANDT
      NAME = NAME
      PART = 1
      IMPORTING
      TYPE = TYPE
      OBJTYPE = OBJTYPE
      EXCEPTIONS
      FB_ERROR = 1
      FB_RSTS_OTHER = 2
      NO_OBJECT = 3
      NO_PERMISSION = 4.
      IF OBJTYPE(3) = 'OTF'.
      IS_OTF = 'X'.
      ELSE.
      IS_OTF = SPACE.
      ENDIF.
      IF IS_OTF = 'X'.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
      SRC_SPOOLID = SPOOLNO
      NO_DIALOG = ' '
      IMPORTING
      PDF_BYTECOUNT = NUMBYTES
      PDF_SPOOLID = PDFSPOOLID
      BTC_JOBNAME = JOBNAME
      BTC_JOBCOUNT = JOBCOUNT
      TABLES
      PDF = PDF
      EXCEPTIONS
      ERR_NO_OTF_SPOOLJOB = 1
      ERR_NO_SPOOLJOB = 2
      ERR_NO_PERMISSION = 3
      ERR_CONV_NOT_POSSIBLE = 4
      ERR_BAD_DSTDEVICE = 5
      USER_CANCELLED = 6
      ERR_SPOOLERROR = 7
      ERR_TEMSEERROR = 8
      ERR_BTCJOB_OPEN_FAILED = 9
      ERR_BTCJOB_SUBMIT_FAILED = 10
      ERR_BTCJOB_CLOSE_FAILED = 11.
      ELSE.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
      SRC_SPOOLID = SPOOLNO
      NO_DIALOG = ' '
      IMPORTING
      PDF_BYTECOUNT = NUMBYTES
      PDF_SPOOLID = PDFSPOOLID
      BTC_JOBNAME = JOBNAME
      BTC_JOBCOUNT = JOBCOUNT
      TABLES
      PDF = PDF
      EXCEPTIONS
      ERR_NO_ABAP_SPOOLJOB = 1
      ERR_NO_SPOOLJOB = 2
      ERR_NO_PERMISSION = 3
      ERR_CONV_NOT_POSSIBLE = 4
      ERR_BAD_DESTDEVICE = 5
      USER_CANCELLED = 6
      ERR_SPOOLERROR = 7
      ERR_TEMSEERROR = 8
      ERR_BTCJOB_OPEN_FAILED = 9
      ERR_BTCJOB_SUBMIT_FAILED = 10
      ERR_BTCJOB_CLOSE_FAILED = 11.
      ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      FILENAME = 'D:\durgesh.pdf'
      FILETYPE = 'BIN'
      TABLES
      DATA_TAB = PDF
      EXCEPTIONS
      FILE_WRITE_ERROR = 1
      NO_BATCH = 2
      GUI_REFUSE_FILETRANSFER = 3
      INVALID_TYPE = 4
      NO_AUTHORITY = 5
      UNKNOWN_ERROR = 6
      HEADER_NOT_ALLOWED = 7
      SEPARATOR_NOT_ALLOWED = 8
      FILESIZE_NOT_ALLOWED = 9
      HEADER_TOO_LONG = 10
      DP_ERROR_CREATE = 11
      DP_ERROR_SEND = 12
      DP_ERROR_WRITE = 13
      UNKNOWN_DP_ERROR = 14
      ACCESS_DENIED = 15
      DP_OUT_OF_MEMORY = 16
      DISK_FULL = 17
      DP_TIMEOUT = 18
      FILE_NOT_FOUND = 19
      DATAPROVIDER_EXCEPTION = 20
      CONTROL_FLUSH_ERROR = 21
      OTHERS = 22.
      CALL SCREEN 100.
      Screen –
      PBO –
      SET PF-STATUS 'STS'.
      SET TITLEBAR 'TTL'.
      IF MY_MAIN_CONTAINER IS INITIAL.
      CREATE OBJECT MY_MAIN_CONTAINER
      EXPORTING
      CONTAINER_NAME = 'CUSTOM_CNTL'
      EXCEPTIONS
      CNTL_ERROR = 1
      OTHERS = 2.
      IF SY-SUBRC <> 0.
      EXIT.
      ELSE.
      " -----------------------------------
      " create PDF Viewer object
      CREATE OBJECT MY_PDF_VIEWER
      EXPORTING
      PARENT = MY_MAIN_CONTAINER
      EXCEPTIONS
      CNTL_ERROR = 1
      CNTL_SYSTEM_ERROR = 2
      OTHERS = 3.
      IF SY-SUBRC <> 0.
      "could not create PDF Viewer
      ENDIF.
      ENDIF.
      DATA: VIEW_BUTTONS_ACTIVE TYPE CHAR01.
      IF MY_PDF_VIEWER->ACROBAT_VS_READER = ''.
      VIEW_BUTTONS_ACTIVE = 'X'.
      ENDIF.
      " -----------------------------------
      " create SAP toolbar for PDF Viewer
      CALL METHOD MY_PDF_VIEWER->CREATE_TOOLBAR
      EXPORTING
      TOOL_BUTTONS = 'X'
      VIEW_BUTTONS = VIEW_BUTTONS_ACTIVE
      EXCEPTIONS
      CNTL_ERROR = 1
      CNTL_SYSTEM_ERROR = 2
      OTHERS = 3.
      IF SY-SUBRC <> 0.
      "could not create toolbar
      ENDIF.
      CREATE OBJECT L_EVENT_RECEIVER.
      SET HANDLER L_EVENT_RECEIVER->ON_DOCUMENT_SAVED FOR MY_PDF_VIEWER.
      SET HANDLER L_EVENT_RECEIVER->ON_VIEWING_FINISHED FOR MY_PDF_VIEWER.
      IF NOT MY_PDF_VIEWER->HTML_VIEWER IS INITIAL.
      CALL METHOD MY_PDF_VIEWER->OPEN_DOCUMENT
      EXPORTING
      URL = 'D:\durgesh.pdf'.
      ENDIF.
      ENDIF.
      PAI –
      CASE OKCODE.
      WHEN 'BACK'.
      LEAVE PROGRAM.
      WHEN 'EXIT'.
      LEAVE PROGRAM.
      WHEN 'CANCEL'.
      LEAVE PROGRAM.
      WHEN 'LOADURL'.
      CALL METHOD MY_PDF_VIEWER->OPEN_DOCUMENT
      EXPORTING
      URL = 'http://p34198/myweb/Devfaq.pdf'.
      WHEN 'EVENT'.
      ENTRY1 = L_EVENT_RECEIVER->ENTRY_FIELD1.
      ENTRY2 = L_EVENT_RECEIVER->ENTRY_FIELD2.
      ENDCASE.
      14. PDF On Screen 2:
      Driver Program
      *&---------------------------------------------------------------------*
      *& Report Z_PDF_CONVERT
      *&
      *&---------------------------------------------------------------------*
      *&
      *&
      *&---------------------------------------------------------------------*
      REPORT Z_PDF_CONVERT NO STANDARD PAGE HEADING.
      DATA : GS_PRINT_PARMS TYPE PRI_PARAMS,
      L_VALID TYPE STRING,
      GS_TSP01 TYPE TSP01,
      GV_RQ2NAME TYPE TSP01-RQ2NAME.
      DATA: CONTROL TYPE SSFCTRLOP,
      ERRTAB TYPE TSFERROR,
      OUTPUT TYPE SSFCOMPOP,
      FMCNP TYPE RS38L_FNAM.
      PARAMETERS :
      VAL AS CHECKBOX.
      IF VAL = 'X'.
      CONCATENATE SY-REPID+0(9) SY-UNAME+0(3) INTO GV_RQ2NAME.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
      DESTINATION = 'LOCL'
      LAYOUT = 'X_65_80'
      LINE_SIZE = '80'
      NO_DIALOG = 'X'
      IMPORTING
      OUT_PARAMETERS = GS_PRINT_PARMS
      VALID = L_VALID
      EXCEPTIONS
      ARCHIVE_INFO_NOT_FOUND = 1
      INVALID_PRINT_PARAMS = 2
      INVALID_ARCHIVE_PARAMS = 3
      OTHERS = 4.
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      GS_PRINT_PARMS-PRIMM = ' '.
      GS_PRINT_PARMS-PRCOP = '1'.
      DELETE FROM TSP01
      WHERE RQOWNER EQ SY-UNAME.
      SUBMIT Z_PDF_CONVERT TO SAP-SPOOL WITHOUT SPOOL DYNPRO
      SPOOL PARAMETERS GS_PRINT_PARMS
      AND RETURN.
      SELECT SINGLE *
      FROM TSP01
      INTO GS_TSP01
      WHERE RQOWNER EQ SY-UNAME.
      IF SY-SUBRC EQ 0.
      CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
      EXPORTING
      SPOOLNO = GS_TSP01-RQIDENT
      NAME = GS_TSP01-RQO1NAME.
      DELETE TSP01 FROM GS_TSP01.
      COMMIT WORK AND WAIT.
      EXIT.
      ENDIF.
      ELSE.
      DATA: WA_OUTPUT_OPTIONS TYPE SSFCOMPOP.
      DATA :WA_JOB_OUTPUT_INFO TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
      FORMNAME = 'Z_TEST_DURGESH'
      IMPORTING
      FM_NAME = FMCNP
      EXCEPTIONS
      NO_FORM = 1
      NO_FUNCTION_MODULE = 2
      OTHERS = 3.
      CONTROL-NO_DIALOG = 'X'.
      OUTPUT-TDDEST = 'LOCL'.
      OUTPUT-TDNEWID = 'X'.
      OUTPUT-TDIEXIT = 'X'.
      OUTPUT-TDFINAL = 'X'.
      OUTPUT-TDNOPRINT = ' '.
      CALL FUNCTION FMCNP
      EXPORTING
      USER_SETTINGS = ' '
      CONTROL_PARAMETERS = CONTROL
      OUTPUT_OPTIONS = OUTPUT
      IMPORTING
      JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO
      JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS.
      ENDIF.
      'Z_FM_PDF_DATADISPLAY'
      Import parameter - SPOOLNO TYPE TSP01-RQIDENT
      NAME TYPE RSTSTYPE-NAME
      Source Code –
      FUNCTION Z_FM_PDF_DATADISPLAY.
      *"----------------------------------------------------------------------
      *"*"Local Interface:
      *" IMPORTING
      *" REFERENCE(SPOOLNO) TYPE TSP01-RQIDENT
      *" REFERENCE(NAME) TYPE RSTSTYPE-NAME
      *"----------------------------------------------------------------------
      DATA: NUMBYTES TYPE I,
      PDFSPOOLID LIKE TSP01-RQIDENT,
      JOBNAME LIKE TBTCJOB-JOBNAME,
      JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
      OBJTYPE LIKE RSTSTYPE-TYPE,
      TYPE LIKE RSTSTYPE-TYPE,
      IS_OTF.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
      EXPORTING
      AUTHORITY = 'SP01'
      CLIENT = SY-MANDT
      NAME = NAME
      PART = 1
      IMPORTING
      TYPE = TYPE
      OBJTYPE = OBJTYPE
      EXCEPTIONS
      FB_ERROR = 1
      FB_RSTS_OTHER = 2
      NO_OBJECT = 3
      NO_PERMISSION = 4.
      IF OBJTYPE(3) = 'OTF'.
      IS_OTF = 'X'.
      ELSEIF OBJTYPE(3) = 'TEX'.
      IS_OTF = SPACE.
      ELSE.
      IS_OTF = 'X'.
      ENDIF.
      IF IS_OTF = 'X'.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
      SRC_SPOOLID = SPOOLNO
      NO_DIALOG = ' '
      IMPORTING
      PDF_BYTECOUNT = NUMBYTES
      PDF_SPOOLID = PDFSPOOLID
      BTC_JOBNAME = JOBNAME
      BTC_JOBCOUNT = JOBCOUNT
      TABLES
      PDF = PDF
      EXCEPTIONS
      ERR_NO_OTF_SPOOLJOB = 1
      ERR_NO_SPOOLJOB = 2
      ERR_NO_PERMISSION = 3
      ERR_CONV_NOT_POSSIBLE = 4
      ERR_BAD_DSTDEVICE = 5
      USER_CANCELLED = 6
      ERR_SPOOLERROR = 7
      ERR_TEMSEERROR = 8
      ERR_BTCJOB_OPEN_FAILED = 9
      ERR_BTCJOB_SUBMIT_FAILED = 10
      ERR_BTCJOB_CLOSE_FAILED = 11.
      ELSE.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
      SRC_SPOOLID = SPOOLNO
      NO_DIALOG = ' '
      IMPORTING
      PDF_BYTECOUNT = NUMBYTES
      PDF_SPOOLID = PDFSPOOLID
      BTC_JOBNAME = JOBNAME
      BTC_JOBCOUNT = JOBCOUNT
      TABLES
      PDF = PDF
      EXCEPTIONS
      ERR_NO_ABAP_SPOOLJOB = 1
      ERR_NO_SPOOLJOB = 2
      ERR_NO_PERMISSION = 3
      ERR_CONV_NOT_POSSIBLE = 4
      ERR_BAD_DESTDEVICE = 5
      USER_CANCELLED = 6
      ERR_SPOOLERROR = 7
      ERR_TEMSEERROR = 8
      ERR_BTCJOB_OPEN_FAILED = 9
      ERR_BTCJOB_SUBMIT_FAILED = 10
      ERR_BTCJOB_CLOSE_FAILED = 11.
      ENDIF.
      * convert pdf to xstring string
      LOOP AT PDF INTO LS_PDF.
      ASSIGN LS_PDF TO CASTING.
      CONCATENATE LV_CONTENT INTO LV_CONTENT IN BYTE MODE.
      ENDLOOP.
      CALL SCREEN 100.
      ENDFUNCTION.
      Screen
      PBO –
      SET PF-STATUS 'STS'.
      SET TITLEBAR 'TTL'.
      CREATE OBJECT G_HTML_CONTAINER
      EXPORTING
      CONTAINER_NAME = 'CUSTOM_CNTL'.
      CREATE OBJECT G_HTML_CONTROL
      EXPORTING
      PARENT = G_HTML_CONTAINER.
      * Convert xstring to binary table to pass to the LOAD_DATA method
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
      BUFFER = LV_CONTENT
      TABLES
      BINARY_TAB = LT_DATA.
      * Load the HTML
      CALL METHOD G_HTML_CONTROL->LOAD_DATA(
      EXPORTING
      TYPE = 'application'
      SUBTYPE = 'pdf'
      IMPORTING
      ASSIGNED_URL = LV_URL
      CHANGING
      DATA_TABLE = LT_DATA
      EXCEPTIONS
      DP_INVALID_PARAMETER = 1
      DP_ERROR_GENERAL = 2
      CNTL_ERROR = 3
      OTHERS = 4 ).
      * Show it
      CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL IN_PLACE = 'X' ).
      PAI –
      CASE OKCODE.
      WHEN 'BACK'.
      LEAVE PROGRAM.
      WHEN 'EXIT'.
      LEAVE PROGRAM.
      WHEN 'CANCEL'.
      LEAVE PROGRAM.
      ENDCASE.


      15. Program To Find User Exit:
      *&---------------------------------------------------------------------*
      *& Report Z_FIND_EXIT
      *&
      *&---------------------------------------------------------------------*
      *&
      *&
      *&---------------------------------------------------------------------*
      REPORT Z_FIND_EXIT.
      tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
      tables : tstct.
      data : jtab like tadir occurs 0 with header line.
      data : field1(30).
      data : v_devclass like tadir-devclass.
      parameters : p_tcode like tstc-tcode obligatory.
      select single * from tstc where tcode eq p_tcode.
      if sy-subrc eq 0.
      select single * from tadir where pgmid = 'R3TR'
      and object = 'PROG'
      and obj_name = tstc-pgmna.
      move : tadir-devclass to v_devclass.
      if sy-subrc ne 0.
      select single * from trdir where name = tstc-pgmna.
      if trdir-subc eq 'F'.
      select single * from tfdir where pname = tstc-pgmna.
      select single * from enlfdir where funcname =
      tfdir-funcname.
      select single * from tadir where pgmid = 'R3TR'
      and object = 'FUGR'
      and obj_name eq enlfdir-area.
      move : tadir-devclass to v_devclass.
      endif.
      endif.
      select * from tadir into table jtab
      where pgmid = 'R3TR'
      and object = 'SMOD'
      and devclass = v_devclass.
      select single * from tstct where sprsl eq sy-langu and
      tcode eq p_tcode.
      format color col_positive intensified off.
      write:/(19) 'Transaction Code - ',
      20(20) p_tcode,
      45(50) tstct-ttext.
      skip.
      if not jtab[] is initial.
      write:/(95) sy-uline.
      format color col_heading intensified on.
      write:/1 sy-vline,
      2 'Exit Name',
      21 sy-vline ,
      22 'Description',
      95 sy-vline.
      write:/(95) sy-uline.
      loop at jtab.
      select single * from modsapt
      where sprsl = sy-langu and
      name = jtab-obj_name.
      format color col_normal intensified off.
      write:/1 sy-vline,
      2 jtab-obj_name hotspot on,
      21 sy-vline ,
      22 modsapt-modtext,
      95 sy-vline.
      endloop.
      write:/(95) sy-uline.
      describe table jtab.
      skip.
      format color col_total intensified on.
      write:/ 'No of Exits:' , sy-tfill.
      else.
      format color col_negative intensified on.
      write:/(95) 'No User Exit exists'.
      endif.
      else.
      format color col_negative intensified on.
      write:/(95) 'Transaction Code Does Not Exist'.
      endif.
      at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.
      *---End of Program

      16. Selection Option in Module Pool:
      *&---------------------------------------------------------------------*
      *& Report Z_PO_UPLOAD
      *&
      *&---------------------------------------------------------------------*
      *&
      *&
      *&---------------------------------------------------------------------*
      REPORT Z_PO_UPLOAD MESSAGE-ID zpoattach.
      TABLES : EKKO.
      DATA: BEGIN OF ITAB OCCURS 0,
      EBELN LIKE EKKO-EBELN,
      END OF ITAB .
      DATA : LT_FIELDS TYPE TABLE OF DFIES,
      LS_FIELD TYPE DFIES,
      FLG TYPE I VALUE 1,
      OK_CODE TYPE SY-UCOMM,
      ebeln TYPE ekko-ebeln.
      SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
      PARAMETERS : VPATH TYPE RLGRAP-FILENAME.
      SELECTION-SCREEN END OF SCREEN 400.
      AT SELECTION-SCREEN ON VALUE-REQUEST FOR VPATH.
      PERFORM F4_HELP_P_FILE_IT.
      START-OF-SELECTION.
      CALL SCREEN 100.
      INCLUDE Z_PO_UPLOAD_STATUS_0100O01.
      INCLUDE Z_PO_UPLOAD_USER_COMMAND_01I01.
      INCLUDE Z_PO_UPLOAD_VALIDATEI01.
      *&---------------------------------------------------------------------*
      *& Form F4_HELP_P_FILE_IT
      *&---------------------------------------------------------------------*
      * text
      *----------------------------------------------------------------------*
      * --> p1 text
      * <-- p2 text
      *----------------------------------------------------------------------*
      FORM F4_HELP_P_FILE_IT .
      DATA : V_FILE LIKE VPATH.
      CALL FUNCTION 'F4_FILENAME'
      IMPORTING
      FILE_NAME = V_FILE.
      CHECK SY-SUBRC EQ 0.
      VPATH = V_FILE.
      ENDFORM. " F4_HELP_P_FILE_IT
      INCLUDE Z_PO_UPLOAD_RENAME_FILEF01.
      INCLUDE Z_PO_UPLOAD_COPYF01.

      17. Service PO Using BAPI:
      DATA : I_POHDR TYPE STANDARD TABLE OF BAPIMEPOHEADER WITH HEADER LINE,
      I_POHDRX TYPE STANDARD TABLE OF BAPIMEPOHEADERX WITH HEADER LINE,
      I_POITM TYPE STANDARD TABLE OF BAPIMEPOITEM WITH HEADER LINE,
      I_POITMX TYPE STANDARD TABLE OF BAPIMEPOITEMX WITH HEADER LINE,
      I_POSERVICE TYPE STANDARD TABLE OF BAPIESLLC WITH HEADER LINE,
      I_POACCOUNT TYPE STANDARD TABLE OF BAPIMEPOACCOUNT WITH HEADER LINE,
      I_POACCOUNTX TYPE STANDARD TABLE OF BAPIMEPOACCOUNTX WITH HEADER LINE,
      I_POSERVICEV TYPE STANDARD TABLE OF BAPIESKLC WITH HEADER LINE.
      DATA : PONO TYPE BAPIMEPOHEADER-PO_NUMBER,
      PCKG_NO TYPE BAPIMEPOITEM-PCKG_NO.
      REFRESH: I_POHDR[],I_POHDRX[],I_POITM[],I_POITMX[],I_POSERVICE[],
      I_POSERVICEV[],I_POACCOUNT[],I_POACCOUNTX[].
      CLEAR : ICNT,I_POHDR,I_POITM,I_POHDRX,I_POITMX,I_POSERVICE,I_POSERVICEV,
      I_POACCOUNT,I_POACCOUNTX.
      *--------Header data
      I_POHDR-COMP_CODE = 4000. "VBUKRS.
      I_POHDR-DOC_TYPE = 'ZLAB'.
      I_POHDR-ITEM_INTVL = '00010'.
      I_POHDR-VENDOR = LFA1-LIFNR.
      I_POHDR-PMNTTRMS = 'D060'. "EKKO-ZTERM.
      I_POHDR-PURCH_ORG = 4130. "VEKORG.
      I_POHDR-PUR_GROUP = 100. " VEKGRP.
      I_POHDR-CURRENCY = 'HKD'. "EKKO-WAERS.
      I_POHDR-DOC_DATE = PDATE.
      APPEND I_POHDR.
      I_POHDRX-COMP_CODE = 'X'.
      I_POHDRX-DOC_TYPE = 'X'.
      I_POHDRX-ITEM_INTVL = 'X'.
      I_POHDRX-VENDOR = 'X'.
      I_POHDRX-PMNTTRMS = 'X'.
      I_POHDRX-PURCH_ORG = 'X'.
      I_POHDRX-PUR_GROUP = 'X'.
      I_POHDRX-CURRENCY = 'X'.
      I_POHDRX-DOC_DATE = 'X'.
      APPEND I_POHDRX.
      *--------Line data
      LOOP AT IT_OUT1 INTO WA_OUT.
      ICNT = ICNT + 1.
      PCKG_NO = PCKG_NO + 1.
      I_POITM-PO_ITEM = ICNT * 10.
      I_POITM-PCKG_NO = PCKG_NO.
      I_POITM-ACCTASSCAT = 'K'.
      I_POITM-ITEM_CAT = 'D'.
      I_POITM-SHORT_TEXT = WA_OUT-CHARG.
      I_POITM-PLANT = WA_OUT-WERKS.
      I_POITM-BATCH = WA_OUT-CHARG.
      I_POITM-STGE_LOC = WA_OUT-LGORT.
      I_POITM-QUANTITY = WA_OUT-CLABS.
      I_POITM-MATL_GROUP = 'D11'.
      APPEND I_POITM.
      CLEAR :I_POITM.
      I_POITMX-PO_ITEM = ICNT * 10.
      I_POITMX-PCKG_NO = 'X'.
      I_POITMX-ACCTASSCAT = 'X'.
      I_POITMX-ITEM_CAT = 'X'.
      I_POITMX-SHORT_TEXT = 'X'.
      I_POITMX-PLANT = 'X'.
      I_POITMX-BATCH = 'X'.
      I_POITMX-STGE_LOC = 'X'.
      I_POITMX-QUANTITY = 'X'.
      I_POITMX-MATL_GROUP = 'X'.
      APPEND I_POITMX.
      CLEAR :I_POITMX.
      I_POSERVICE-PCKG_NO = PCKG_NO.
      I_POSERVICE-LINE_NO = '0000000001'.
      I_POSERVICE-OUTL_IND = 'X'.
      I_POSERVICE-SUBPCKG_NO = PCKG_NO + 1.
      I_POSERVICE-FROM_LINE = '1'.
      APPEND I_POSERVICE.
      CLEAR I_POSERVICE.
      PCKG_NO = PCKG_NO + 1.
      I_POSERVICE-PCKG_NO = PCKG_NO.
      I_POSERVICE-LINE_NO = '0000000002'.
      I_POSERVICE-SERVICE = '000000000003000000'.
      I_POSERVICE-QUANTITY = WA_OUT-CLABS.
      I_POSERVICE-BASE_UOM = 'AU'.
      I_POSERVICE-PRICE_UNIT = '1'.
      I_POSERVICE-GR_PRICE = 1000."ZMCHA_S-TOT_PRICE.
      I_POSERVICE-MATL_GROUP = 'POLISH'.
      APPEND I_POSERVICE.
      CLEAR I_POSERVICE.
      I_POSERVICEV-PCKG_NO = PCKG_NO.
      I_POSERVICEV-LINE_NO = '0000000002'.
      I_POSERVICEV-SERNO_LINE = '01'.
      I_POSERVICEV-SERIAL_NO = '01'.
      I_POSERVICEV-QUANTITY = WA_OUT-CLABS.
      APPEND I_POSERVICEV.
      I_POACCOUNT-PO_ITEM = ICNT * 10.
      I_POACCOUNT-SERIAL_NO = '01'.
      I_POACCOUNT-QUANTITY = WA_OUT-CLABS.
      I_POACCOUNT-GL_ACCOUNT = '0000800101'.
      I_POACCOUNT-COSTCENTER = '0041304001'.
      I_POACCOUNT-CO_AREA = 4000.
      I_POACCOUNT-NET_VALUE = 1000.
      APPEND I_POACCOUNT.
      I_POACCOUNTX-PO_ITEM = ICNT * 10.
      I_POACCOUNTX-SERIAL_NO = '01'.
      I_POACCOUNTX-QUANTITY = 'X'.
      I_POACCOUNTX-GL_ACCOUNT = 'X'.
      I_POACCOUNTX-COSTCENTER = 'X'.
      I_POACCOUNTX-CO_AREA = 'X'.
      I_POACCOUNTX-NET_VALUE = 'X'.
      APPEND I_POACCOUNTX.
      ENDLOOP.
      CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
      POHEADER = I_POHDR
      POHEADERX = I_POHDRX
      IMPORTING
      EXPPURCHASEORDER = PONO
      TABLES
      RETURN = GT_RETURN
      POITEM = I_POITM
      POITEMX = I_POITMX
      POACCOUNT = I_POACCOUNT
      POACCOUNTX = I_POACCOUNTX
      POSERVICES = I_POSERVICE
      POSRVACCESSVALUES = I_POSERVICEV.
      READ TABLE GT_RETURN WITH KEY TYPE = 'E'.
      IF SY-SUBRC = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      CALL SCREEN 101 STARTING AT '15' '3'.
      MESSAGE ID 'ZGRN' TYPE 'E' NUMBER 001 .
      ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
      WAIT = 'X'.
      CLEAR TEXT2.
      CONCATENATE 'Document no.' GOODSMVT_HEADRET-MAT_DOC 'and PO no.' PONO
      INTO TEXT2 SEPARATED BY SPACE.
      MESSAGE S000 WITH TEXT2.
      PERFORM UPDATE_TABLE1 .
      LEAVE TO SCREEN 0.
      ENDIF.

      18. New Tab in PO Using BADI:
      Implement BADI (ME_GUI_PO_CUST & ME_PROCESS_PO_CUST) For Adding New Tab In PO Creation
      (ME21N)
      BADI ‐ ME_GUI_PO_CUST ‐>
      Subscribe Method ‐> (Create subscreen)
      method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
      data : i_subscribers like line of re_subscribers.
      check im_application = 'PO'.
      check im_element = 'HEADER'.
      clear : re_subscribers[].
      i_subscribers-name = subscreen1.
      i_subscribers-DYNPRO = '0100'.
      i_subscribers-program = 'SAPLZPOHDR'. (i.e. SAPL + ZPOHDR(function group))
      i_subscribers-STRUCT_NAME = 'CI_EKKODB'.
      i_subscribers-label = text-001.
      i_subscribers-POSITION = 5.
      i_subscribers-HEIGHT = 7.
      append i_subscribers to re_subscribers.
      endmethod.


      MAP_DYNPRO_FIELDS Method‐> (Create Field Catalog)
      method IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS.
      field-symbols : like line of ch_mapping.
      LOOP AT ch_mapping assigning .
      IF -fieldname = 'ZCUSTNAME'.
      -metafield = mmmfd_cust_01.
      elseif -fieldname = 'ZCUSTADR'.
      -metafield = mmmfd_cust_02.
      ENDIF.
      ENDLOOP.
      endmethod.
      TRANSPORT_FROM_MODEL Method‐>(Get Data From Table EKKO)


      TRANSPORT_FROM_MODEL Method‐>(Get Data From Table EKKO)
      method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL.
      DATA: l_header TYPE REF TO if_purchase_order_mm,
      ls_mepoheader TYPE mepoheader.
      check im_name = subscreen1.
      mmpur_dynamic_cast l_header im_model.
      check not l_header is initial.

      ls_mepoheader = l_header->get_data( ).
      move-corresponding ls_mepoheader to DYNP_DATA_PBO.
      endmethod.
      TRANSPORT_TO_DYNP Method‐> (Pass Data To Display Screen)
      method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP.
      check im_name = subscreen1.
      CALL FUNCTION 'ZPOHDR_MOVE_TO_SCREEN'
      EXPORTING
      DYNP_DATA_PBO = DYNP_DATA_PBO.
      endmethod.
      TRANSPORT_FROM_DYNP Method‐>(Fetch Data From Screen After Change or Containing same Value)
      method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP.
      check im_name = subscreen1.
      CALL FUNCTION 'ZPOHDR_FETCH_FROM_SCREEN'
      IMPORTING
      DYNP_DATA_PAI = DYNP_DATA_PAI.
      if DYNP_DATA_PAI ne DYNP_DATA_PBO.
      re_changed = 'X'.
      endif.
      endmethod


      TRANSPORT_TO_MODEL Method‐> (Save Data To
      Database)
      method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL.
      DATA: l_header TYPE REF TO if_purchase_order_mm,
      ls_mepoheader TYPE mepoheader.
      check im_name = subscreen1.
      mmpur_dynamic_cast l_header im_model.
      check not l_header is initial.
      ls_mepoheader = l_header->get_data( ).
      if DYNP_DATA_PAI ne DYNP_DATA_PBO.
      move-corresponding DYNP_DATA_PAI to ls_mepoheader.
      CALL METHOD l_header->set_data
      EXPORTING
      im_data = ls_mepoheader.
      endif.





      BADI ‐ ME_PROCESS_PO_CUST ‐>
      FIELDSELECTION_HEADER Method‐>
      method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.
      FIELD-SYMBOLS: LIKE LINE OF CH_FIELDSELECTION.
      if sy-tcode ='ME21N' OR sy-tcode ='ME22N'.
      READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
      MFD_CUST_01.
      IF SY-SUBRC IS INITIAL.
      -FIELDSTATUS = '.'. " change
      ENDIF.
      READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
      MFD_CUST_02.
      IF SY-SUBRC IS INITIAL.
      -FIELDSTATUS = '.'. " change
      ENDIF.
      else.
      READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
      MFD_CUST_01.
      IF SY-SUBRC IS INITIAL.
      -FIELDSTATUS = '*'. " display
      ENDIF.
      READ TABLE CH_FIELDSELECTION ASSIGNING WITH TABLE KEY METAFIELD = MM
      MFD_CUST_02.
      IF SY-SUBRC IS INITIAL.
      -FIELDSTATUS = '*'. " display
      ENDIF.
      ENDIF.
      endmethod.








      1. Classical Report:
      Classical reports are basically used for developing a such kind of reports which is used on daily Basis.
      Some important factors of classical reports is as follows:-

      a. AT Line Selection:

      DATA : BEGIN OF itab OCCURS 0.
      INCLUDE STRUCTURE zqmrr.
      DATA: END OF itab.
      START-OF-SELECTION.
      SELECT * INTO TABLE itab FROM zqmrr.
      LOOP AT itab.
      WRITE :/10 itab-werks,
      15 itab-mkmnr,
      25 itab-charg.
      ENDLOOP.
      AT LINE-SELECTION.
      WRITE:/ 'Rajasthan Textile Mills Bhawanimandi'.
      TOP-OF-PAGE DURING LINE-SELECTION.
      WRITE:/'hi'.

      b. AT User Command:
      At use command also can be acomplish by two way. First, Perform any action by Clicking any
      button(PF Status), Second Leaving Screen.
      I
      START-OF-SELECTION.
      SET PF-STATUS 'MYLIST'. // MYLIST is the GUI Status(PF Status)
      WRITE 'List line'.
      AT USER-COMMAND.
      CASE sy-ucomm.
      WHEN 'SAV'.
      WRITE: / 'You worked on list', sy-listi,
      / 'You are on list', sy-lsind.
      ENDCASE.
      II
      form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
      read table i_vbap index rs_selfield-tabindex.
      if sy-subrc = 0.
      set parameter id 'AUN' field i_vbap-vbeln.
      call transaction 'VA03'." and skip first screen.
      endif.
      endform.
      Note:in second method we have to add this user command in REUSE_ALV_GRID_DISPLAY as follows -
      i_callback_user_command = 'USER_COMMAND'

      c. F4 Key Press:
      This is used for display help at selection screen i.e.when we pressed F4 key to display value at
      selection screen.

      at selection-screen on value-request for s_docno-low.
      select trntyp
      docno
      from j_1iexchdr
      into table i_are
      where trntyp eq 'ARE1'.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
      exporting
      retfield = 'DOCNO'
      dynpprog = v_repid
      dynpnr = v_dynnr
      dynprofield = 'S_DOCNO-LOW'
      window_title = 'F4 Help For the ARE1 Document'
      value_org = 'S'
      tables
      value_tab = i_are.
      if sy-subrc <> 0.
      endif.

      d. Convert Output to PDF:
      This can be done in two different ways-
      I-Saving Output without dialog box:
      data : gs_print_parms type pri_params,
      l_valid type string,
      gs_tsp01 type tsp01,
      gv_rq2name type tsp01-rq2name.
      concatenate sy-repid+0(9) sy-uname+0(3) into gv_rq2name.
      call function 'GET_PRINT_PARAMETERS'
      exporting
      destination = 'LP02'
      layout = 'X_65_132'
      line_size = '132'
      no_dialog = 'X'
      importing
      out_parameters = gs_print_parms
      valid = l_valid
      exceptions
      archive_info_not_found = 1
      invalid_print_params = 2
      invalid_archive_params = 3
      others = 4.
      if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      gs_print_parms-primm = ' '.
      gs_print_parms-prcop = '1'.
      submit y_chk_pmt_advs with pzbukr = pzbukr
      with pgjahr = pgjahr
      with phbkid = phbkid
      with phktid = phktid
      with pchecf in pchecf
      with pvblnr in pvblnr
      with ppridt in ppridt
      with pzaldt in pzaldt
      with opt2 = opt2
      with opt1 = space
      with opt3 = space
      with opt4 = space
      with opt5 = space
      to sap-spool without spool dynpro
      spool parameters gs_print_parms
      and return.
      select single *
      from tsp01
      into gs_tsp01
      where rq2name eq gv_rq2name
      and rqowner eq sy-uname.
      "ORDER BY rqcretime ASCENDING.
      if sy-subrc eq 0.
      submit rstxpdft4 with spoolno eq gs_tsp01-rqident
      with p_file eq 'CHKLST.PDF'
      and return.
      endif.
      delete from tsp01
      where rqident = gs_tsp01-rqident and
      rq2name eq gv_rq2name.
      exit.
      II-Display Output on screen:
      data : gs_print_parms type pri_params,
      l_valid type string,
      gs_tsp01 type tsp01,
      gv_rq2name type tsp01-rq2name.
      CONCATENATE sy-repid+0(9) sy-uname+0(3) INTO gv_rq2name.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
      destination = 'LP02'
      layout = 'X_65_80'
      line_size = '80'
      no_dialog = 'X'
      IMPORTING
      out_parameters = gs_print_parms
      valid = l_valid
      EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params = 2
      invalid_archive_params = 3
      OTHERS = 4.
      IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      gs_print_parms-primm = ' '.
      gs_print_parms-prcop = '1'.

      SUBMIT y_qm_lot_test WITH vwerk IN vwerk
      WITH vcharg IN vcharg
      WITH verste IN verste
      TO SAP-SPOOL WITHOUT SPOOL DYNPRO
      SPOOL PARAMETERS gs_print_parms
      AND RETURN.
      SELECT SINGLE *
      FROM tsp01
      INTO gs_tsp01
      WHERE rq2name EQ gv_rq2name
      AND rqowner EQ sy-uname.
      IF sy-subrc EQ 0.
      CALL FUNCTION 'Z_FM_PDF_DATADISPLAY'
      EXPORTING
      spool = gs_tsp01-rqident
      delete = 'X'.
      DELETE tsp01 FROM gs_tsp01.
      COMMIT WORK AND WAIT.
      ENDIF.
      DELETE FROM tsp01
      WHERE rqident EQ gs_tsp01-rqident AND
      rq2name EQ gv_rq2name.
      EXIT.
      e. Color Printing:
      For printing color use following syntax:
      FORMAT COLOR 3

      2. ALV Report:
      ALV report is basically used for display data in grid form. This is more flexible report type in which
      user can re-arrange, sort or hide the coloumn. Main function used in grid is as follows-
      a. Declaring Data:
      data: rptname like sy-repid,
      w_shift type i.
      type-pools: slis.
      data: fcat type table of slis_fieldcat_alv with non-unique default key
      with header line initial size 0,
      layout type slis_layout_alv,
      fevents type table of slis_alv_event with non-unique default key
      with header line initial size 0,
      fheader type table of slis_listheader with non-unique default key
      with header line initial size 0,
      fexclude type table of slis_extab with non-unique default key
      with header line initial size 0,
      gt_sort type slis_t_sortinfo_alv.
      data : alv_variant like disvariant.
      b. Progress Indicator:
      call function 'SAPGUI_PROGRESS_INDICATOR'
      exporting
      text = 'Hi this is durgesh'.
      c.Display Variant:
      data : alv_variant like disvariant.
      parameter : variant type disvariant-variant.
      at selection-screen on value-request for variant.
      alv_variant-report = sy-repid.
      call function 'REUSE_ALV_VARIANT_F4'
      exporting
      is_variant = alv_variant
      i_save = 'A'
      importing
      es_variant = alv_variant
      exceptions
      not_found = 2.
      if sy-subrc = 2.
      message id sy-msgid type 'S' number sy-msgno
      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
      variant = alv_variant-variant.
      endif.
      Note:
      1.Below statement will write just above Display Function-
      alv_variant-report = rptname.
      alv_variant-variant = variant.
      2.Add Following line in display function-
      is_variant = alv_variant
      3.i_save = 'A' for user specific
      i_save = 'X' for Not user specific i.e. default
      i_save = 'U' for Not user specific i.e. default
      d. Page Heading:
      form topofpage.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
      exporting
      it_list_commentary = fheader[].
      * I_LOGO =
      * I_END_OF_LIST_GRID =
      endform. "TOPOFPAGE
      fheader-typ = 'H'.
      fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
      append fheader.
      clear fheader.
      * To show in Italic Style
      fheader-typ = 'A' .
      fheader-info = 'Pachpahar Road'.
      append fheader.
      clear fheader.
      * To Show in small character
      * Info is Char 60 Colunm
      * typ is Char 1 Column
      fheader-typ = 'S'.
      fheader-info = ' List of Sale Orders for Testing in ALV Report'.
      append fheader.
      clear fheader.
      fheader-typ = 'S'.
      data : trptdt(10) type c.
      data : xdt type string.
      write : sy-datum to trptdt.
      concatenate 'Report run date : ' trptdt into xdt separated by space.
      fheader-typ = 'S'.
      fheader-info = xdt.
      append fheader.
      clear fheader.
      call function 'REUSE_ALV_EVENTS_GET'
      exporting
      i_list_type = 0
      importing
      et_events = fevents[]
      exceptions
      list_type_wrong = 1
      others = 2.
      read table fevents with key name = 'TOP_OF_PAGE'.
      if sy-subrc = 0.
      fevents-form = 'TOPOFPAGE'.
      modify fevents index sy-tabix.
      clear fevents.
      endif.
      e. Display Layout:
      Data :layout type slis_layout_alv.
      layout-zebra = 'X'.
      layout-no_vline = 'X'."Vertical Lines between columns will not shown
      layout-no_hline = 'X'."Horizontal Lines between columns will not shown
      layout-edit = 'X'. "Columns can be edit in Grid at run time
      layout-no_colhead = 'X'. "Columns Heading will not be shown
      In Display function add following lines-
      is_layout = layout
      f. Field Catalog:
      fcat-fieldname = 'VBELN'."Field name of Final Table
      fcat-outputlen = 11. " Size of Field in Grid
      fcat-seltext_s = 'Sales '." For Name of Colunm in Grid
      fcat-seltext_m = 'Sales Order No'.
      fcat-seltext_l = 'Sales Order No'. " For Tool Tip
      fcat-no_zero = 'X'."All Zero in start of Sales Order Number wll be suppressed
      fcat-checkbox = 'X'. "Field will be shown as Checkboxx
      fcat-no_out = 'X'. "This field will not be show but
      "can be select from select layout
      fcat-input = 'X'. "Not Clear
      fcat-icon = 'X'. "Not Clear
      fcat-ddictxt = 'M'. "M= fcat-seltext_m, S=fcat-seltext_s,
      "L=fcat-seltext_l
      fcat-inttype = 'C'. "Alignment N for Right C For Left
      fcat-key = 'X'. "Fix the Column.(Col.will not drag
      fcat-datatype = 'CHAR'. "Type of field in table
      fcat-emphasize = 'C200'. "For Show in Color
      fcat-do_sum = 'X'. "will display sum of this column
      g. Display Function:
      call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
      i_callback_program = rptname "program name
      i_callback_user_command = 'USER_COMMAND'
      i_callback_pf_status_set = 'X'"'SM04_SET_STATUS'
      "disable menubar
      is_layout = layout"for promt message to leave scrren
      it_fieldcat = fcat[]"field catalog
      it_excluding = fexclude[]"remove icon from toolbar
      it_sort = gt_sort[]
      i_default = 'X'
      i_save = 'A'"user specific
      is_variant = alv_variant" variant of grid
      i_grid_title = 'DURGESH' "Display Title of grid
      it_events = fevents[]"top of page
      tables
      t_outtab = i_vbap[]"final table name
      exceptions
      program_error = 1
      others = 2.
      h. Field Catalog Function:
      FORM build_field_catalog .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
      i_program_name = sy-repid
      i_internal_tabname = 'I_FINAL'
      i_inclname = sy-repid
      CHANGING
      ct_fieldcat = fcat[]
      EXCEPTIONS
      inconsistent_interface = 1
      program_error = 2
      OTHERS = 3.
      IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      fheader-typ = 'H'.
      fheader-info = 'RAJASTHAN TEXTILE MILLS, BHAWANIMANDI'.
      APPEND fheader.
      CLEAR fheader.
      fheader-typ = 'A' .
      fheader-info = 'Pachpahar Road'.
      APPEND fheader.
      CLEAR fheader.
      fheader-typ = 'S'.
      fheader-info = ' List of Customer for Testing of ALV Report'.
      APPEND fheader.
      CLEAR fheader.
      fheader-typ = 'S'.
      DATA : trptdt(10) TYPE c.
      DATA : xdt TYPE string.
      WRITE : sy-datum TO trptdt.
      CONCATENATE 'Report run date : ' trptdt INTO xdt SEPARATED BY space.
      fheader-typ = 'S'.
      fheader-info = xdt.
      APPEND fheader.
      CLEAR fheader.
      fexclude-fcode = '&ABC'.
      append fexclude.
      clear fexclude.
      ENDFORM.
      i. Remove icon from toolbar:
      To remove icons from toolbar add following lines at end of field catalog. i.e just above ENDFORM of
      field catalog.
      fexclude-fcode = '&ABC'.
      append fexclude.
      clear fexclude.
      NOTE: if we have to remove icon from toolbar, then write above code and add following lines in
      DISPLAY FUNCTION
      it_excluding = fexclude[]

      3. Smart Forms:
      Smart forms is basically used for much attractive report.
      TABLES : bkpf, bseg.
      DATA: fm_name TYPE rs38l_fnam.
      DATA : BEGIN OF itab OCCURS 0,
      bukrs TYPE bkpf-bukrs,"company code
      gjahr TYPE bkpf-gjahr," Fisical year
      budat TYPE bkpf-budat," Posting date
      belnr TYPE bkpf-belnr." Document No.
      DATA : END OF itab.
      DATA : tbudt1 TYPE bkpf-budat.
      DATA : tbudt2 TYPE bkpf-budat.
      SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-t01.
      SELECT-OPTIONS:
      pbukrs FOR bkpf-bukrs NO INTERVALS NO-EXTENSION
      OBLIGATORY DEFAULT '1000',
      pgjahr FOR bkpf-gjahr NO INTERVALS NO-EXTENSION
      OBLIGATORY DEFAULT sy-datum,
      pbudat FOR bkpf-budat DEFAULT sy-datum to sy-datum.
      SELECTION-SCREEN END OF BLOCK blk.

      INITIALIZATION.
      IF pbudat-high IS INITIAL.
      pbudat-high = pbudat-low.
      ENDIF.

      START-OF-SELECTION.
      SELECT bukrs
      gjahr
      budat
      belnr
      INTO TABLE itab
      FROM bkpf
      WHERE bukrs IN pbukrs AND
      gjahr IN pgjahr AND
      budat IN pbudat.
      IF itab[] IS INITIAL.
      MESSAGE 'No Data Found...' TYPE 'S'.
      ELSE.
      CLEAR : itab[].
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
      formname = 'Y_SMART' "smart form name
      IMPORTING
      fm_name = fm_name.

      CALL FUNCTION fm_name
      EXPORTING
      "smart form field driver program field
      vbukrs = pbukrs-low
      vgjahr = pgjahr-low
      vbudat1 = pbudat-low
      vbudat2 = pbudat-high.
      ENDIF.
      Note:
      if we have to export table from driver program to smartforms, then do following steps-
      1.Define structure for table in driver program that has to be exported in smartforms.

      DATA : BEGIN OF i_final OCCURS 0.
      INCLUDE STRUCTURE zqmrr.
      DATA : END OF i_final.

      2.We have to export i_final table, so we have define structure for it. If we will define table then it will
      generate error.

      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
      formname = 'Y_SMT'
      IMPORTING
      fm_name = fm_name.
      CALL FUNCTION fm_name
      EXPORTING
      swerks = vwerks-low == variable exporting
      TABLES
      ifinal = i_final[]. == Table exporting

      Now go to forminterface tables tab abd define exported internal table.

      PDF Conversion of Smartforms:

      tables : zqmrr.
      data : begin of i_tab occurs 0,
      werks type zqmrr-werks,
      erdat type zqmrr-erdat,
      charg type zqmrr-charg,
      mkmnr type zqmrr-mkmnr,
      sumplus type zqmrr-sumplus,
      prueflos type zqmrr-prueflos.
      data : end of i_tab.
      data: fm_name type rs38l_fnam.
      data: wa_ctrlop type ssfctrlop,
      wa_outopt type ssfcompop.
      data: t_otfdata type ssfcrescl,
      t_pdf_tab like tline occurs 0 with header line.
      data: t_otf type itcoo occurs 0 with header line.
      data: w_filesize type string.
      data: w_bin_filesize type i.
      selection-screen begin of block blk01 with frame title text-001.
      parameters :
      vwerks type zqmrr-werks obligatory,
      verdat type zqmrr-erdat obligatory default sy-datum.
      selection-screen end of block blk01.
      selection-screen begin of block blk02 with frame title text-002.
      parameters :
      r1 as checkbox.
      selection-screen end of block blk02.
      start-of-selection.
      select werks
      erdat
      charg
      mkmnr
      sumplus
      prueflos
      from zqmrr
      into table i_tab
      where werks eq vwerks and
      erdat eq verdat.
      if sy-subrc ne 0.
      message 'No Record Found' type 'S'.
      exit.
      else.
      if r1 ne 'X'.
      call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
      formname = 'Y_QM_DAILY_RPT1'
      importing
      fm_name = fm_name
      exceptions
      no_form = 1
      no_function_module = 2
      others = 3.
      call function fm_name
      exporting
      swerks = vwerks
      serdat = verdat.
      else.
      call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
      formname = 'Y_QM_DAILY_RPT'
      importing
      fm_name = fm_name
      exceptions
      no_form = 1
      no_function_module = 2
      others = 3.
      wa_ctrlop-getotf = 'X'.
      wa_ctrlop-no_dialog = 'X'.
      wa_outopt-tdnoprev = 'X'.
      call function fm_name
      exporting
      swerks = vwerks
      serdat = verdat
      control_parameters = wa_ctrlop
      output_options = wa_outopt
      user_settings = 'X'
      importing
      job_output_info = t_otfdata
      exceptions
      formatting_error = 1
      internal_error = 2
      send_error = 3
      user_canceled = 4
      others = 5.

      t_otf[] = t_otfdata-otfdata[].
      call function 'CONVERT_OTF'
      exporting
      format = 'PDF'
      max_linewidth = 132
      importing
      bin_filesize = w_bin_filesize
      tables
      otf = t_otf
      lines = t_pdf_tab
      exceptions
      err_max_linewidth = 1
      err_format = 2
      err_conv_not_possible = 3
      others = 4.
      call function 'WS_DOWNLOAD'
      exporting
      bin_filesize = w_bin_filesize
      filename = 'D:\sqc_rpt.PDF'
      filetype = 'BIN'
      importing
      filelength = w_filesize
      tables
      data_tab = t_pdf_tab
      exceptions
      file_open_error = 1
      file_write_error = 2
      invalid_filesize = 3
      invalid_type = 4
      no_batch = 5
      unknown_error = 6
      invalid_table_width = 7
      gui_refuse_filetransfer = 8
      customer_error = 9
      others = 10.
      if sy-subrc <> 0.
      message 'Report has not been saved succesully.' type 'S'.
      else.
      message 'Report has been saved in D drive succesully.' type 'S'.
      endif.
      endif.
      endif.

      4. Hierarchical Report:

      Hierarchical Report is used for diaplay report in tree format.
      DATA : node_tab LIKE snodetext OCCURS 0 WITH HEADER LINE.
      DATA : BEGIN OF i_qals OCCURS 0,
      prueflos TYPE qals-prueflos,
      werk TYPE qals-werk,
      enstehdat TYPE qals-enstehdat,
      selmatnr TYPE qals-selmatnr,
      charg TYPE qals-charg,
      ktextmat TYPE qals-ktextmat.
      DATA : END OF i_qals.
      CLEAR : node_tab, node_tab[].
      SELECT prueflos
      werk
      enstehdat
      selmatnr
      charg
      ktextmat
      INTO TABLE i_qals FROM qals UP TO 40 ROWS WHERE selmatnr NE '' AND charg NE ''.
      node_tab-type = 'T'.
      node_tab-name = 'Lot Description'.
      node_tab-tlevel = '01'.
      node_tab-nlength = '15'.
      APPEND node_tab.
      CLEAR node_tab.

      LOOP AT i_qals.
      node_tab-type = 'P'.
      node_tab-name = i_qals-prueflos.
      node_tab-tlevel = '02'.
      node_tab-nlength = '15'.
      APPEND node_tab.
      CLEAR node_tab.

      node_tab-type = 'P'.
      node_tab-name = i_qals-werk.
      node_tab-tlevel = '03'.
      node_tab-nlength = '06'.
      APPEND node_tab.
      CLEAR node_tab.

      node_tab-type = 'P'.
      node_tab-name = i_qals-enstehdat.
      node_tab-tlevel = '04'.
      node_tab-nlength = '10'.
      APPEND node_tab.
      CLEAR node_tab.

      node_tab-type = 'P'.
      node_tab-name = i_qals-selmatnr.
      node_tab-tlevel = '05'.
      node_tab-nlength = '10'.
      APPEND node_tab.
      CLEAR node_tab.


      node_tab-type = 'P'.
      node_tab-name = i_qals-charg.
      node_tab-tlevel = '06'.
      node_tab-nlength = '08'.
      APPEND node_tab.
      CLEAR node_tab.

      node_tab-type = 'P'.
      node_tab-name = i_qals-ktextmat.
      node_tab-tlevel = '07'.
      node_tab-nlength = '30'.
      APPEND node_tab.
      CLEAR node_tab.
      ENDLOOP.

      *node_tab-type = 'T'. "Node type
      *node_tab-name = 'Earth'. "Object name
      *node_tab-tlevel = '01'. "Node level
      *node_tab-nlength = '5'. "Output length of a hierarchy node
      *node_tab-color = '4'. "Color display of a hierarchy node
      *node_tab-text = 'Hello'. "Text/Icon/Symbol
      *node_tab-tlength ='5'. "Output length of a hierarchy node
      *node_tab-tcolor = 3. "Color display of a hierarchy node
      *APPEND node_tab.
      *CLEAR node_tab.
      *
      *node_tab-type = 'P'.
      *node_tab-name = 'Europe'.
      *node_tab-tlevel = '02'.
      *node_tab-nlength = '6'.
      *node_tab-color = '1'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 4.
      *APPEND node_tab.
      *CLEAR node_tab.

      *node_tab-type = 'P'.
      *node_tab-name = 'Germany'.
      *node_tab-tlevel = '03'.
      *node_tab-nlength = '7'.
      *node_tab-color = '4'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 4.
      *APPEND node_tab.
      *CLEAR node_tab.
      *
      *node_tab-type = 'P'.
      *node_tab-name = 'Berlin'.
      *node_tab-tlevel = '04'.
      *node_tab-nlength = '6'.
      *node_tab-color = '4'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 3.
      *APPEND node_tab.
      *CLEAR node_tab.
      *
      *node_tab-type = 'P'.
      *node_tab-name = 'Asia'.
      *node_tab-tlevel = '02'.
      *node_tab-nlength = '4'.
      *node_tab-color = '1'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 3.
      *APPEND node_tab.
      *CLEAR node_tab.
      *
      *node_tab-type = 'P'.
      *node_tab-name = 'India'.
      *node_tab-tlevel = '03'.
      *node_tab-nlength = '5'.
      *node_tab-color = '1'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 3.
      *APPEND node_tab.
      *CLEAR node_tab.
      *
      *node_tab-type = 'P'.
      *node_tab-name = 'Bombay'.
      *node_tab-tlevel = '04'.
      *node_tab-nlength = '6'.
      *node_tab-color = '1'.
      *node_tab-text = 'Hello'.
      *node_tab-tlength ='5'.
      *node_tab-tcolor = 3.
      *APPEND node_tab.
      *CLEAR node_tab.

      CALL FUNCTION 'RS_TREE_CONSTRUCT'
      TABLES
      nodetab = node_tab.

      CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
      EXPORTING
      use_control = 'L'.

      "},"eligible_for_exclusive_trial_roadblock":false,"eligible_for_seo_roadblock":false,"exclusive_free_trial_roadblock_props_path":"/doc-page/exclusive-free-trial-props/240764024","flashes":[],"footer_props":{"urls":{"about":"/about","press":"/press","blog":"http://literally.scribd.com/","careers":"/careers","contact":"/contact","plans_landing":"/subscribe","referrals":"/referrals?source=footer","giftcards":"/giftcards","faq":"/faq","accessibility":"/accessibility-policy","faq_paths":{"accounts":"https://support.scribd.com/hc/sections/202246346","announcements":"https://support.scribd.com/hc/sections/202246066","copyright":"https://support.scribd.com/hc/sections/202246086","downloading":"https://support.scribd.com/hc/articles/210135046","publishing":"https://support.scribd.com/hc/sections/202246366","reading":"https://support.scribd.com/hc/sections/202246406","selling":"https://support.scribd.com/hc/sections/202246326","store":"https://support.scribd.com/hc/sections/202246306","status":"https://support.scribd.com/hc/en-us/articles/360001202872","terms":"https://support.scribd.com/hc/sections/202246126","writing":"https://support.scribd.com/hc/sections/202246366","adchoices":"https://support.scribd.com/hc/articles/210129366","paid_features":"https://support.scribd.com/hc/sections/202246306","failed_uploads":"https://support.scribd.com/hc/en-us/articles/210134586-Troubleshooting-uploads-and-conversions","copyright_infringement":"https://support.scribd.com/hc/en-us/articles/210128946-DMCA-copyright-infringement-takedown-notification-policy","end_user_license":"https://support.scribd.com/hc/en-us/articles/210129486","terms_of_use":"https://support.scribd.com/hc/en-us/articles/210129326-General-Terms-of-Use"},"publishers":"/publishers","static_terms":"/terms","static_privacy":"/privacy","copyright":"/copyright","ios_app":"https://itunes.apple.com/us/app/scribd-worlds-largest-online/id542557212?mt=8&uo=4&at=11lGEE","android_app":"https://play.google.com/store/apps/details?id=com.scribd.app.reader0&hl=en","books":"/books","sitemap":"/directory"}},"global_nav_props":{"header_props":{"logo_src":"/images/landing/home2_landing/scribd_logo_horiz_small.svg","root_url":"https://www.scribd.com/","search_term":"","small_logo_src":"/images/logos/scribd_s_logo.png","uploads_url":"/upload-document","search_props":{"redirect_to_app":true,"search_url":"/search","search_test":"control","query":"","search_page":false}},"user_menu_props":null,"sidebar_props":{"urls":{"bestsellers":"https://www.scribd.com/bestsellers","home":"https://www.scribd.com/","saved":"/saved","subscribe":"/archive/pmp_checkout?doc=240764024&metadata=%7B%22context%22%3A%22pmp%22%2C%22action%22%3A%22start_trial%22%2C%22logged_in%22%3Afalse%2C%22platform%22%3A%22web%22%7D","top_charts":"/bestsellers","upload":"https://www.scribd.com/upload-document"},"categories":{"book":{"icon":"icon-ic_book","icon_filled":"icon-ic_book_fill","url":"https://www.scribd.com/books","name":"Books","type":"book"},"news":{"icon":"icon-ic_articles","icon_filled":"icon-ic_articles_fill","url":"https://www.scribd.com/news","name":"News","type":"news"},"audiobook":{"icon":"icon-ic_audiobook","icon_filled":"icon-ic_audiobook_fill","url":"https://www.scribd.com/audiobooks","name":"Audiobooks","type":"audiobook"},"magazine":{"icon":"icon-ic_magazine","icon_filled":"icon-ic_magazine_fill","url":"https://www.scribd.com/magazines","name":"Magazines","type":"magazine"},"document":{"icon":"icon-ic_document","icon_filled":"icon-ic_document_fill","url":"https://www.scribd.com/docs","name":"Documents","type":"document"},"sheet_music":{"icon":"icon-ic_songbook","icon_filled":"icon-ic_songbook_fill","url":"https://www.scribd.com/sheetmusic","name":"Sheet Music","type":"sheet_music"}},"categories_array":["mixed","book","audiobook","magazine","news","document","sheet_music"],"selected_content_type":"mixed","username":"","search_overlay_props":{"search_input_props":{"focused":false,"keep_suggestions_on_blur":false}}}},"recommenders":{"related_titles_recommender":{"item_props":[{"type":"document","id":240764138,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240764138/108x144/98772d196c/1412512074?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240764138/216x288/559d63987d/1412512074?v=1","title":"Sap Abap Reports","short_title":"Sap Abap Reports","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240764138,"track":"flattened_recommender","doc_uuid":"UqmKtz4JQV9zXKuijNhdSrXnPic="},"url":"https://www.scribd.com/doc/240764138/Sap-Abap-Reports"},{"type":"document","id":240763929,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763929/108x144/c31fda41b3/1411533882?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763929/216x288/bc4445641a/1411533882?v=1","title":"SUBTRACT Code Abap","short_title":"SUBTRACT Code Abap","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763929,"track":"flattened_recommender","doc_uuid":"rXVmhK0aLe3cDj+Zjh+Af6MMgjc="},"url":"https://www.scribd.com/doc/240763929/SUBTRACT-Code-Abap"},{"type":"document","id":240763691,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763691/108x144/df8dc57378/1411533698?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763691/216x288/d21d9d50fc/1411533698?v=1","title":"Complete Reference to ABAP Basics","short_title":"Complete Reference to ABAP Basics","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763691,"track":"flattened_recommender","doc_uuid":"DZoJobZ75G1wUoRG8ZL3HBf/acQ="},"url":"https://www.scribd.com/doc/240763691/Complete-Reference-to-ABAP-Basics"},{"type":"document","id":240763610,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763610/108x144/1898b4b5ef/1411533684?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763610/216x288/4130744d40/1411533684?v=1","title":"basis book.pdf","short_title":"basis book.pdf","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763610,"track":"flattened_recommender","doc_uuid":"GuzUVKC6ojSHe1vo8n7GdYm9Htw="},"url":"https://www.scribd.com/doc/240763610/basis-book-pdf"},{"type":"document","id":240763487,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763487/108x144/86e0129ad7/1411533524?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763487/216x288/0c9d68b224/1411533524?v=1","title":"DatabaseConnectionwithSAPBI_BW(DBConnect)","short_title":"DatabaseConnectionwithSAPBI_BW(DBConnect)","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763487,"track":"flattened_recommender","doc_uuid":"YHfo8CoD0ikxV9yRQmBy9/fTnHU="},"url":"https://www.scribd.com/doc/240763487/DatabaseConnectionwithSAPBI-BW-DBConnect"},{"type":"book","id":253264900,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/253264900/108x144/dcda7770b5/1537319178?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/253264900/216x288/ca2dc9eb25/1537319178?v=1","title":"Sapiens: A Brief History of Humankind","short_title":"Sapiens","author":"Yuval Noah Harari","tracking":{"object_type":"document","object_id":253264900,"track":"flattened_recommender","doc_uuid":"IEHihOVm2A36IqrTUZyHq8IvQOI="},"url":"https://www.scribd.com/book/253264900/Sapiens-A-Brief-History-of-Humankind"},{"type":"book","id":244157917,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/244157917/108x144/c55ae5929d/1537282839?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/244157917/216x288/c42f4ff9aa/1537282839?v=1","title":"Yes Please","short_title":"Yes Please","author":"Amy Poehler","tracking":{"object_type":"document","object_id":244157917,"track":"flattened_recommender","doc_uuid":"KAfZ7sFQlbf5al1ETkydHHBz+f0="},"url":"https://www.scribd.com/book/244157917/Yes-Please"},{"type":"book","id":212863738,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/212863738/108x144/5bad102ef1/1537264925?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/212863738/216x288/8fc36df455/1537264925?v=1","title":"The Unwinding: An Inner History of the New America","short_title":"The Unwinding","author":"George Packer","tracking":{"object_type":"document","object_id":212863738,"track":"flattened_recommender","doc_uuid":"w4kFV2B11BVL8FXhbfzM11VmnRM="},"url":"https://www.scribd.com/book/212863738/The-Unwinding-An-Inner-History-of-the-New-America"},{"type":"book","id":263504218,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/263504218/108x144/986fa89e8b/1537265288?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/263504218/216x288/c40eb7e9a8/1537265288?v=1","title":"Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future","short_title":"Elon Musk","author":"Ashlee Vance","tracking":{"object_type":"document","object_id":263504218,"track":"flattened_recommender","doc_uuid":"fvYOTJKRiq4fJp8MVVvpAPt7Ubc="},"url":"https://www.scribd.com/book/263504218/Elon-Musk-Tesla-SpaceX-and-the-Quest-for-a-Fantastic-Future"},{"type":"book","id":282766939,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/282766939/108x144/1355dd3a71/1537323900?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/282766939/216x288/076d3f356c/1537323900?v=1","title":"Dispatches from Pluto: Lost and Found in the Mississippi Delta","short_title":"Dispatches from Pluto","author":"Richard Grant","tracking":{"object_type":"document","object_id":282766939,"track":"flattened_recommender","doc_uuid":"s1UeLTAFbUbpbeyuxPrYtEr+4HE="},"url":"https://www.scribd.com/book/282766939/Dispatches-from-Pluto-Lost-and-Found-in-the-Mississippi-Delta"},{"type":"book","id":239488191,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239488191/108x144/a9a21bdc0e/1537269642?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239488191/216x288/73448c1779/1537269642?v=1","title":"The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution","short_title":"The Innovators","author":"Walter Isaacson","tracking":{"object_type":"document","object_id":239488191,"track":"flattened_recommender","doc_uuid":"HVSNoZSwTpFBR2XksipYTvIdXRg="},"url":"https://www.scribd.com/book/239488191/The-Innovators-How-a-Group-of-Hackers-Geniuses-and-Geeks-Created-the-Digital-Revolution"},{"type":"book","id":224419023,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224419023/108x144/48b209bbb5/1537260973?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224419023/216x288/39263c2334/1537260973?v=1","title":"John Adams","short_title":"John Adams","author":"David McCullough","tracking":{"object_type":"document","object_id":224419023,"track":"flattened_recommender","doc_uuid":"rQ0t6ekeYdSJiBc4xQfyQuvYkEU="},"url":"https://www.scribd.com/book/224419023/John-Adams"},{"type":"book","id":163646054,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163646054/108x144/c8eb9eae18/1537325956?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163646054/216x288/d6d700f05f/1537325956?v=1","title":"Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America","short_title":"Devil in the Grove","author":"Gilbert King","tracking":{"object_type":"document","object_id":163646054,"track":"flattened_recommender","doc_uuid":"ZeqKW2jYZeXPU68KE0VgNwXJxmY="},"url":"https://www.scribd.com/book/163646054/Devil-in-the-Grove-Thurgood-Marshall-the-Groveland-Boys-and-the-Dawn-of-a-New-America"},{"type":"book","id":238704340,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/238704340/108x144/2fd0be1590/1537336189?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/238704340/216x288/191539db56/1537336189?v=1","title":"This Changes Everything: Capitalism vs. The Climate","short_title":"This Changes Everything","author":"Naomi Klein","tracking":{"object_type":"document","object_id":238704340,"track":"flattened_recommender","doc_uuid":"mjR7BuHi+AbdDs6X7pTz4XOEqrs="},"url":"https://www.scribd.com/book/238704340/This-Changes-Everything-Capitalism-vs-The-Climate"},{"type":"book","id":224355300,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224355300/108x144/0f2130a60a/1537296454?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224355300/216x288/9b9b19254a/1537296454?v=1","title":"Grand Pursuit: The Story of Economic Genius","short_title":"Grand Pursuit","author":"Sylvia Nasar","tracking":{"object_type":"document","object_id":224355300,"track":"flattened_recommender","doc_uuid":"knPv1HlyOv2Y67gF/en7aq+41tI="},"url":"https://www.scribd.com/book/224355300/Grand-Pursuit-The-Story-of-Economic-Genius"},{"type":"book","id":225916486,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/225916486/108x144/241cf75eb3/1537263696?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/225916486/216x288/a042fe186a/1537263696?v=1","title":"A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story","short_title":"A Heartbreaking Work Of Staggering Genius","author":"Dave Eggers","tracking":{"object_type":"document","object_id":225916486,"track":"flattened_recommender","doc_uuid":"QszFhPELxlsoZG8lvuWxb32w6nQ="},"url":"https://www.scribd.com/book/225916486/A-Heartbreaking-Work-Of-Staggering-Genius-A-Memoir-Based-on-a-True-Story"},{"type":"book","id":224369806,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224369806/108x144/6fb23377a8/1537300926?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224369806/216x288/b1d476d0fb/1537300926?v=1","title":"The Emperor of All Maladies: A Biography of Cancer","short_title":"The Emperor of All Maladies","author":"Siddhartha Mukherjee","tracking":{"object_type":"document","object_id":224369806,"track":"flattened_recommender","doc_uuid":"pPzhA+xjY6+XpJ8+PSc48HkFa9I="},"url":"https://www.scribd.com/book/224369806/The-Emperor-of-All-Maladies-A-Biography-of-Cancer"},{"type":"book","id":224258670,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224258670/108x144/3c7a87a449/1537312050?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224258670/216x288/ef3c1ca84d/1537312050?v=1","title":"The Prize: The Epic Quest for Oil, Money & Power","short_title":"The Prize","author":"Daniel Yergin","tracking":{"object_type":"document","object_id":224258670,"track":"flattened_recommender","doc_uuid":"B3By0UU5EMwJXHTF4glwW/pm9KU="},"url":"https://www.scribd.com/book/224258670/The-Prize-The-Epic-Quest-for-Oil-Money-Power"},{"type":"book","id":224410295,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224410295/108x144/514b1bea0b/1537260692?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224410295/216x288/f7c9469e6c/1537260692?v=1","title":"Team of Rivals: The Political Genius of Abraham Lincoln","short_title":"Team of Rivals","author":"Doris Kearns Goodwin","tracking":{"object_type":"document","object_id":224410295,"track":"flattened_recommender","doc_uuid":"G28gTqDVcsoVxkyRgknEVtDcVkQ="},"url":"https://www.scribd.com/book/224410295/Team-of-Rivals-The-Political-Genius-of-Abraham-Lincoln"},{"type":"book","id":293461549,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/293461549/108x144/07628d60db/1537261738?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/293461549/216x288/8d1185b7ff/1537261738?v=1","title":"The New Confessions of an Economic Hit Man","short_title":"The New Confessions of an Economic Hit Man","author":"John Perkins","tracking":{"object_type":"document","object_id":293461549,"track":"flattened_recommender","doc_uuid":"KO1unEV7PlhiCTmB4CMDo+ebTwM="},"url":"https://www.scribd.com/book/293461549/The-New-Confessions-of-an-Economic-Hit-Man"},{"type":"book","id":182553141,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182553141/108x144/1b40063d80/1537339280?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182553141/216x288/098f7f1651/1537339280?v=1","title":"The World Is Flat 3.0: A Brief History of the Twenty-first Century","short_title":"The World Is Flat 3.0","author":"Thomas L. Friedman","tracking":{"object_type":"document","object_id":182553141,"track":"flattened_recommender","doc_uuid":"bBQtW0qY4Z5LBqrRiF4Nag5fgR8="},"url":"https://www.scribd.com/book/182553141/The-World-Is-Flat-3-0-A-Brief-History-of-the-Twenty-first-Century"},{"type":"book","id":239588474,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239588474/108x144/149fb5e6af/1537269879?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/239588474/216x288/15f36354f8/1537269879?v=1","title":"Rise of ISIS: A Threat We Can't Ignore","short_title":"Rise of ISIS","author":"Jay Sekulow","tracking":{"object_type":"document","object_id":239588474,"track":"flattened_recommender","doc_uuid":"mwVl4L7itRVqJBqnmm0yzvOTl5I="},"url":"https://www.scribd.com/book/239588474/Rise-of-ISIS-A-Threat-We-Can-t-Ignore"},{"type":"book","id":211302755,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/211302755/108x144/2424de51a2/1537266962?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/211302755/216x288/09ee7462f3/1537266962?v=1","title":"The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers","short_title":"The Hard Thing About Hard Things","author":"Ben Horowitz","tracking":{"object_type":"document","object_id":211302755,"track":"flattened_recommender","doc_uuid":"3e1Je90u2LQPZTU2fCvACsEjXzY="},"url":"https://www.scribd.com/book/211302755/The-Hard-Thing-About-Hard-Things-Building-a-Business-When-There-Are-No-Easy-Answers"},{"type":"book","id":202691564,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/202691564/108x144/f0e6e6416d/1537348660?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/202691564/216x288/56a5d067c6/1537348660?v=1","title":"Smart People Should Build Things: How to Restore Our Culture of Achievement, Build a Path for Entrepreneurs, and Create New Jobs in America","short_title":"Smart People Should Build Things","author":"Andrew Yang","tracking":{"object_type":"document","object_id":202691564,"track":"flattened_recommender","doc_uuid":"wnca8vHxzOohGj4Xp95cF8yR1mY="},"url":"https://www.scribd.com/book/202691564/Smart-People-Should-Build-Things-How-to-Restore-Our-Culture-of-Achievement-Build-a-Path-for-Entrepreneurs-and-Create-New-Jobs-in-America"},{"type":"book","id":224349281,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224349281/108x144/4df0918cea/1537336933?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224349281/216x288/befa0c6317/1537336933?v=1","title":"How To Win Friends and Influence People","short_title":"How To Win Friends and Influence People","author":"Dale Carnegie","tracking":{"object_type":"document","object_id":224349281,"track":"flattened_recommender","doc_uuid":"aKb/gEDra9JiWAms9XsTnOyZoVI="},"url":"https://www.scribd.com/book/224349281/How-To-Win-Friends-and-Influence-People"},{"type":"book","id":224326250,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224326250/108x144/b659f5fb6a/1537331617?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224326250/216x288/900e8864ca/1537331617?v=1","title":"Steve Jobs","short_title":"Steve Jobs","author":"Walter Isaacson","tracking":{"object_type":"document","object_id":224326250,"track":"flattened_recommender","doc_uuid":"gBjeveQpHTWYLs/hTaXbRwy2OJQ="},"url":"https://www.scribd.com/book/224326250/Steve-Jobs"},{"type":"book","id":224426877,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224426877/108x144/f22cf865fe/1537257666?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224426877/216x288/a73f25e252/1537257666?v=1","title":"Angela's Ashes: A Memoir","short_title":"Angela's Ashes","author":"Frank McCourt","tracking":{"object_type":"document","object_id":224426877,"track":"flattened_recommender","doc_uuid":"kc3MvmTl4I8bogGvdygXEoh+41c="},"url":"https://www.scribd.com/book/224426877/Angela-s-Ashes-A-Memoir"},{"type":"book","id":234028503,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/234028503/108x144/2c4440aa6c/1537307233?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/234028503/216x288/cfe54b8013/1537307233?v=1","title":"Bad Feminist: Essays","short_title":"Bad Feminist","author":"Roxane Gay","tracking":{"object_type":"document","object_id":234028503,"track":"flattened_recommender","doc_uuid":"nD7GFPtcEZzLgZnFk+kysERcU0w="},"url":"https://www.scribd.com/book/234028503/Bad-Feminist-Essays"},{"type":"book","id":224306619,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224306619/108x144/7eeca5a1bc/1537267704?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224306619/216x288/4a8f75444a/1537267704?v=1","title":"The Light Between Oceans: A Novel","short_title":"The Light Between Oceans","author":"M.L. Stedman","tracking":{"object_type":"document","object_id":224306619,"track":"flattened_recommender","doc_uuid":"0WhnyLZ3HYwweFX+eRnw0pAxJmo="},"url":"https://www.scribd.com/book/224306619/The-Light-Between-Oceans-A-Novel"},{"type":"book","id":254039238,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/254039238/108x144/a8c6c5e065/1537323748?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/254039238/216x288/0e4e5ae0d4/1537323748?v=1","title":"Leaving Berlin: A Novel","short_title":"Leaving Berlin","author":"Joseph Kanon","tracking":{"object_type":"document","object_id":254039238,"track":"flattened_recommender","doc_uuid":"PtLo8RT1l3rs8b1tUdmFZjnECgE="},"url":"https://www.scribd.com/book/254039238/Leaving-Berlin-A-Novel"},{"type":"book","id":182565115,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182565115/108x144/50e3fc9eb2/1537338525?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182565115/216x288/8bbf81282a/1537338525?v=1","title":"The Silver Linings Playbook: A Novel","short_title":"The Silver Linings Playbook","author":"Matthew Quick","tracking":{"object_type":"document","object_id":182565115,"track":"flattened_recommender","doc_uuid":"29uvcq9Xt9CykAPjoOIGeOsxNB8="},"url":"https://www.scribd.com/book/182565115/The-Silver-Linings-Playbook-A-Novel"},{"type":"book","id":337536061,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/337536061/108x144/8c1b451da6/1537268827?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/337536061/216x288/45d81f5c37/1537268827?v=1","title":"The Sympathizer: A Novel (Pulitzer Prize for Fiction)","short_title":"The Sympathizer","author":"Viet Thanh Nguyen","tracking":{"object_type":"document","object_id":337536061,"track":"flattened_recommender","doc_uuid":"FPF2n3GjRNi1VWQIfA5taB32zRc="},"url":"https://www.scribd.com/book/337536061/The-Sympathizer-A-Novel-Pulitzer-Prize-for-Fiction"},{"type":"book","id":249309502,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249309502/108x144/06f5527c5d/1537258959?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249309502/216x288/ec3bf7c24b/1537258959?v=1","title":"Extremely Loud and Incredibly Close: A Novel","short_title":"Extremely Loud and Incredibly Close","author":"Jonathan Safran Foer","tracking":{"object_type":"document","object_id":249309502,"track":"flattened_recommender","doc_uuid":"ot1+HPccPD974phk+dAKWKsed2Y="},"url":"https://www.scribd.com/book/249309502/Extremely-Loud-and-Incredibly-Close-A-Novel"},{"type":"book","id":273582508,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273582508/108x144/fb92cadae3/1537292604?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/273582508/216x288/135562ba06/1537292604?v=1","title":"You Too Can Have a Body Like Mine: A Novel","short_title":"You Too Can Have a Body Like Mine","author":"Alexandra Kleeman","tracking":{"object_type":"document","object_id":273582508,"track":"flattened_recommender","doc_uuid":"DIQBEYYDnF7sNXT+MqzQAYsZtjI="},"url":"https://www.scribd.com/book/273582508/You-Too-Can-Have-a-Body-Like-Mine-A-Novel"},{"type":"book","id":273440534,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273440534/108x144/b7e49e07d3/1537292002?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273440534/216x288/aaec1b2b1a/1537292002?v=1","title":"The Incarnations: A Novel","short_title":"The Incarnations","author":"Susan Barker","tracking":{"object_type":"document","object_id":273440534,"track":"flattened_recommender","doc_uuid":"r+1tnb/Q6zXdHWY/CNWGRO8+MYY="},"url":"https://www.scribd.com/book/273440534/The-Incarnations-A-Novel"},{"type":"book","id":249308781,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249308781/108x144/8ccbad3c4a/1537265248?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308781/216x288/b0591f1a45/1537265248?v=1","title":"Life of Pi","short_title":"Life of Pi","author":"Yann Martel","tracking":{"object_type":"document","object_id":249308781,"track":"flattened_recommender","doc_uuid":"h1gqb1z1bAw3CeFw2kvRJIWZA38="},"url":"https://www.scribd.com/book/249308781/Life-of-Pi"},{"type":"book","id":182546874,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182546874/108x144/817bab2149/1537334235?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182546874/216x288/a6b6573207/1537334235?v=1","title":"The Love Affairs of Nathaniel P.: A Novel","short_title":"The Love Affairs of Nathaniel P.","author":"Adelle Waldman","tracking":{"object_type":"document","object_id":182546874,"track":"flattened_recommender","doc_uuid":"/rfhKlsiGKfTANGEtS1nV5S4yIk="},"url":"https://www.scribd.com/book/182546874/The-Love-Affairs-of-Nathaniel-P-A-Novel"},{"type":"book","id":235411767,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235411767/108x144/b2ad7aa7d5/1537315948?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235411767/216x288/1740216c8c/1537315948?v=1","title":"A Man Called Ove: A Novel","short_title":"A Man Called Ove","author":"Fredrik Backman","tracking":{"object_type":"document","object_id":235411767,"track":"flattened_recommender","doc_uuid":"UD5uzs/coMj62fZtjeJKh3ZCIf8="},"url":"https://www.scribd.com/book/235411767/A-Man-Called-Ove-A-Novel"},{"type":"book","id":224270540,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224270540/108x144/f484685ce1/1537319285?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224270540/216x288/f0d4e09ce0/1537319285?v=1","title":"The Master","short_title":"The Master","author":"Colm Toibin","tracking":{"object_type":"document","object_id":224270540,"track":"flattened_recommender","doc_uuid":"EOdrPDMWDE8ypEDsSZQqPjWtTOc="},"url":"https://www.scribd.com/book/224270540/The-Master"},{"type":"book","id":163580087,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163580087/108x144/865888b820/1537322122?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163580087/216x288/a50ec4d378/1537322122?v=1","title":"Bel Canto","short_title":"Bel Canto","author":"Ann Patchett","tracking":{"object_type":"document","object_id":163580087,"track":"flattened_recommender","doc_uuid":"4JHyucQNZFumztgz8sS5oFU/7DQ="},"url":"https://www.scribd.com/book/163580087/Bel-Canto"},{"type":"book","id":235583696,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235583696/108x144/a9f15763be/1537316021?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235583696/216x288/7c5ab0af0f/1537316021?v=1","title":"We Are Not Ourselves: A Novel","short_title":"We Are Not Ourselves","author":"Matthew Thomas","tracking":{"object_type":"document","object_id":235583696,"track":"flattened_recommender","doc_uuid":"FvgcCi0iWySVF5AVLs//KfKsQdk="},"url":"https://www.scribd.com/book/235583696/We-Are-Not-Ourselves-A-Novel"},{"type":"book","id":250006950,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/250006950/108x144/2a1edbdeca/1537302889?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/250006950/216x288/139a0bb438/1537302889?v=1","title":"The First Bad Man: A Novel","short_title":"The First Bad Man","author":"Miranda July","tracking":{"object_type":"document","object_id":250006950,"track":"flattened_recommender","doc_uuid":"pFrg27CVBc4h1BaKpMfwOx3nqV0="},"url":"https://www.scribd.com/book/250006950/The-First-Bad-Man-A-Novel"},{"type":"book","id":224248577,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248577/108x144/d525463c67/1537254258?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248577/216x288/2b59844b99/1537254258?v=1","title":"The Rosie Project: A Novel","short_title":"The Rosie Project","author":"Graeme Simsion","tracking":{"object_type":"document","object_id":224248577,"track":"flattened_recommender","doc_uuid":"uR+IodNyqHAumij87shkBLHnfxQ="},"url":"https://www.scribd.com/book/224248577/The-Rosie-Project-A-Novel"},{"type":"book","id":231689346,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/231689346/108x144/7e5fbbde4a/1537302746?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/231689346/216x288/b7fe80231f/1537302746?v=1","title":"The Blazing World: A Novel","short_title":"The Blazing World","author":"Siri Hustvedt","tracking":{"object_type":"document","object_id":231689346,"track":"flattened_recommender","doc_uuid":"BlUfRaCjh8i5PkhraY5s7ZdESEg="},"url":"https://www.scribd.com/book/231689346/The-Blazing-World-A-Novel"},{"type":"book","id":224285255,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224285255/108x144/144bc668f6/1537254183?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224285255/216x288/9dbee53a6c/1537254183?v=1","title":"The Flamethrowers: A Novel","short_title":"The Flamethrowers","author":"Rachel Kushner","tracking":{"object_type":"document","object_id":224285255,"track":"flattened_recommender","doc_uuid":"gcV2uxnZzUIJLHDh3cXhsd22hmg="},"url":"https://www.scribd.com/book/224285255/The-Flamethrowers-A-Novel"},{"type":"book","id":224252178,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224252178/108x144/68dbc1000d/1537308835?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224252178/216x288/57a65a5750/1537308835?v=1","title":"Brooklyn: A Novel","short_title":"Brooklyn","author":"Colm Toibin","tracking":{"object_type":"document","object_id":224252178,"track":"flattened_recommender","doc_uuid":"HfZBDUWK66tHXltYtkAl/WCogS8="},"url":"https://www.scribd.com/book/224252178/Brooklyn-A-Novel"},{"type":"book","id":163579056,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163579056/108x144/b0cc4a522d/1537322024?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163579056/216x288/cc1bed9752/1537322024?v=1","title":"The Art of Racing in the Rain: A Novel","short_title":"The Art of Racing in the Rain","author":"Garth Stein","tracking":{"object_type":"document","object_id":163579056,"track":"flattened_recommender","doc_uuid":"jDpM7OLU9q5ZBtaMfblmbYK4lJM="},"url":"https://www.scribd.com/book/163579056/The-Art-of-Racing-in-the-Rain-A-Novel"},{"type":"book","id":182560283,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182560283/108x144/229169a793/1537339264?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182560283/216x288/fc0b9ebffa/1537339264?v=1","title":"Wolf Hall: A Novel","short_title":"Wolf Hall","author":"Hilary Mantel","tracking":{"object_type":"document","object_id":182560283,"track":"flattened_recommender","doc_uuid":"M5oajEkiRxZUJXeP6xP8QPLa6Ek="},"url":"https://www.scribd.com/book/182560283/Wolf-Hall-A-Novel"},{"type":"book","id":246897514,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/246897514/108x144/60f21686b1/1537287704?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/246897514/216x288/4b640ccfe4/1537287704?v=1","title":"The Wallcreeper","short_title":"The Wallcreeper","author":"Nell Zink","tracking":{"object_type":"document","object_id":246897514,"track":"flattened_recommender","doc_uuid":"bI47NMRB2TRS6twdB+YjVIPyZrM="},"url":"https://www.scribd.com/book/246897514/The-Wallcreeper"},{"type":"book","id":249308236,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308236/108x144/0b356a7d6a/1537258191?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308236/216x288/cbef455d67/1537258191?v=1","title":"Interpreter of Maladies","short_title":"Interpreter of Maladies","author":"Jhumpa Lahiri","tracking":{"object_type":"document","object_id":249308236,"track":"flattened_recommender","doc_uuid":"UKGSf+7ZioxUX0FU/zCK5oaGjgs="},"url":"https://www.scribd.com/book/249308236/Interpreter-of-Maladies"},{"type":"book","id":224248520,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248520/108x144/57b8f15c1c/1537307567?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248520/216x288/2fc602273a/1537307567?v=1","title":"The Kitchen House: A Novel","short_title":"The Kitchen House","author":"Kathleen Grissom","tracking":{"object_type":"document","object_id":224248520,"track":"flattened_recommender","doc_uuid":"Evigp45ofFSg+Glf/JBTLsLndww="},"url":"https://www.scribd.com/book/224248520/The-Kitchen-House-A-Novel"},{"type":"book","id":163564256,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163564256/108x144/19b813ddea/1537325968?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163564256/216x288/50918b57c9/1537325968?v=1","title":"Beautiful Ruins: A Novel","short_title":"Beautiful Ruins","author":"Jess Walter","tracking":{"object_type":"document","object_id":163564256,"track":"flattened_recommender","doc_uuid":"fKydGEh5LztlpNu/RBNzGgl470w="},"url":"https://www.scribd.com/book/163564256/Beautiful-Ruins-A-Novel"},{"type":"book","id":182522032,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182522032/108x144/671b9a055b/1537334459?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182522032/216x288/ec6eb5c88b/1537334459?v=1","title":"The Bonfire of the Vanities: A Novel","short_title":"The Bonfire of the Vanities","author":"Tom Wolfe","tracking":{"object_type":"document","object_id":182522032,"track":"flattened_recommender","doc_uuid":"c0t8tqyUc9zLg0rHuMTaBxcmNjU="},"url":"https://www.scribd.com/book/182522032/The-Bonfire-of-the-Vanities-A-Novel"},{"type":"book","id":216442529,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/216442529/108x144/7945e537de/1537257634?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/216442529/216x288/95db88293e/1537257634?v=1","title":"Lovers at the Chameleon Club, Paris 1932: A Novel","short_title":"Lovers at the Chameleon Club, Paris 1932","author":"Francine Prose","tracking":{"object_type":"document","object_id":216442529,"track":"flattened_recommender","doc_uuid":"coyXlqjdy9NQ3z39Y1u38wvFGZ8="},"url":"https://www.scribd.com/book/216442529/Lovers-at-the-Chameleon-Club-Paris-1932-A-Novel"},{"type":"book","id":224266633,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224266633/108x144/d0de7b5bf4/1537314478?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224266633/216x288/a40600a76d/1537314478?v=1","title":"The Perks of Being a Wallflower","short_title":"The Perks of Being a Wallflower","author":"Stephen Chbosky","tracking":{"object_type":"document","object_id":224266633,"track":"flattened_recommender","doc_uuid":"UyGKMcQHa/HbSiWlF2FulLCJ7OQ="},"url":"https://www.scribd.com/book/224266633/The-Perks-of-Being-a-Wallflower"},{"type":"book","id":163603389,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163603389/108x144/9281c90791/1537326465?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163603389/216x288/a0de7e7dea/1537326465?v=1","title":"A Prayer for Owen Meany: A Novel","short_title":"A Prayer for Owen Meany","author":"John Irving","tracking":{"object_type":"document","object_id":163603389,"track":"flattened_recommender","doc_uuid":"oWSMIeQgLh8f0RDEv+BzLT4+K0M="},"url":"https://www.scribd.com/book/163603389/A-Prayer-for-Owen-Meany-A-Novel"},{"type":"book","id":163647832,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163647832/108x144/9f4ce0c73a/1537326613?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163647832/216x288/c8974e0a45/1537326613?v=1","title":"The Cider House Rules","short_title":"The Cider House Rules","author":"John Irving","tracking":{"object_type":"document","object_id":163647832,"track":"flattened_recommender","doc_uuid":"umE0KzCL1yBwhGGkMSfeEm9p21w="},"url":"https://www.scribd.com/book/163647832/The-Cider-House-Rules"},{"type":"book","id":249309690,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249309690/108x144/48e07febe4/1537265011?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249309690/216x288/aa98599d5e/1537265011?v=1","title":"Everything Is Illuminated","short_title":"Everything Is Illuminated","author":"Jonathan Safran Foer","tracking":{"object_type":"document","object_id":249309690,"track":"flattened_recommender","doc_uuid":"LIpTOIOVtP4yDkvjxQY9QIObh60="},"url":"https://www.scribd.com/book/249309690/Everything-Is-Illuminated"}],"title_link":null,"title":null,"track_opts":{"compilation_id":"S40z1n9usGzjSzULiibyGiWExdA=","module_id":"nEjyPBalVXxfZGad/BmwgDVif/E=","widget_name":"right sidebar","track_id":"flattened_recommender"}},"footer_recommenders":{"recommenders":[{"item_props":[{"type":"book","id":253264900,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/253264900/108x144/dcda7770b5/1537319178?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/253264900/216x288/ca2dc9eb25/1537319178?v=1","title":"Sapiens: A Brief History of Humankind","short_title":"Sapiens","author":"Yuval Noah Harari","tracking":{"object_type":"document","object_id":253264900,"track":"default_editorial","doc_uuid":"IEHihOVm2A36IqrTUZyHq8IvQOI="},"url":"https://www.scribd.com/book/253264900/Sapiens-A-Brief-History-of-Humankind"},{"type":"book","id":244157917,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/244157917/108x144/c55ae5929d/1537282839?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/244157917/216x288/c42f4ff9aa/1537282839?v=1","title":"Yes Please","short_title":"Yes Please","author":"Amy Poehler","tracking":{"object_type":"document","object_id":244157917,"track":"default_editorial","doc_uuid":"KAfZ7sFQlbf5al1ETkydHHBz+f0="},"url":"https://www.scribd.com/book/244157917/Yes-Please"},{"type":"book","id":212863738,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/212863738/108x144/5bad102ef1/1537264925?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/212863738/216x288/8fc36df455/1537264925?v=1","title":"The Unwinding: An Inner History of the New America","short_title":"The Unwinding","author":"George Packer","tracking":{"object_type":"document","object_id":212863738,"track":"default_editorial","doc_uuid":"w4kFV2B11BVL8FXhbfzM11VmnRM="},"url":"https://www.scribd.com/book/212863738/The-Unwinding-An-Inner-History-of-the-New-America"},{"type":"book","id":263504218,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/263504218/108x144/986fa89e8b/1537265288?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/263504218/216x288/c40eb7e9a8/1537265288?v=1","title":"Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future","short_title":"Elon Musk","author":"Ashlee Vance","tracking":{"object_type":"document","object_id":263504218,"track":"default_editorial","doc_uuid":"fvYOTJKRiq4fJp8MVVvpAPt7Ubc="},"url":"https://www.scribd.com/book/263504218/Elon-Musk-Tesla-SpaceX-and-the-Quest-for-a-Fantastic-Future"},{"type":"book","id":282766939,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/282766939/108x144/1355dd3a71/1537323900?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/282766939/216x288/076d3f356c/1537323900?v=1","title":"Dispatches from Pluto: Lost and Found in the Mississippi Delta","short_title":"Dispatches from Pluto","author":"Richard Grant","tracking":{"object_type":"document","object_id":282766939,"track":"default_editorial","doc_uuid":"s1UeLTAFbUbpbeyuxPrYtEr+4HE="},"url":"https://www.scribd.com/book/282766939/Dispatches-from-Pluto-Lost-and-Found-in-the-Mississippi-Delta"},{"type":"book","id":239488191,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239488191/108x144/a9a21bdc0e/1537269642?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239488191/216x288/73448c1779/1537269642?v=1","title":"The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution","short_title":"The Innovators","author":"Walter Isaacson","tracking":{"object_type":"document","object_id":239488191,"track":"default_editorial","doc_uuid":"HVSNoZSwTpFBR2XksipYTvIdXRg="},"url":"https://www.scribd.com/book/239488191/The-Innovators-How-a-Group-of-Hackers-Geniuses-and-Geeks-Created-the-Digital-Revolution"},{"type":"book","id":224419023,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224419023/108x144/48b209bbb5/1537260973?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224419023/216x288/39263c2334/1537260973?v=1","title":"John Adams","short_title":"John Adams","author":"David McCullough","tracking":{"object_type":"document","object_id":224419023,"track":"default_editorial","doc_uuid":"rQ0t6ekeYdSJiBc4xQfyQuvYkEU="},"url":"https://www.scribd.com/book/224419023/John-Adams"},{"type":"book","id":163646054,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163646054/108x144/c8eb9eae18/1537325956?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163646054/216x288/d6d700f05f/1537325956?v=1","title":"Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America","short_title":"Devil in the Grove","author":"Gilbert King","tracking":{"object_type":"document","object_id":163646054,"track":"default_editorial","doc_uuid":"ZeqKW2jYZeXPU68KE0VgNwXJxmY="},"url":"https://www.scribd.com/book/163646054/Devil-in-the-Grove-Thurgood-Marshall-the-Groveland-Boys-and-the-Dawn-of-a-New-America"},{"type":"book","id":238704340,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/238704340/108x144/2fd0be1590/1537336189?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/238704340/216x288/191539db56/1537336189?v=1","title":"This Changes Everything: Capitalism vs. The Climate","short_title":"This Changes Everything","author":"Naomi Klein","tracking":{"object_type":"document","object_id":238704340,"track":"default_editorial","doc_uuid":"mjR7BuHi+AbdDs6X7pTz4XOEqrs="},"url":"https://www.scribd.com/book/238704340/This-Changes-Everything-Capitalism-vs-The-Climate"},{"type":"book","id":224355300,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224355300/108x144/0f2130a60a/1537296454?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224355300/216x288/9b9b19254a/1537296454?v=1","title":"Grand Pursuit: The Story of Economic Genius","short_title":"Grand Pursuit","author":"Sylvia Nasar","tracking":{"object_type":"document","object_id":224355300,"track":"default_editorial","doc_uuid":"knPv1HlyOv2Y67gF/en7aq+41tI="},"url":"https://www.scribd.com/book/224355300/Grand-Pursuit-The-Story-of-Economic-Genius"},{"type":"book","id":225916486,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/225916486/108x144/241cf75eb3/1537263696?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/225916486/216x288/a042fe186a/1537263696?v=1","title":"A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story","short_title":"A Heartbreaking Work Of Staggering Genius","author":"Dave Eggers","tracking":{"object_type":"document","object_id":225916486,"track":"default_editorial","doc_uuid":"QszFhPELxlsoZG8lvuWxb32w6nQ="},"url":"https://www.scribd.com/book/225916486/A-Heartbreaking-Work-Of-Staggering-Genius-A-Memoir-Based-on-a-True-Story"},{"type":"book","id":224369806,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224369806/108x144/6fb23377a8/1537300926?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224369806/216x288/b1d476d0fb/1537300926?v=1","title":"The Emperor of All Maladies: A Biography of Cancer","short_title":"The Emperor of All Maladies","author":"Siddhartha Mukherjee","tracking":{"object_type":"document","object_id":224369806,"track":"default_editorial","doc_uuid":"pPzhA+xjY6+XpJ8+PSc48HkFa9I="},"url":"https://www.scribd.com/book/224369806/The-Emperor-of-All-Maladies-A-Biography-of-Cancer"},{"type":"book","id":224258670,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224258670/108x144/3c7a87a449/1537312050?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224258670/216x288/ef3c1ca84d/1537312050?v=1","title":"The Prize: The Epic Quest for Oil, Money & Power","short_title":"The Prize","author":"Daniel Yergin","tracking":{"object_type":"document","object_id":224258670,"track":"default_editorial","doc_uuid":"B3By0UU5EMwJXHTF4glwW/pm9KU="},"url":"https://www.scribd.com/book/224258670/The-Prize-The-Epic-Quest-for-Oil-Money-Power"},{"type":"book","id":224410295,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224410295/108x144/514b1bea0b/1537260692?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224410295/216x288/f7c9469e6c/1537260692?v=1","title":"Team of Rivals: The Political Genius of Abraham Lincoln","short_title":"Team of Rivals","author":"Doris Kearns Goodwin","tracking":{"object_type":"document","object_id":224410295,"track":"default_editorial","doc_uuid":"G28gTqDVcsoVxkyRgknEVtDcVkQ="},"url":"https://www.scribd.com/book/224410295/Team-of-Rivals-The-Political-Genius-of-Abraham-Lincoln"},{"type":"book","id":293461549,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/293461549/108x144/07628d60db/1537261738?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/293461549/216x288/8d1185b7ff/1537261738?v=1","title":"The New Confessions of an Economic Hit Man","short_title":"The New Confessions of an Economic Hit Man","author":"John Perkins","tracking":{"object_type":"document","object_id":293461549,"track":"default_editorial","doc_uuid":"KO1unEV7PlhiCTmB4CMDo+ebTwM="},"url":"https://www.scribd.com/book/293461549/The-New-Confessions-of-an-Economic-Hit-Man"},{"type":"book","id":182553141,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182553141/108x144/1b40063d80/1537339280?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182553141/216x288/098f7f1651/1537339280?v=1","title":"The World Is Flat 3.0: A Brief History of the Twenty-first Century","short_title":"The World Is Flat 3.0","author":"Thomas L. Friedman","tracking":{"object_type":"document","object_id":182553141,"track":"default_editorial","doc_uuid":"bBQtW0qY4Z5LBqrRiF4Nag5fgR8="},"url":"https://www.scribd.com/book/182553141/The-World-Is-Flat-3-0-A-Brief-History-of-the-Twenty-first-Century"},{"type":"book","id":239588474,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/239588474/108x144/149fb5e6af/1537269879?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/239588474/216x288/15f36354f8/1537269879?v=1","title":"Rise of ISIS: A Threat We Can't Ignore","short_title":"Rise of ISIS","author":"Jay Sekulow","tracking":{"object_type":"document","object_id":239588474,"track":"default_editorial","doc_uuid":"mwVl4L7itRVqJBqnmm0yzvOTl5I="},"url":"https://www.scribd.com/book/239588474/Rise-of-ISIS-A-Threat-We-Can-t-Ignore"},{"type":"book","id":211302755,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/211302755/108x144/2424de51a2/1537266962?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/211302755/216x288/09ee7462f3/1537266962?v=1","title":"The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers","short_title":"The Hard Thing About Hard Things","author":"Ben Horowitz","tracking":{"object_type":"document","object_id":211302755,"track":"default_editorial","doc_uuid":"3e1Je90u2LQPZTU2fCvACsEjXzY="},"url":"https://www.scribd.com/book/211302755/The-Hard-Thing-About-Hard-Things-Building-a-Business-When-There-Are-No-Easy-Answers"},{"type":"book","id":202691564,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/202691564/108x144/f0e6e6416d/1537348660?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/202691564/216x288/56a5d067c6/1537348660?v=1","title":"Smart People Should Build Things: How to Restore Our Culture of Achievement, Build a Path for Entrepreneurs, and Create New Jobs in America","short_title":"Smart People Should Build Things","author":"Andrew Yang","tracking":{"object_type":"document","object_id":202691564,"track":"default_editorial","doc_uuid":"wnca8vHxzOohGj4Xp95cF8yR1mY="},"url":"https://www.scribd.com/book/202691564/Smart-People-Should-Build-Things-How-to-Restore-Our-Culture-of-Achievement-Build-a-Path-for-Entrepreneurs-and-Create-New-Jobs-in-America"},{"type":"book","id":224349281,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224349281/108x144/4df0918cea/1537336933?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224349281/216x288/befa0c6317/1537336933?v=1","title":"How To Win Friends and Influence People","short_title":"How To Win Friends and Influence People","author":"Dale Carnegie","tracking":{"object_type":"document","object_id":224349281,"track":"default_editorial","doc_uuid":"aKb/gEDra9JiWAms9XsTnOyZoVI="},"url":"https://www.scribd.com/book/224349281/How-To-Win-Friends-and-Influence-People"},{"type":"book","id":224326250,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224326250/108x144/b659f5fb6a/1537331617?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224326250/216x288/900e8864ca/1537331617?v=1","title":"Steve Jobs","short_title":"Steve Jobs","author":"Walter Isaacson","tracking":{"object_type":"document","object_id":224326250,"track":"default_editorial","doc_uuid":"gBjeveQpHTWYLs/hTaXbRwy2OJQ="},"url":"https://www.scribd.com/book/224326250/Steve-Jobs"},{"type":"book","id":224426877,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224426877/108x144/f22cf865fe/1537257666?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224426877/216x288/a73f25e252/1537257666?v=1","title":"Angela's Ashes: A Memoir","short_title":"Angela's Ashes","author":"Frank McCourt","tracking":{"object_type":"document","object_id":224426877,"track":"default_editorial","doc_uuid":"kc3MvmTl4I8bogGvdygXEoh+41c="},"url":"https://www.scribd.com/book/224426877/Angela-s-Ashes-A-Memoir"},{"type":"book","id":234028503,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/234028503/108x144/2c4440aa6c/1537307233?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/234028503/216x288/cfe54b8013/1537307233?v=1","title":"Bad Feminist: Essays","short_title":"Bad Feminist","author":"Roxane Gay","tracking":{"object_type":"document","object_id":234028503,"track":"default_editorial","doc_uuid":"nD7GFPtcEZzLgZnFk+kysERcU0w="},"url":"https://www.scribd.com/book/234028503/Bad-Feminist-Essays"}],"title_link":"https://www.scribd.com/lists/17202715/Top-Nonfiction","title":"Top Nonfiction on Scribd","track_opts":{"compilation_id":"S40z1n9usGzjSzULiibyGiWExdA=","module_id":"yzbTBPrDX9i4uZF+IninfLMeSCc=","widget_name":"document_carousel"}},{"item_props":[{"type":"book","id":224306619,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224306619/108x144/7eeca5a1bc/1537267704?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224306619/216x288/4a8f75444a/1537267704?v=1","title":"The Light Between Oceans: A Novel","short_title":"The Light Between Oceans","author":"M.L. Stedman","tracking":{"object_type":"document","object_id":224306619,"track":"default_editorial","doc_uuid":"0WhnyLZ3HYwweFX+eRnw0pAxJmo="},"url":"https://www.scribd.com/book/224306619/The-Light-Between-Oceans-A-Novel"},{"type":"book","id":254039238,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/254039238/108x144/a8c6c5e065/1537323748?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/254039238/216x288/0e4e5ae0d4/1537323748?v=1","title":"Leaving Berlin: A Novel","short_title":"Leaving Berlin","author":"Joseph Kanon","tracking":{"object_type":"document","object_id":254039238,"track":"default_editorial","doc_uuid":"PtLo8RT1l3rs8b1tUdmFZjnECgE="},"url":"https://www.scribd.com/book/254039238/Leaving-Berlin-A-Novel"},{"type":"book","id":182565115,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182565115/108x144/50e3fc9eb2/1537338525?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182565115/216x288/8bbf81282a/1537338525?v=1","title":"The Silver Linings Playbook: A Novel","short_title":"The Silver Linings Playbook","author":"Matthew Quick","tracking":{"object_type":"document","object_id":182565115,"track":"default_editorial","doc_uuid":"29uvcq9Xt9CykAPjoOIGeOsxNB8="},"url":"https://www.scribd.com/book/182565115/The-Silver-Linings-Playbook-A-Novel"},{"type":"book","id":337536061,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/337536061/108x144/8c1b451da6/1537268827?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/337536061/216x288/45d81f5c37/1537268827?v=1","title":"The Sympathizer: A Novel (Pulitzer Prize for Fiction)","short_title":"The Sympathizer","author":"Viet Thanh Nguyen","tracking":{"object_type":"document","object_id":337536061,"track":"default_editorial","doc_uuid":"FPF2n3GjRNi1VWQIfA5taB32zRc="},"url":"https://www.scribd.com/book/337536061/The-Sympathizer-A-Novel-Pulitzer-Prize-for-Fiction"},{"type":"book","id":249309502,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249309502/108x144/06f5527c5d/1537258959?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249309502/216x288/ec3bf7c24b/1537258959?v=1","title":"Extremely Loud and Incredibly Close: A Novel","short_title":"Extremely Loud and Incredibly Close","author":"Jonathan Safran Foer","tracking":{"object_type":"document","object_id":249309502,"track":"default_editorial","doc_uuid":"ot1+HPccPD974phk+dAKWKsed2Y="},"url":"https://www.scribd.com/book/249309502/Extremely-Loud-and-Incredibly-Close-A-Novel"},{"type":"book","id":273582508,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273582508/108x144/fb92cadae3/1537292604?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/273582508/216x288/135562ba06/1537292604?v=1","title":"You Too Can Have a Body Like Mine: A Novel","short_title":"You Too Can Have a Body Like Mine","author":"Alexandra Kleeman","tracking":{"object_type":"document","object_id":273582508,"track":"default_editorial","doc_uuid":"DIQBEYYDnF7sNXT+MqzQAYsZtjI="},"url":"https://www.scribd.com/book/273582508/You-Too-Can-Have-a-Body-Like-Mine-A-Novel"},{"type":"book","id":273440534,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273440534/108x144/b7e49e07d3/1537292002?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/273440534/216x288/aaec1b2b1a/1537292002?v=1","title":"The Incarnations: A Novel","short_title":"The Incarnations","author":"Susan Barker","tracking":{"object_type":"document","object_id":273440534,"track":"default_editorial","doc_uuid":"r+1tnb/Q6zXdHWY/CNWGRO8+MYY="},"url":"https://www.scribd.com/book/273440534/The-Incarnations-A-Novel"},{"type":"book","id":249308781,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249308781/108x144/8ccbad3c4a/1537265248?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308781/216x288/b0591f1a45/1537265248?v=1","title":"Life of Pi","short_title":"Life of Pi","author":"Yann Martel","tracking":{"object_type":"document","object_id":249308781,"track":"default_editorial","doc_uuid":"h1gqb1z1bAw3CeFw2kvRJIWZA38="},"url":"https://www.scribd.com/book/249308781/Life-of-Pi"},{"type":"book","id":182546874,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182546874/108x144/817bab2149/1537334235?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182546874/216x288/a6b6573207/1537334235?v=1","title":"The Love Affairs of Nathaniel P.: A Novel","short_title":"The Love Affairs of Nathaniel P.","author":"Adelle Waldman","tracking":{"object_type":"document","object_id":182546874,"track":"default_editorial","doc_uuid":"/rfhKlsiGKfTANGEtS1nV5S4yIk="},"url":"https://www.scribd.com/book/182546874/The-Love-Affairs-of-Nathaniel-P-A-Novel"},{"type":"book","id":235411767,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235411767/108x144/b2ad7aa7d5/1537315948?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235411767/216x288/1740216c8c/1537315948?v=1","title":"A Man Called Ove: A Novel","short_title":"A Man Called Ove","author":"Fredrik Backman","tracking":{"object_type":"document","object_id":235411767,"track":"default_editorial","doc_uuid":"UD5uzs/coMj62fZtjeJKh3ZCIf8="},"url":"https://www.scribd.com/book/235411767/A-Man-Called-Ove-A-Novel"},{"type":"book","id":224270540,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224270540/108x144/f484685ce1/1537319285?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224270540/216x288/f0d4e09ce0/1537319285?v=1","title":"The Master","short_title":"The Master","author":"Colm Toibin","tracking":{"object_type":"document","object_id":224270540,"track":"default_editorial","doc_uuid":"EOdrPDMWDE8ypEDsSZQqPjWtTOc="},"url":"https://www.scribd.com/book/224270540/The-Master"},{"type":"book","id":163580087,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163580087/108x144/865888b820/1537322122?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163580087/216x288/a50ec4d378/1537322122?v=1","title":"Bel Canto","short_title":"Bel Canto","author":"Ann Patchett","tracking":{"object_type":"document","object_id":163580087,"track":"default_editorial","doc_uuid":"4JHyucQNZFumztgz8sS5oFU/7DQ="},"url":"https://www.scribd.com/book/163580087/Bel-Canto"},{"type":"book","id":235583696,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235583696/108x144/a9f15763be/1537316021?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/235583696/216x288/7c5ab0af0f/1537316021?v=1","title":"We Are Not Ourselves: A Novel","short_title":"We Are Not Ourselves","author":"Matthew Thomas","tracking":{"object_type":"document","object_id":235583696,"track":"default_editorial","doc_uuid":"FvgcCi0iWySVF5AVLs//KfKsQdk="},"url":"https://www.scribd.com/book/235583696/We-Are-Not-Ourselves-A-Novel"},{"type":"book","id":250006950,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/250006950/108x144/2a1edbdeca/1537302889?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/250006950/216x288/139a0bb438/1537302889?v=1","title":"The First Bad Man: A Novel","short_title":"The First Bad Man","author":"Miranda July","tracking":{"object_type":"document","object_id":250006950,"track":"default_editorial","doc_uuid":"pFrg27CVBc4h1BaKpMfwOx3nqV0="},"url":"https://www.scribd.com/book/250006950/The-First-Bad-Man-A-Novel"},{"type":"book","id":224248577,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248577/108x144/d525463c67/1537254258?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248577/216x288/2b59844b99/1537254258?v=1","title":"The Rosie Project: A Novel","short_title":"The Rosie Project","author":"Graeme Simsion","tracking":{"object_type":"document","object_id":224248577,"track":"default_editorial","doc_uuid":"uR+IodNyqHAumij87shkBLHnfxQ="},"url":"https://www.scribd.com/book/224248577/The-Rosie-Project-A-Novel"},{"type":"book","id":231689346,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/231689346/108x144/7e5fbbde4a/1537302746?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/231689346/216x288/b7fe80231f/1537302746?v=1","title":"The Blazing World: A Novel","short_title":"The Blazing World","author":"Siri Hustvedt","tracking":{"object_type":"document","object_id":231689346,"track":"default_editorial","doc_uuid":"BlUfRaCjh8i5PkhraY5s7ZdESEg="},"url":"https://www.scribd.com/book/231689346/The-Blazing-World-A-Novel"},{"type":"book","id":224285255,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224285255/108x144/144bc668f6/1537254183?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224285255/216x288/9dbee53a6c/1537254183?v=1","title":"The Flamethrowers: A Novel","short_title":"The Flamethrowers","author":"Rachel Kushner","tracking":{"object_type":"document","object_id":224285255,"track":"default_editorial","doc_uuid":"gcV2uxnZzUIJLHDh3cXhsd22hmg="},"url":"https://www.scribd.com/book/224285255/The-Flamethrowers-A-Novel"},{"type":"book","id":224252178,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224252178/108x144/68dbc1000d/1537308835?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224252178/216x288/57a65a5750/1537308835?v=1","title":"Brooklyn: A Novel","short_title":"Brooklyn","author":"Colm Toibin","tracking":{"object_type":"document","object_id":224252178,"track":"default_editorial","doc_uuid":"HfZBDUWK66tHXltYtkAl/WCogS8="},"url":"https://www.scribd.com/book/224252178/Brooklyn-A-Novel"},{"type":"book","id":163579056,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163579056/108x144/b0cc4a522d/1537322024?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163579056/216x288/cc1bed9752/1537322024?v=1","title":"The Art of Racing in the Rain: A Novel","short_title":"The Art of Racing in the Rain","author":"Garth Stein","tracking":{"object_type":"document","object_id":163579056,"track":"default_editorial","doc_uuid":"jDpM7OLU9q5ZBtaMfblmbYK4lJM="},"url":"https://www.scribd.com/book/163579056/The-Art-of-Racing-in-the-Rain-A-Novel"},{"type":"book","id":182560283,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182560283/108x144/229169a793/1537339264?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182560283/216x288/fc0b9ebffa/1537339264?v=1","title":"Wolf Hall: A Novel","short_title":"Wolf Hall","author":"Hilary Mantel","tracking":{"object_type":"document","object_id":182560283,"track":"default_editorial","doc_uuid":"M5oajEkiRxZUJXeP6xP8QPLa6Ek="},"url":"https://www.scribd.com/book/182560283/Wolf-Hall-A-Novel"},{"type":"book","id":246897514,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/246897514/108x144/60f21686b1/1537287704?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/246897514/216x288/4b640ccfe4/1537287704?v=1","title":"The Wallcreeper","short_title":"The Wallcreeper","author":"Nell Zink","tracking":{"object_type":"document","object_id":246897514,"track":"default_editorial","doc_uuid":"bI47NMRB2TRS6twdB+YjVIPyZrM="},"url":"https://www.scribd.com/book/246897514/The-Wallcreeper"},{"type":"book","id":249308236,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308236/108x144/0b356a7d6a/1537258191?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/249308236/216x288/cbef455d67/1537258191?v=1","title":"Interpreter of Maladies","short_title":"Interpreter of Maladies","author":"Jhumpa Lahiri","tracking":{"object_type":"document","object_id":249308236,"track":"default_editorial","doc_uuid":"UKGSf+7ZioxUX0FU/zCK5oaGjgs="},"url":"https://www.scribd.com/book/249308236/Interpreter-of-Maladies"},{"type":"book","id":224248520,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248520/108x144/57b8f15c1c/1537307567?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224248520/216x288/2fc602273a/1537307567?v=1","title":"The Kitchen House: A Novel","short_title":"The Kitchen House","author":"Kathleen Grissom","tracking":{"object_type":"document","object_id":224248520,"track":"default_editorial","doc_uuid":"Evigp45ofFSg+Glf/JBTLsLndww="},"url":"https://www.scribd.com/book/224248520/The-Kitchen-House-A-Novel"},{"type":"book","id":163564256,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163564256/108x144/19b813ddea/1537325968?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163564256/216x288/50918b57c9/1537325968?v=1","title":"Beautiful Ruins: A Novel","short_title":"Beautiful Ruins","author":"Jess Walter","tracking":{"object_type":"document","object_id":163564256,"track":"default_editorial","doc_uuid":"fKydGEh5LztlpNu/RBNzGgl470w="},"url":"https://www.scribd.com/book/163564256/Beautiful-Ruins-A-Novel"},{"type":"book","id":182522032,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/182522032/108x144/671b9a055b/1537334459?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/182522032/216x288/ec6eb5c88b/1537334459?v=1","title":"The Bonfire of the Vanities: A Novel","short_title":"The Bonfire of the Vanities","author":"Tom Wolfe","tracking":{"object_type":"document","object_id":182522032,"track":"default_editorial","doc_uuid":"c0t8tqyUc9zLg0rHuMTaBxcmNjU="},"url":"https://www.scribd.com/book/182522032/The-Bonfire-of-the-Vanities-A-Novel"},{"type":"book","id":216442529,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/216442529/108x144/7945e537de/1537257634?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/216442529/216x288/95db88293e/1537257634?v=1","title":"Lovers at the Chameleon Club, Paris 1932: A Novel","short_title":"Lovers at the Chameleon Club, Paris 1932","author":"Francine Prose","tracking":{"object_type":"document","object_id":216442529,"track":"default_editorial","doc_uuid":"coyXlqjdy9NQ3z39Y1u38wvFGZ8="},"url":"https://www.scribd.com/book/216442529/Lovers-at-the-Chameleon-Club-Paris-1932-A-Novel"},{"type":"book","id":224266633,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/224266633/108x144/d0de7b5bf4/1537314478?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/224266633/216x288/a40600a76d/1537314478?v=1","title":"The Perks of Being a Wallflower","short_title":"The Perks of Being a Wallflower","author":"Stephen Chbosky","tracking":{"object_type":"document","object_id":224266633,"track":"default_editorial","doc_uuid":"UyGKMcQHa/HbSiWlF2FulLCJ7OQ="},"url":"https://www.scribd.com/book/224266633/The-Perks-of-Being-a-Wallflower"},{"type":"book","id":163603389,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163603389/108x144/9281c90791/1537326465?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/word_document/163603389/216x288/a0de7e7dea/1537326465?v=1","title":"A Prayer for Owen Meany: A Novel","short_title":"A Prayer for Owen Meany","author":"John Irving","tracking":{"object_type":"document","object_id":163603389,"track":"default_editorial","doc_uuid":"oWSMIeQgLh8f0RDEv+BzLT4+K0M="},"url":"https://www.scribd.com/book/163603389/A-Prayer-for-Owen-Meany-A-Novel"},{"type":"book","id":163647832,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163647832/108x144/9f4ce0c73a/1537326613?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/163647832/216x288/c8974e0a45/1537326613?v=1","title":"The Cider House Rules","short_title":"The Cider House Rules","author":"John Irving","tracking":{"object_type":"document","object_id":163647832,"track":"default_editorial","doc_uuid":"umE0KzCL1yBwhGGkMSfeEm9p21w="},"url":"https://www.scribd.com/book/163647832/The-Cider-House-Rules"},{"type":"book","id":249309690,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249309690/108x144/48e07febe4/1537265011?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/word_document/249309690/216x288/aa98599d5e/1537265011?v=1","title":"Everything Is Illuminated","short_title":"Everything Is Illuminated","author":"Jonathan Safran Foer","tracking":{"object_type":"document","object_id":249309690,"track":"default_editorial","doc_uuid":"LIpTOIOVtP4yDkvjxQY9QIObh60="},"url":"https://www.scribd.com/book/249309690/Everything-Is-Illuminated"}],"title_link":"https://www.scribd.com/lists/17202622/Top-Fiction","title":"Top Fiction on Scribd","track_opts":{"compilation_id":"S40z1n9usGzjSzULiibyGiWExdA=","module_id":"4m7Aec9WzsP7j0BRIwTg1NGoBVk=","widget_name":"document_carousel"}},{"item_props":[{"type":"document","id":240764138,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240764138/108x144/98772d196c/1412512074?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240764138/216x288/559d63987d/1412512074?v=1","title":"Sap Abap Reports","short_title":"Sap Abap Reports","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240764138,"track":"from_user","doc_uuid":"UqmKtz4JQV9zXKuijNhdSrXnPic="},"url":"https://www.scribd.com/doc/240764138/Sap-Abap-Reports"},{"type":"document","id":240763929,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763929/108x144/c31fda41b3/1411533882?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763929/216x288/bc4445641a/1411533882?v=1","title":"SUBTRACT Code Abap","short_title":"SUBTRACT Code Abap","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763929,"track":"from_user","doc_uuid":"rXVmhK0aLe3cDj+Zjh+Af6MMgjc="},"url":"https://www.scribd.com/doc/240763929/SUBTRACT-Code-Abap"},{"type":"document","id":240763691,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763691/108x144/df8dc57378/1411533698?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763691/216x288/d21d9d50fc/1411533698?v=1","title":"Complete Reference to ABAP Basics","short_title":"Complete Reference to ABAP Basics","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763691,"track":"from_user","doc_uuid":"DZoJobZ75G1wUoRG8ZL3HBf/acQ="},"url":"https://www.scribd.com/doc/240763691/Complete-Reference-to-ABAP-Basics"},{"type":"document","id":240763610,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763610/108x144/1898b4b5ef/1411533684?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763610/216x288/4130744d40/1411533684?v=1","title":"basis book.pdf","short_title":"basis book.pdf","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763610,"track":"from_user","doc_uuid":"GuzUVKC6ojSHe1vo8n7GdYm9Htw="},"url":"https://www.scribd.com/doc/240763610/basis-book-pdf"},{"type":"document","id":240763487,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/240763487/108x144/86e0129ad7/1411533524?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/240763487/216x288/0c9d68b224/1411533524?v=1","title":"DatabaseConnectionwithSAPBI_BW(DBConnect)","short_title":"DatabaseConnectionwithSAPBI_BW(DBConnect)","author":"Vijay Kumar Pandey","tracking":{"object_type":"document","object_id":240763487,"track":"from_user","doc_uuid":"YHfo8CoD0ikxV9yRQmBy9/fTnHU="},"url":"https://www.scribd.com/doc/240763487/DatabaseConnectionwithSAPBI-BW-DBConnect"}],"title_link":null,"title":"More From Vijay Kumar Pandey","track_opts":{"compilation_id":"S40z1n9usGzjSzULiibyGiWExdA=","module_id":"ogYpQbgKbnJp5DTWH7z0FZMcjzQ=","widget_name":"document_carousel"}}]},"seo_new_docs_recommenders":{"recommenders":[]}},"seo_roadblock_props_path":"/doc-page/seo-roadblock-props/240764024","signup_context":null,"toolbar":{"search_path":"/search-4gen?allowed_pages=1%2C2%2C3%2C10%2C11%2C12%2C17%2C18%2C19&auth_token=jocCosLYjFa6AwKeQ6TlGINwvtw%3D&authenticity_token=vgd8pA%2BzORrG4CnVNi2OKJxvaINpAOQnLRaJuyNjBpDS8O3CGgNeIt%2F52PcAQAg91FDBkvRrQzy25XZTS7A5iA%3D%3D&expires=1537954635&wordDocumentId=240764024&wordUploadId=245263948"},"renewal_nag_props":null}-->