Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Finding Hard coded Text in ABAP program

Former Member
0 Likes
7,086

Gurus,

Is there any method to find out Hard coded TEXT in an abap Program? For Example

*************************************

write:/ TEXT-T01,

'Hello World',TEXT-T02.

*************************************

In which i need to find out Hello world which is inside ''. I am not able to find with Search command.

Can you Please guide me,

Regards,

Lijo Joseph

Message was edited by: Lijo Joseph vazhappilly

14 REPLIES 14
Read only

Former Member
0 Likes
4,107

Hi,

Just enter into the Program through Transaction Code SE38 and choose Goto->Text Elements->Text Symbols.

I hope this might help you to find out the Word assigned to a text symbol.

Regards,

Anbu

Read only

0 Likes
4,107

Anbalagan,

I need to find out Text literals (Hard coded Texts)through program not manually.

Regards,

Lijo Joseph

Read only

0 Likes
4,107

HI,

I think u can do that by parsing the whole pogram on the required criteria..and find out the literals..

Regards,

Sudheer..

Read only

Former Member
0 Likes
4,107

Hi,

Double click on the Text element. It will take U

to the TEXT associated with it.

Regards,

GSR.

Read only

Former Member
0 Likes
4,107

try ctrl-f and type the search key in that. but this wont work if the required words are in the text element.

Read only

0 Likes
4,107

check out this program

RPR_ABAP_SOURCE_SCAN which will help you to implement this search programatically

Regards

Raja

Read only

0 Likes
4,107

Raja,

Program RPR_ABAP_SOURCE_SCAN is giving the line number. But what i need is the exact position including the column number. Is that possible?

Thanks&Regards,

Lijo Joseph

Read only

0 Likes
4,107

try this.

data: report_pg type SY-REPID ,

rpt_source type standard table of D022S .

REFRESH rpt_source .

move: <rpt name> to report_pg .

READ REPORT report_pg INTO rpt_source .

now do a search/find in rpt_source.

Regards

Raja

Read only

Former Member
0 Likes
4,107

HI,

Use the standard program : RSRSCAN1 for searching the string in any ABAP programs.

If you want to search hard coded text in custome programs,Then enter Z* in the program parameter and enter the hard coded string in "Find string parameter".

Hope this will be helpful.

Read only

Former Member
0 Likes
4,107

Go to SE38 in menu Utilities -> Find in source code or Use program SAPLS_SEARCH.

Read only

0 Likes
4,107

Just do "Program>Check>Extended Program Check". Check all the boxes and execute. It will tell you all those literals which are hardcoded like this with a warning saying that they may not be translated. You don't need to do anything else.

Read only

0 Likes
4,107

u can just call transaction SLIN.

Read only

0 Likes
4,107

REPORT  zrtext.

TABLES :rs38m,textpool.

DATA : BEGIN OF i_tab OCCURS 0,

         name TYPE  progname.

         INCLUDE STRUCTURE textpool.

DATA END OF i_tab.

DATA : texts  LIKE textpool OCCURS 50 WITH HEADER LINE,

        w_text LIKE textpool.

DATA : it LIKE LINE OF i_tab OCCURS 0,

        lines TYPE i,

        myalv TYPE REF TO cl_salv_table,

        myfunctions TYPE REF TO cl_salv_functions_list,

        mycolumns TYPE REF TO cl_salv_columns_table.

SELECTION-SCREEN : BEGIN OF BLOCK b WITH FRAME TITLE text-001.

SELECT-OPTIONS : zprg FOR rs38m-programm.

SELECTION-SCREEN : END OF BLOCK b.

START-OF-SELECTION.

   SELECT progname FROM reposrc INTO i_tab-name WHERE progname IN zprg.

     READ TEXTPOOL i_tab-name INTO texts LANGUAGE 'E'.

     LOOP AT texts INTO w_text . "WHERE id EQ 'I'.

       MOVE-CORRESPONDING w_text TO i_tab.

       APPEND i_tab TO i_tab.

     ENDLOOP.

   ENDSELECT.

   it[] = i_tab[].

   TRY.

       CALL METHOD cl_salv_table=>factory

         IMPORTING

           r_salv_table = myalv

         CHANGING

           t_table      = it[].

     CATCH cx_salv_msg.

   ENDTRY.

   DESCRIBE TABLE i_tab LINES lines.

   MESSAGE s375(po) WITH lines '' 'records found..'.

   mycolumns = myalv->get_columns( ).

   mycolumns->set_optimize( ).

   myfunctions = myalv->get_functions( ).

   myfunctions->set_all( ).

   CALL METHOD myalv->display.


This code will show you all the Text Symbols & Report Title & Selection Text of the reports..



Give Reward and like if ans is usefull

Read only

mayur_priyan
Active Participant
0 Likes
4,107

Hi,

Please execute the SLIN T-code for your program and check(tick) the parameter 'Character Strings' and execute. You will be able to find all the Hard-coded values under the 'Messages' Column of the row Character strings.