REPORT ZCUSTOMER_REPORT_LIST_ALV.
TYPE-POOLS: SLIS.
TABLES: KNA1.
TYPES: BEGIN OF ST_KNA1,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1_GP,
ORT01 TYPE ORT01_GP,
END OF ST_KNA1.
DATA: IT_KNA1 TYPE STANDARD TABLE OF ST_KNA1,
W_KNA1 TYPE ST_KNA1,
IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
W_FCAT TYPE SLIS_FIELDCAT_ALV.
SELECT-OPTIONS: S_KUNNR FOR KNA1-KUNNR.
parameters: rb1 radiobutton group g1,
rb2 radiobutton group g1.
W_FCAT-COL_POS = '1'.
W_FCAT-FIELDNAME = 'KUNNR'.
W_FCAT-SELTEXT_M = 'Cust Number'.
append W_FCAT TO IT_FCAT.
W_FCAT-COL_POS = '2'.
W_FCAT-FIELDNAME = 'NAME1'.
W_FCAT-SELTEXT_M = 'Cust Name'.
append W_FCAT TO IT_FCAT.
W_FCAT-COL_POS = '3'.
W_FCAT-FIELDNAME = 'ORT01'.
W_FCAT-SELTEXT_M = 'City'.
append W_FCAT TO IT_FCAT.
SELECT KUNNR
NAME1
ORT01 FROM KNA1
INTO TABLE IT_KNA1
WHERE KUNNR IN S_KUNNR.
IF RB1 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = it_fcat
TABLES
t_outtab = it_kna1
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSEIF RB2 = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_STRUCTURE_NAME =
* IS_LAYOUT =
IT_FIELDCAT = IT_FCAT
* 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
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_KNA1
* 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.
ENDIF.
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Team Lead
Contact : serkurumsal@yandex.com
Social Plugin