This post shows how to display a hierarchical sequential list ALV. TABLES: MARA,MAKT. TYPE-POOLS: SLIS. TYPES: BEGIN OF ST_MARA,
EXPAND,
MATNR TYPE MATNR,
ERSDA TYPE ERSDA,
ERNAM TYPE ERNAM, END OF ST_MARA.
TYPES: BEGIN OF ST_MAKT,
MATNR TYPE MATNR,
SPRAS TYPE SPRAS,
MAKTX TYPE MAKTX, END OF ST_MAKT.
DATA: IT_MARA TYPE TABLE OF ST_MARA,
WA_MARA TYPE MARA,
IT_MAKT TYPE TABLE OF ST_MAKT,
WA_MAKT TYPE MAKT.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT TYPE SLIS_FIELDCAT_ALV.
DATA: WA_KEY TYPE SLIS_KEYINFO_ALV. DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT MATNR
ERSDA
ERNAM FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0. SORT IT_MARA BY MATNR. ENDIF.
IF IT_MARA IS NOT INITIAL. SELECT MATNR
SPRAS
MAKTX FROM MAKT INTO TABLE IT_MAKT FOR ALL ENTRIES IN IT_MARA WHERE MATNR = IT_MARA-MATNR.
IF SY-SUBRC = 0. SORT IT_MAKT BY MATNR. ENDIF. ENDIF.
Social Plugin