REPORT ysap_alv_grid_display.
TYPE-POOLS: slis.
TABLES: pa0002.
data: tfcat type slis_t_fieldcat_alv,
wfcat type slis_fieldcat_alv.
DATA: BEGIN OF stru,
pernr type pa0002-pernr,
vorna type pa0002-vorna,
nachn type pa0002-nachn,
begda type pa0002-begda,
endda type pa0002-endda,
GBDAT type pa0002-GBDAT,
NATIO type pa0002-NATIO,
end of stru.
data: itab like table of stru initial size 0,
wtab like stru.
SELECT-OPTIONS : pernr FOR pa0002-pernr.
start-of-selection.
select * from pa0002 into corresponding fields of table itab where pernr in pernr.
end-of-selection.
clear wfcat.
wfcat-fieldname = 'PERNR'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'Personnel number'.
append wfcat to tfcat.
clear wfcat.
wfcat-fieldname = 'VORNA'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'First name'.
append wfcat to tfcat.
Clear wfcat.
wfcat-fieldname = 'NACHN'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'Last name'.
append wfcat to tfcat.
clear wfcat.
wfcat-fieldname = 'BEGDA'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'Begin date'.
append wfcat to tfcat.
clear wfcat.
wfcat-fieldname = 'ENDDA'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'End date'.
append wfcat to tfcat.
clear wfcat.
wfcat-fieldname = 'GBDAT'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'DOB'.
append wfcat to tfcat.
clear wfcat.
wfcat-fieldname = 'NATIO'.
wfcat-tabname = 'ITAB'.
wfcat-seltext_m = 'Nationality'.
append wfcat to tfcat.
Clear wfcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
* 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 = tfcat
* 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 = itab
* 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.
Serkan AKKAVAK
Computer Engineer BSc
SAP Department Manager
Contact : serkurumsal@yandex.com
0 Comments