Skip to Content
author's profile photo Former Member
Former Member

Finding all programs having particualr string in its Text symbols...

Hello Gurus,

If I want to search the string in ABAP code , I know I can use program RPR_ABAP_SOURCE_SCAN.

But I want to find all SAP programs in which the text-symbols is defined by a particular string. How can I do that ?

Please help....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 09, 2008 at 08:04 PM

    Hello Rajesh

    A function module which provides you will all text elements of a single report is RPY_PROGRAM_READ.

    Given this fm it is quite simple to write a report for your requirement:

    *&---------------------------------------------------------------------*
    *& Report  ZUS_SDN_READ_TEXT_ELEMENTS
    *&
    *&---------------------------------------------------------------------*
    *& Thread: Finding all programs having particualr string in its Text symbols...
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="814207"></a>
    *&---------------------------------------------------------------------*
    
    REPORT  zus_sdn_read_text_elements.
    
    
    TABLES: trdir.
    
    
    TYPES: BEGIN OF ty_s_outtab.
    TYPES: name   TYPE trdir-name.
    INCLUDE TYPE textpool     AS text.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                        WITH DEFAULT KEY.
    
    DATA: gt_outtab     TYPE ty_t_outtab,
          gs_outtab     TYPE ty_s_outtab,
          gt_fcat       TYPE lvc_t_fcat.
    
    
    DATA: gt_trdir      TYPE STANDARD TABLE OF trdir,
          gs_trdir      TYPE trdir.
    
    DATA: gt_textpool   TYPE STANDARD TABLE OF textpool.
    
    DATA: gd_count      TYPE i,
          gd_perc       TYPE i,
          gd_text(50)   TYPE c.
    
    
    SELECT-OPTIONS:
      o_report    FOR trdir-name.
    
    START-OF-SELECTION.
    
      IF ( o_report[] IS INITIAL ).
      ELSE.
        SELECT * FROM  trdir INTO TABLE gt_trdir
               WHERE  name  IN o_report.
      ENDIF.
      CHECK ( gt_trdir IS NOT INITIAL ).
    
      DESCRIBE TABLE gt_trdir.
      gd_count = syst-tfill.
    
    
      LOOP AT gt_trdir INTO gs_trdir.
        gd_perc = ( syst-tabix * 100 ) / gd_count.
        gd_text = gs_trdir-name.
    
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = gd_perc
            text       = gd_text.
    
    
        REFRESH: gt_textpool.
        CALL FUNCTION 'RPY_PROGRAM_READ'
          EXPORTING
    *         LANGUAGE                  = SY-LANGU
            program_name              = gs_trdir-name
            with_includelist          = ' '
    *         ONLY_SOURCE               = ' '
            only_texts                = 'X'
    *         READ_LATEST_VERSION       = ' '
    *         WITH_LOWERCASE            = ' '
    *       IMPORTING
    *         PROG_INF                  =
          TABLES
    *         INCLUDE_TAB               =
    *         SOURCE                    =
    *         SOURCE_EXTENDED           =
            textelements              = gt_textpool
          EXCEPTIONS
            cancelled                 = 1
            not_found                 = 2
            permission_error          = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        DELETE gt_textpool WHERE ( id NE 'I ' ).  " keep only text elements
    
        CLEAR: gs_outtab.
        gs_outtab-name = gs_trdir-name.
        LOOP AT gt_textpool INTO gs_outtab-text.
          APPEND gs_outtab TO gt_outtab.
        ENDLOOP.
    
      ENDLOOP.
    
      PERFORM build_fieldcatalog.
    
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *       I_INTERFACE_CHECK                 = ' '
    *       I_BYPASSING_BUFFER                =
    *       I_BUFFER_ACTIVE                   =
    *       I_CALLBACK_PROGRAM                = ' '
    *       I_CALLBACK_PF_STATUS_SET          = ' '
    *       I_CALLBACK_USER_COMMAND           = ' '
    *       I_CALLBACK_TOP_OF_PAGE            = ' '
    *       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *       I_CALLBACK_HTML_END_OF_LIST       = ' '
    *       i_structure_name                  =  
    *       I_BACKGROUND_ID                   = ' '
    *       I_GRID_TITLE                      =
    *       I_GRID_SETTINGS                   =
    *       IS_LAYOUT_LVC                     =
            it_fieldcat_lvc                   = gt_fcat
    *       IT_EXCLUDING                      =
    *       IT_SPECIAL_GROUPS_LVC             =
    *       IT_SORT_LVC                       =
    *       IT_FILTER_LVC                     =
    *       IT_HYPERLINK                      =
    *       IS_SEL_HIDE                       =
    *       I_DEFAULT                         = 'X'
    *       I_SAVE                            = ' '
    *       IS_VARIANT                        =
        TABLES
          t_outtab                          = gt_outtab
        EXCEPTIONS
          program_error                     = 1
          OTHERS                            = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
    
    
    END-OF-SELECTION.
    *&---------------------------------------------------------------------*
    *&      Form  BUILD_FIELDCATALOG
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM build_fieldcatalog .
    * define local data
      DATA: ls_fcat   TYPE lvc_s_fcat,
            lt_fcat   TYPE lvc_t_fcat.
    
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'TRDIR'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
      DELETE gt_fcat WHERE ( fieldname NE 'NAME' ).
    
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
    *     I_BUFFER_ACTIVE              =
        i_structure_name             = 'TEXTPOOL'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
      CHANGING
        ct_fieldcat                  = gt_fcat
      EXCEPTIONS
        inconsistent_interface       = 1
        program_error                = 2
        OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    
    ENDFORM.                    " BUILD_FIELDCATALOG
    

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 09, 2008 at 12:39 AM

    Hi,

    For that there is no standard program available in SAP, but you can create your own small program and in it use READ TEXTPOOL.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.