SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

How to Search (any text) in (any number of the reports)



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Sep 13, 2008 6:33 pm    Post subject: How to Search (any text) in (any number of the reports) Reply with quote

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.


    ENDLOOP.
  ENDIF.
ENDFORM.                    "read_repo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.