TYPES : BEGIN OF ty_dd02l, icon type icon_d, tabname TYPE tabname, tabclass TYPE tabclass, contflag type contflag, actflag type actflag, mainflag type maintflag, buffered type buffered, as4user type as4user, as4date type as4date, as4time type as4time, expand, END OF ty_dd02l.
DATA : it_dd02l TYPE STANDARD TABLE OF ty_dd02l, wa_dd02l TYPE ty_dd02l.
TYPES : BEGIN OF ty_dd03l, tabname TYPE tabname, fieldname TYPE fieldname, keyflag type keyflag, mandatory type mandatory, checktable type checktable, rollname type rollname, END OF ty_dd03l.
DATA : it_dd03l TYPE STANDARD TABLE OF ty_dd03l, wa_dd03l TYPE ty_dd03l.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv, wa_fieldcat TYPE slis_fieldcat_alv, it_layout TYPE slis_layout_alv, key TYPE slis_keyinfo_alv.
SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
INITIALIZATION.
START-OF-SELECTION.
PERFORM fetch_tabledata.
PERFORM hierarchyalv_build.
*&---------------------------------------------------------------------* *& Form hierarchyalv_build *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form hierarchyalv_build .
perform build_fieldcat.
perform build_layout.
perform build_key.
perform list_display.
endform. *&---------------------------------------------------------------------* *& Form build_fieldcat *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_fieldcat .
endform. " build_fieldcat *&---------------------------------------------------------------------* *& Form build_layout *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_layout .
*to expand the header table for item details it_layout-expand_fieldname = 'EXPAND'.
endform. " build_layout *&---------------------------------------------------------------------* *& Form build_key *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_key .
*key infomation for the header and item table key-header01 = 'TABNAME'. key-item01 = 'TABNAME'.
endform. " build_key
*&---------------------------------------------------------------------* *& Form list_display *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form list_display .
endform. " list_display *&---------------------------------------------------------------------* *& Form fetch_tabledata *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form fetch_tabledata .
*select table data SELECT tabname tabclass contflag actflag mainflag buffered as4user as4date as4time FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l WHERE tabname IN s_table.
*select field data IF it_dd02l[] IS NOT INITIAL.
SELECT tabname fieldname keyflag mandatory checktable rollname FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l FOR ALL ENTRIES IN it_dd02l WHERE tabname EQ it_dd02l-tabname.
ENDIF.
loop at it_dd02l into wa_dd02l.
at new tabname.
wa_dd02l-icon = '@3M@'.
MODIFY it_dd02l FROM wa_dd02l TRANSPORTING icon WHERE tabname EQ wa_dd02l-tabname. CLEAR : wa_dd02l.
Social Plugin