Unterprogramme ermitteln

Dieses kleine Programm ermittelt zu einem Programm/ Modulpool alle Unterprogramme und gibt sie aus. Dies ist eventuell für Dokumentationen ganz nützlich.

Alternativ kann auch der Baustein RS_PROGRAM_INDEX verwendet werden. Umd die Routine dann genauer zu lokalisieren, verwenden Sie am besten den Baustein RS_SEARCH_FORM.

DATA lt_source TYPE TABLE OF string.
DATA lt_struc TYPE STANDARD TABLE OF sstruc.
DATA lt_token TYPE STANDARD TABLE OF stokes.
DATA lt_stats TYPE STANDARD TABLE OF sstmnt.
DATA lt_level TYPE STANDARD TABLE OF slevel.
DATA lv_index TYPE i.
FIELD-SYMBOLS <token> TYPE stokes.
FIELD-SYMBOLS <uprog> TYPE stokes.

*** Selection screen
PARAMETERS P_REPID TYPE REPID.

START-OF-SELECTION.

*** Read report source
READ REPORT p_repid INTO lt_source.

*** Scan report
SCAN ABAP-SOURCE lt_source WITH INCLUDES
     TOKENS     INTO lt_token
     STATEMENTS INTO lt_stats
     STRUCTURES INTO lt_struc
     LEVELS     INTO lt_level.

*** find subroutines
LOOP AT lt_token ASSIGNING <token> WHERE str = ‚FORM‘.
  lv_index = sy-tabix + 1.
  READ TABLE lt_token ASSIGNING <uprog> INDEX lv_index.
  WRITE: / <uprog>-str.
ENDLOOP.

 

image_pdfimage_print