REPORT zematest.
TABLES pmmo_assignment.
TABLES sscrfields.
INCLUDE rpmmo_last_variant.
INCLUDE rpmmo_rtm_macros.
TYPES BEGIN OF ty_comp.
TYPES name TYPE c LENGTH 60.
TYPES END OF ty_comp.
TYPES ty_comp_tab TYPE STANDARD TABLE OF ty_comp.
DATA gt_tokens TYPE stokes_tab.
DATA gv_grpnr TYPE ps_posid.
DATA gv_class TYPE bdc_fval. "seoclsname.
DATA gv_subclass TYPE bdc_fval. "seoclsname.
DATA gv_method TYPE bdc_fval. "abap_methname.
DATA gv_stat TYPE j_status.
DATA gv_tst TYPE c LENGTH 50.
CLASS lcl_test DEFINITION DEFERRED.
SELECTION-SCREEN FUNCTION KEY 1. "for last used variant
PARAMETERS p_form TYPE char30.
PARAMETERS p_brk TYPE pmmo_assignment-objnr_brk MATCHCODE OBJECT zpmmo_break_point_coll_sh NO-DISPLAY.
SELECT-OPTIONS so_cron FOR pmmo_assignment-creationdatetime NO-DISPLAY.
SELECT-OPTIONS so_tst FOR gv_tst VISIBLE LENGTH 25 NO-DISPLAY.
SELECT-OPTIONS so_stat FOR gv_stat MATCHCODE OBJECT h_tj02 NO-DISPLAY.
SELECT-OPTIONS p_class FOR gv_class NO-DISPLAY.
INITIALIZATION.
lcl_last_variant=>get( ).
PERFORM get_default_form.
FORM get_default_form.
DATA lt_source TYPE string_table.
DATA lt_statements TYPE sstmnt_tab.
DATA lt_keywords TYPE STANDARD TABLE OF char30.
DATA lt_report TYPE STANDARD TABLE OF sy-repid.
DATA lv_form TYPE c LENGTH 6.
lt_keywords = VALUE #( ( 'FORM' ) ).
READ REPORT sy-repid INTO lt_source.
SCAN ABAP-SOURCE lt_source
TOKENS INTO gt_tokens
STATEMENTS INTO lt_statements
FRAME PROGRAM FROM sy-repid
KEYWORDS FROM lt_keywords
WITH INCLUDES.
SORT gt_tokens BY str DESCENDING.
LOOP AT gt_tokens INTO DATA(ls_token).
lv_form = ls_token-str.
IF lv_form(4) = 'TEST'.
IF lv_form+4(2) CN '0123456789'.
DELETE gt_tokens.
ENDIF.
ELSE.
DELETE gt_tokens.
ENDIF.
ENDLOOP.
p_form = gt_tokens[ 1 ]-str.
ENDFORM.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_form.
PERFORM f4_form.
FORM f4_form.
TYPES BEGIN OF ty_form.
TYPES name TYPE char30.
TYPES END OF ty_form.
DATA lt_form TYPE STANDARD TABLE OF ty_form.
LOOP AT gt_tokens INTO DATA(ls_token).
APPEND ls_token-str TO lt_form.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_FORM'
window_title = 'Select a FORM routine for Testing'
value_org = 'S'
TABLES
value_tab = lt_form
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
ENDFORM.
START-OF-SELECTION.
lcl_last_variant=>save( ).
PERFORM (p_form) IN PROGRAM (sy-repid) IF FOUND.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |