Hi ABAPers,
I'm creating a Dynamic ALV report. I'm having trouble displaying the 5 sub-columns within the month column. Kindly refer the FS I have attached below.
For further reference please refer my code. I'm a fresher so please help me with additional code. Here is my code --
*&---------------------------------------------------------------------*
*& Report ZSP_DYNAMIC
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSP_DYNAMIC.
TABLES:RESB,MAKT,MARC,T024D,MARD,EKPO,EKET,EBAN,PLAF,PBIM,MBEW,PBED,zcust_daywise.
TYPE-POOLS:SLIS.
DATA: fcat TYPE lvc_s_fcat,
it_fcat TYPE lvc_t_fcat,
fcat1 TYPE slis_fieldcat_alv,
it_fcat1 TYPE slis_t_fieldcat_alv,
lout TYPE slis_layout_alv.
TYPES: BEGINOF ty_resb,
MEINS TYPE RESB-MEINS,
bdart TYPE resb-bdart,
matnr TYPE resb-matnr,
werks TYPE resb-werks,
bdter TYPE resb-bdter,
bdmng TYPE resb-bdmng,
ENDOF ty_resb.
TYPES: BEGINOF ty_makt,
matnr TYPE makt-matnr,
spras TYPE makt-spras,
maktx TYPE makt-maktx,
ENDOF ty_makt.
TYPES: BEGINOF ty_marc,
matnr TYPE marc-matnr,
werks TYPE marc-werks,
dispo TYPE marc-dispo,
EISBE TYPE marc-EISBE,
ENDOF ty_marc.
TYPES: BEGINOF ty_T024D,
werks TYPE t024d-werks,
dispo TYPE t024d-dispo,
dsnam TYPE t024d-dsnam,
ENDOF ty_T024D.
TYPES: BEGINOF ty_mard,
matnr TYPE mard-matnr,
werks TYPE mard-werks,
labst TYPE mard-labst,
insme TYPE mard-insme,
ENDOF ty_mard.
TYPES: BEGINOF ty_ekpo,
menge type ekpo-menge,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
loekz TYPE ekpo-loekz,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
elikz TYPE ekpo-elikz,
eglkz TYPE ekpo-eglkz,
ENDOF ty_ekpo.
TYPES: BEGINOF ty_ekET,
ebeln TYPE eket-ebeln,
ebelp TYPE eket-ebelp,
wemng TYPE eket-wemng,
ENDOF ty_ekET.
TYPES: BEGINOF ty_eban,
bstyp TYPE eban-bstyp,
loekz TYPE eban-loekz,
matnr TYPE eban-matnr,
werks TYPE eban-werks,
ebakz TYPE eban-ebakz,
bsmng_snd TYPE eban-bsmng_snd,
ENDOF ty_eban.
TYPES: BEGINOF ty_plaf,
matnr TYPE plaf-matnr,
pwwrk TYPE plaf-pwwrk,
gsmng TYPE plaf-gsmng,
ENDOF ty_plaf.
TYPES: BEGINOF ty_pbim,
matnr TYPE pbim-matnr,
werks TYPE pbim-werks,
bdzei TYPE pbim-bdzei,
ENDOF ty_pbim.
TYPES: BEGINOF ty_pbED,
bdzei TYPE pbed-bdzei,
plnmg TYPE pbed-plnmg,
perxx TYPE pbed-perxx,
ENDOF ty_pbED.
TYPES: BEGINOF ty_mbew,
matnr TYPE mbew-matnr,
bwtar TYPE mbew-bwtar,
verpr TYPE mbew-verpr,
bwtty TYPE mbew-bwtty,
stprv TYPE mbew-stprv,
vplpr TYPE mbew-vplpr,
ENDOF ty_mbew.
TYPES: BEGINOF TY_FINAL,
MATERIAL TYPE RESB-matnr,
MAT_DESC TYPE MAKT-MAKTX,
BUN TYPE RESB-MEINS,
mrp_controler TYPE T024D-DSNAM,
CURRENT_STOCK TYPEC,
safety_stock TYPE marc-EISBE,
OPEN_PO_QTY TYPEC,
gross_requirement TYPE resb-BDMNG,
NET_REQUIRES TYPEC,
BALANCE_STOCK_QTY TYPEC,
dispo type marc-dispo,
labst type mard-labst,
insme type mard-insme,
menge type ekpo-menge,
WEMNG type EKET-WEMNG,
ENDOF TY_FINAL.
DATA: IT_RESB TYPETABLEOF TY_RESB,
IT_MAKT TYPETABLEOF TY_MAKT,
IT_MARC TYPETABLEOF TY_MARC,
IT_T024D TYPETABLEOF TY_T024D,
IT_MARD TYPETABLEOF TY_MARD,
IT_EKPO TYPETABLEOF TY_EKPO,
IT_EKET TYPETABLEOF TY_EKET,
IT_EBAN TYPETABLEOF TY_EBAN,
IT_PLAF TYPETABLEOF TY_PLAF,
IT_PBED TYPETABLEOF TY_PBED,
IT_PBIM TYPETABLEOF TY_PBIM,
IT_MBEW TYPETABLEOF TY_MBEW,
IT_FINAL TYPETABLEOF TY_FINAL,
WA_RESB TYPE TY_RESB,
WA_MAKT TYPE TY_MAKT,
WA_MARC TYPE TY_MARC,
WA_T024D TYPE TY_T024D,
WA_MARD TYPE TY_MARD,
WA_EKPO TYPE TY_EKPO,
WA_EKET TYPE TY_EKET,
WA_EBAN TYPE TY_EBAN,
WA_PLAF TYPE TY_PLAF,
WA_PBED TYPE TY_PBED,
WA_PBIM TYPE TY_PBIM,
WA_MBEW TYPE TY_MBEW,
WA_FINAL TYPE TY_FINAL.
DATA: LV TYPEC,
LV1 TYPEI.
DATA: VALUE1 TYPESTRING.
DATA: col_pos TYPEI,
low TYPE zcust_daywise-PAY_DAY,
high(5) TYPEc.
FIELD-SYMBOLS: <it_final> TYPESTANDARDTABLE.
FIELD-SYMBOLS: <wa_final> typeany.
field-SYMBOLS: <mat_nr> TYPEANY.
FIELD-SYMBOLS: <BUN> TYPEANY.
fiELD-SYMBOLS: <GRSS_RQ> TYPEANY.
fiELD-SYMBOLS: <MAT_DESC> TYPEANY.
fiELD-SYMBOLS: <DISPO> TYPEANY.
fiELD-SYMBOLS: <SAFETY_S> TYPEANY.
fiELD-SYMBOLS: <MRP_CONT> TYPEANY.
fiELD-SYMBOLS: <CRRN_ST> TYPEANY.
fiELD-SYMBOLS: <NET_REQU> TYPEANY.
fiELD-SYMBOLS: <BAL_ST> TYPEANY.
SELECTION-SCREEN: BEGINOFBLOCK A WITHFRAMETITLE B.
SELECT-OPTIONS: MATERIAL FOR RESB-MATNR,
PLANT FOR RESB-WERKS,
s_day FOR zcust_daywise-pay_day.
SELECTION-SCREEN: ENDOFBLOCK A.
START-OF-SELECTION.
PERFORM FIELDCAT.
PERFORMSELECT.
PERFORM DISPLAY.
*&---------------------------------------------------------------------*
*& Form SELECT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
formSELECT .
SELECT MEINS BDART MATNR WERKS BDTER BDMNG FROM RESB INTOTABLE IT_RESB
WHERE MATNR IN MATERIAL
AND WERKS IN PLANT.
IF IT_RESB ISNOTINITIAL.
SELECT matnr sprAs maktx from makt intotable it_makt
forALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
select matnr werks dispo EISBE from marc intotable it_marc
forALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
if it_marc isnotinitial.
select werks dispo dsnam from t024d intotable it_t024d
forALL ENTRIES IN it_marc
where werks = IT_MARC-werks.
endif.
select matnr werks labst insme from mard intotable it_mard
forALL ENTRIES IN it_resb
where matnr = it_resb-matnr.
select MENGE ebeln ebelp loekz matnr werks elikz eglkz from ekpo intotable it_ekpo
FORALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
if it_ekpo isnotINITIAL.
select ebeln ebelp wemng from eket intotable it_eket
FORALL ENTRIES IN it_ekpo
where ebeln = it_ekpo-ebeln.
ENDIF.
select bstyp loekz matnr werks ebakz bsmng_snd from eban intotable it_eban
FORALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
select matnr pwwrk gsmng from plaf intotable it_plaf
FORALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
select matnr werks bdzei from pbim intotable it_pbim
forALL ENTRIES IN it_RESB
where matnr = IT_RESB-matnr.
if it_pbim isnotINITIAL.
select bdzei plnmg perxx from pbed intotable it_pbed
FORALL ENTRIES IN it_pbim
where bdzei = it_pbim-bdzei.
endif.
select matnr bwtar verpr bwtty stprv vplpr from mbew intotable IT_mbew
FORALL ENTRIES IN IT_RESB
where matnr = IT_RESB-matnr.
ENDIF.
LOOPAT IT_RESB INTO WA_RESB.
ASSIGNCOMPONENT'MATERIAL'ofSTRUCTURE<wa_final> to<mat_nr>.
<mat_nr> = WA_RESB-MATNR.
ASSIGNCOMPONENT'BUN'OFSTRUCTURE<wa_final> TO<BUN>.
<BUN> = WA_RESB-MEINS.
"ASSIGN COMPONENT 'GROSS_REQUIREMENT' OF STRUCTURE <wa_final> TO <GRSS_RQ>.
"<GRSS_RQ> = WA_RESB-BDMNG.
* WA_FINAL-MATERIAL = WA_RESB-MATNR.
* WA_FINAL-BUN = WA_RESB-MEINS.
* WA_FINAL-gross_requirement = WA_RESB-BDMNG.
READTABLE it_makt into wa_makt withkey matnr = WA_FINAL-MATERIAL.
ASSIGNCOMPONENT'MAKTX'OFSTRUCTURE<WA_FINAL> TO<MAT_DESC>.
<MAT_DESC> = WA_makt-MAKTX.
"WA_FINAL-MAT_DESC = WA_makt-MAKTX.
READTABLE IT_MARC INTO WA_MARC WITHKEY MATNR = WA_RESB-MATNR
WERKS = WA_RESB-WERKS.
"ASSIGN COMPONENT 'DISPO' OF STRUCTURE <wa_final> TO <DISPO>.
"<DISPO> = WA_MARC-DISPO.
ASSIGNCOMPONENT'SAFETY_STOCK'OFSTRUCTURE<wa_final> TO<SAFETY_S>.
<SAFETY_S> = WA_MARC-EISBE.
* WA_FINAL-DISPO = WA_MARC-DISPO.
*
* WA_FINAL-safety_stock = WA_MARC-EISBE.
READTABLE IT_T024D INTO WA_T024D WITHKEY werks = WA_MARC-WERKS
DISPO = WA_MARC-DISPO.
ASSIGNCOMPONENT'MRP_CONTROLER'OFSTRUCTURE<wa_final> TO<MRP_CONT>.
<MRP_CONT> = WA_T024D-DSNAM.
*
* WA_FINAL-mrp_controler = WA_T024D-DSNAM.
READTABLE IT_MARD INTO WA_MARD WITHKEY matnr = WA_RESB-MATNR
WERKS = WA_RESB-WERKS.
ASSIGNCOMPONENT'CURRENT_STOCK'OFSTRUCTURE<wa_final> TO<CRRN_ST>.
<CRRN_ST> = WA_MARD-LABST + WA_MARD-INSME.
* WA_FINAL-LABST = WA_MARD-LABST.
* WA_FINAL-INSME = WA_MARD-INSME.
*
* WA_FINAL-CURRENT_STOCK = WA_FINAL-LABST + WA_FINAL-INSME.
" ASSIGN COMPONENT 'NET_REQUIRES' OF STRUCTURE <wa_final> TO <NET_REQU>.
"<NET_REQU> = <CRRN_ST> - <GRSS_RQ>.
" ASSIGN COMPONENT 'BALANCE_STOCK_QTY' OF STRUCTURE <wa_final> TO <BAL_ST>.
" <BAL_ST> = <CRRN_ST> - ( <GRSS_RQ> + <SAFETY_S> ).
"WA_FINAL-NET_REQUIRES = WA_FINAL-CURRENT_STOCK - WA_FINAL-gross_requirement.
" WA_FINAL-BALANCE_STOCK_QTY = WA_FINAL-CURRENT_STOCK - ( WA_FINAL-gross_requirement + WA_FINAL-safety_stock ).
* READ TABLE IT_EKPO INTO WA_EKPO WITH KEY MATNR = WA_RESB-MATNR
* WERKS = WA_RESB-WERKS.
*
* WA_FINAL-MENGE = WA_EKPO-MENGE.
*
* READ TABLE IT_EKET INTO WA_EKET WITH KEY EBELN = WA_EKPO-EBELN.
*
* WA_FINAL-WEMNG = WA_EKET-WEMNG.
*
* WA_FINAL-OPEN_PO_QTY = WA_EKPO-MENGE - WA_EKET-WEMNG.
* READ TABLE IT_MBEW INTO WA_MBEW WITH KEY matnr = WA_RESB-MATNR
* WERKS = WA_RESB-WERKS.
*
* IF WA_MBEW-BWTTY = 'S' .
*
* WA_FINAL-NET_REQUIRES_VALUE = WA_MBEW-STPRS.
*
* ELSE.
*
* WA_MBEW-BWTTY = 'V'.
APPEND<WA_FINAL> TO<IT_FINAL>.
.
ENDLOOP.
endform. " SELECT
*&---------------------------------------------------------------------*
*& Form FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form FIELDCAT .
low = s_day-low.
high = s_day-high.
col_pos = 7.
lv = high - low + 1.
DATA: it_data TYPEREFTOdata.
DATA:wa_data TYPEREFTOdata.
fcat-col_pos = '1'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'MATERIAL'.
fcat-seltext = 'MATERIAL'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = '2'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'MAKTX'.
fcat-seltext = 'MATERIAL DISCRRIPTION'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = '3'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'BUN'.
fcat-seltext = 'BUN'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = '4'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'MRP_CONTROLER'.
fcat-seltext = 'MRP CONROLLER'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = '5'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'CURRENT_STOCK'.
fcat-seltext = 'CURRENT STOCK'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = '6'.
fcat-tabname = 'IT_final'.
fcat-fieldname = 'SAFETY_STOCK'.
fcat-seltext = 'SAFETY STOCK'.
APPEND fcat TO it_fcat.
CLEAR fcat.
" fcat-col_pos = '7'.
" fcat-tabname = 'IT_final'.
" fcat-fieldname = 'OPEN_PO_QTY'.
" fcat-seltext = 'OPEN PO QTY'.
" APPEND fcat TO it_fcat.
" CLEAR fcat.
DO LV TIMES.
col_pos = col_pos + 1.
CONCATENATE'MTH' low INTO VALUE1.
fcat-col_pos = col_pos.
fcat-tabname = 'IT_final'.
fcat-fieldname = VALUE1.
fcat-seltext = VALUE1.
APPEND fcat TO it_fcat.
CLEAR fcat.
low = low + 1.
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'NET_REQUIRES'.
* fcat-seltext = 'NET REQUIREMENT'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'BALANCE_STOCK_QTY'.
* fcat-seltext = 'BALANCE STOCK QTY'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'NET REQUIREMENT VALUE'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'SR_NO'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'SAP PLANNED ORDER'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'BALANCE STOCK QTY'.
* APPEND fcat TO it_fcat.
* CLEAR fcat1.
ENDDO.
CALLMETHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
* i_style_table =
it_fieldcatalog = IT_FCAT
* i_length_in_byte =
IMPORTING
ep_table = IT_DATA
* e_style_fname =
EXCEPTIONS
generate_subpool_dir_full = 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.
ASSIGN IT_DATA->* TO<IT_FINAL>.
CREATEDATA WA_DATA LIKELINEOF<IT_FINAL>.
ASSIGN WA_DATA->* TO<WA_FINAL>.
endform. " FIELDCAT
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form DISPLAY .
low = s_day-low.
high = s_day-high.
col_pos = 7.
lv = s_day-high - s_day-low + 1.
DATA: it_data TYPEREFTOdata.
DATA:wa_data TYPEREFTOdata.
fcat1-col_pos = '1'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'MATERIAL'.
fcat1-seltext_m = 'MATERIAL'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '2'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'MAKTX'.
fcat1-seltext_m = 'MATERIAL DISCRRIPTION'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '3'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'BUN'.
fcat1-seltext_m = 'BUN'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '4'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'MRP_CONTROLER'.
fcat1-seltext_m = 'MRP CONROLLER'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '5'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'CURRENT_STOCK'.
fcat1-seltext_m = 'CURRENT STOCK'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '6'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'SAFETY_STOCK'.
fcat1-seltext_m = 'SAFETY STOCK'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
fcat1-col_pos = '7'.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = 'OPEN_PO_QTY'.
fcat1-seltext_m = 'OPEN PO QTY'.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
DO LV TIMES.
col_pos = col_pos + 1.
CONCATENATE'MTH' s_day-low INTO VALUE1.
fcat1-col_pos = col_pos.
fcat1-tabname = 'IT_final'.
fcat1-fieldname = VALUE1.
fcat1-seltext_m = VALUE1.
APPEND fcat1 TO it_fcat1.
CLEAR fcat1.
s_day-low = s_day-low + 1.
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat1-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'NET_REQUIRES'.
* fcat-seltext = 'NET REQUIREMENT'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'BALANCE_STOCK_QTY'.
* fcat-seltext = 'BALANCE STOCK QTY'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'NET REQUIREMENT VALUE'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'SR_NO'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'SAP PLANNED ORDER'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
*
* col_pos = col_pos + 1.
* CONCATENATE 'MONTH' s_day-low INTO VALUE1.
* fcat-col_pos = col_pos.
* fcat-tabname = 'IT_final'.
* fcat-fieldname = 'SR_NO'.
* fcat-seltext = 'BALANCE STOCK QTY'.
* APPEND fcat TO it_fcat.
* CLEAR fcat.
ENDDO.
CALLFUNCTION'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZSP_DYNAMIC'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = IT_FCAT1
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = <IT_FINAL>
* 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