Home SAP ABAP Interactive ALV for Delivery Data
SAP ABAP Interactive ALV for Delivery Data
REPORT Z_DEL_INTR_ALV.
*TABLES: LIKP, LIPS.
*TYPE-POOLS: SLIS.
*&---------------------------------------------------------------------*
*& DECLARATION - Structures
*&---------------------------------------------------------------------*
TYPES: BEGIN OF ST_LIKP,
VBELN TYPE VBELN_VL,
ERDAT TYPE ERDAT,
ERZET TYPE ERZET,
ERNAM TYPE ERNAM,
END OF ST_LIKP,
BEGIN OF ST_LIPS,
VBELN TYPE VBELN_VL,
POSNR TYPE POSNR_VL,
PSTYV TYPE PSTYV_VL,
END OF ST_LIPS.
DATA: IT_LIKP TYPE STANDARD TABLE OF ST_LIKP,
IT_LIPS TYPE STANDARD TABLE OF ST_LIPS,
IT_FCT1 TYPE SLIS_T_FIELDCAT_ALV,
IT_FCT2 TYPE SLIS_T_FIELDCAT_ALV,
WA_LIKP TYPE ST_LIKP,
WA_LIPS TYPE ST_LIPS,
WA_FCT1 TYPE SLIS_FIELDCAT_ALV,
WA_FCT2 TYPE SLIS_FIELDCAT_ALV.
SELECT-OPTIONS: S_VBELN FOR WA_LIKP-VBELN.
SELECT VBELN
ERDAT
ERZET
ERNAM FROM LIKP
INTO TABLE IT_LIKP
WHERE VBELN IN S_VBELN.
WA_FCT1-COL_POS = '1'.
WA_FCT1-FIELDNAME = 'VBELN'.
WA_FCT1-SELTEXT_M = 'Delivery No'.
append wa_fct1 to it_fct1.
WA_FCT1-COL_POS = '2'.
WA_FCT1-FIELDNAME = 'ERNAM'.
WA_FCT1-SELTEXT_M = 'Created By'.
append wa_fct1 to it_fct1.
WA_FCT1-COL_POS = '3'.
WA_FCT1-FIELDNAME = 'ERZET'.
WA_FCT1-SELTEXT_M = 'Created Time'.
append wa_fct1 to it_fct1.
WA_FCT1-COL_POS = '4'.
WA_FCT1-FIELDNAME = 'ERDAT'.
WA_FCT1-SELTEXT_M = 'Created Date'.
append wa_fct1 to it_fct1.
WA_FCT2-COL_POS = '1'.
WA_FCT2-FIELDNAME = 'VBELN'.
WA_FCT2-SELTEXT_M = 'Delivery No'.
APPEND WA_FCT2 TO IT_FCT2.
WA_FCT2-COL_POS = '2'.
WA_FCT2-FIELDNAME = 'POSNR'.
WA_FCT2-SELTEXT_M = 'Deli Item'.
APPEND WA_FCT2 TO IT_FCT2.
WA_FCT2-COL_POS = '3'.
WA_FCT2-FIELDNAME = 'PSTYV'.
WA_FCT2-SELTEXT_M = 'Del Item Cat'.
APPEND WA_FCT2 TO IT_FCT2.
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 = 'SECOND'
* 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_FCT1
* 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_LIKP
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
FORM SECOND USING C LIKE SY-UCOMM
D TYPE SLIS_SELFIELD.
READ TABLE IT_LIKP INTO WA_LIKP INDEX D-TABINDEX.
select vbeln posnr pstyv from lips
into table it_lips
where vbeln = Wa_LIKP-vbeln.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* 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_fct2
* 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_lips
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM.
Serkan AKKAVAK Computer Engineer ABAP Developer & SAP S/4 HANA Logistics Team Lead Contact : serkurumsal@yandex.com
Social Plugin