Posted: Sat Sep 13, 2008 6:33 pm Post subject: How to Search (any text) in (any number of the reports)
Code:
REPORT zutil NO STANDARD PAGE HEADING.
SELECT-OPTIONS: so_repo FOR sy-repid.
PARAMETERS: pa_f_01 TYPE char20,
pa_f_02 TYPE char20.
DATA: gt_trdir TYPE STANDARD TABLE OF d010sinf.
FIELD-SYMBOLS: <fs_trdir> LIKE LINE OF gt_trdir.
TYPES: ty_tab(70) TYPE c.
DATA: gt_tab TYPE TABLE OF ty_tab.
FIELD-SYMBOLS: <fs_tab> LIKE LINE OF gt_tab.
START-OF-SELECTION.
SELECT * FROM d010sinf INTO TABLE gt_trdir
WHERE prog IN so_repo
AND r3state = 'A' .
IF sy-subrc = 0.
LOOP AT gt_trdir ASSIGNING <fs_trdir>.
FORMAT COLOR COL_TOTAL ON.
WRITE:/ 'PROGRAM: ',<fs_trdir>-prog.
FORMAT COLOR OFF.
PERFORM get_includes USING <fs_trdir>-prog.
PERFORM read_repo USING <fs_trdir>-prog.
ENDLOOP.
ENDIF.
END-OF-SELECTION.
AT LINE-SELECTION.
DATA: lv_name TYPE programm.
lv_name = sy-lisel+9.
CONDENSE lv_name.
SET PARAMETER ID 'RID' FIELD lv_name.
CALL TRANSACTION 'SE38' AND SKIP FIRST SCREEN.
*---------------------------------------------------------------------*
* FORM get_includes *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> PROG *
*---------------------------------------------------------------------*
FORM get_includes USING prog.
DATA: gt_trdirt TYPE TABLE OF trdirt.
FIELD-SYMBOLS: <fs_trdirt> LIKE LINE OF gt_trdirt.
CALL FUNCTION 'MWGT_SEARCH_INCLUDES'
EXPORTING
i_progr = prog
TABLES
o_incl_progs = gt_trdirt
EXCEPTIONS
prog_not_exist = 1
prog_has_no_coding = 2
OTHERS = 3.
IF sy-subrc = 0.
LOOP AT gt_trdirt ASSIGNING <fs_trdirt>.
PERFORM get_includes USING <fs_trdirt>-name.
PERFORM read_repo USING <fs_trdirt>-name.
ENDLOOP.
ENDIF.
ENDFORM. "get_includes
*---------------------------------------------------------------------*
* FORM read_repo *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> PROG *
*---------------------------------------------------------------------*
FORM read_repo USING prog.
READ REPORT prog INTO gt_tab.
IF sy-subrc = 0.
LOOP AT gt_tab ASSIGNING <fs_tab>.
SEARCH <fs_tab> FOR pa_f_01.
IF sy-subrc = 0.
FORMAT COLOR COL_KEY ON.
WRITE:/ 'INCLUDE: ', prog HOTSPOT.
FORMAT COLOR OFF.
WRITE:/ sy-tabix,<fs_tab>.
ENDIF.
SEARCH <fs_tab> FOR pa_f_02.
IF sy-subrc = 0.
FORMAT COLOR COL_KEY ON.
WRITE:/ 'INCLUDE: ', prog HOTSPOT.
FORMAT COLOR OFF.
WRITE:/ sy-tabix,<fs_tab>.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.