TABLES: dd26s.
DATA: ctr1 TYPE i,
ctr2 TYPE i,
col TYPE i.
DATA: BEGIN OF itab OCCURS 0,
viewname TYPE viewname,
tabname TYPE vibastab,
END OF itab.
DATA: vtabs TYPE vibastab OCCURS 0 WITH HEADER LINE.
RANGES: r_tab FOR dd26s-tabname.
PARAMETERS: p_tab1 TYPE vibastab OBLIGATORY,
p_tab2 TYPE vibastab,
p_tab3 TYPE vibastab,
p_tab4 TYPE vibastab,
p_tab5 TYPE vibastab.
START-OF-SELECTION.
PERFORM fill_table_range.
PERFORM select_views.
FORMAT COLOR 1.
WRITE: / sy-vline,
' View ',
20 sy-vline,
(57) 'Tables' CENTERED,
sy-vline.
ULINE.
LOOP AT itab.
AT NEW viewname.
CLEAR ctr2.
ENDAT.
ctr2 = ctr2 + 1.
AT END OF viewname.
IF ctr2 = ctr1.
PERFORM write_view.
ENDIF.
ENDAT.
ENDLOOP.
ULINE.
AT LINE-SELECTION.
SET PARAMETER ID 'DVI' FIELD itab-viewname.
CALL TRANSACTION 'SE11'.
FORM fill_table_range .
ctr1 = 1.
r_tab-sign = 'I'.
r_tab-option = 'EQ'.
r_tab-low = p_tab1.
APPEND r_tab.
IF NOT p_tab2 IS INITIAL.
r_tab-low = p_tab2.
APPEND r_tab.
ctr1 = ctr1 + 1.
ENDIF.
IF NOT p_tab3 IS INITIAL.
r_tab-low = p_tab3.
APPEND r_tab.
ctr1 = ctr1 + 1.
ENDIF.
IF NOT p_tab4 IS INITIAL.
r_tab-low = p_tab4.
APPEND r_tab.
ctr1 = ctr1 + 1.
ENDIF.
IF NOT p_tab5 IS INITIAL.
r_tab-low = p_tab5.
APPEND r_tab.
ctr1 = ctr1 + 1.
ENDIF.
ENDFORM. " fill_table_range
FORM select_views .
SELECT viewname tabname
FROM dd26s
INTO TABLE itab
WHERE tabname IN r_tab.
SORT itab BY viewname.
ENDFORM. " select_views
FORM write_view .
REFRESH vtabs.
SELECT tabname
FROM dd26s
INTO TABLE vtabs
WHERE viewname = itab-viewname.
IF col = 0.
FORMAT RESET.
col = 1.
ELSE.
FORMAT COLOR 2.
col = 0.
ENDIF.
WRITE: / sy-vline, itab-viewname(16), sy-vline.
HIDE itab-viewname.
DO 5 TIMES.
CLEAR vtabs.
READ TABLE vtabs INDEX sy-index.
WRITE: vtabs(08) NO-GAP, sy-vline.
ENDDO.
READ TABLE vtabs INDEX 6.
IF sy-subrc = 0.
WRITE: '
ELSE.
WRITE: ' ', sy-vline.
ENDIF.
ENDFORM. " write_view
No comments:
Post a Comment