cancel
Showing results for 
Search instead for 
Did you mean: 

Using assistance class for text symbols

Former Member
0 Kudos

Hi Everyone,

I am aware that we can use assistance class to maintain text symbols in webdynpro and call

wd_assist->if_wd_component_assistance~get_text( key = 'XXX' ) method to get them in the application. If suppose in a method, I need to replace text for a large number of hard coded text, I am having to declare that many string variables and assign text symbol like below.

lv_text = wd_assist->if_wd_component_assistance~get_text( key = 'XXX' ). Is there any alternate solution for this?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi ajith,

Ley say if you have 100 text elements in assistance class, instead of calling method

wd_assist->if_wd_component_assistance~get_text( key = 'XXX' ) each time, I would suggest you one work around.

Create one method get_texts in the assistance class and write the below code.

DATA : classname TYPE char32 VALUE 'ZWD_ASST_CLASS',  " your assistance class name

           lt_table    TYPE TABLE OF textpool,

           lang        TYPE spras VALUE 'E'.

classname+30(2) = 'CP'.

TRANSLATE classname USING ' ='.

READ TEXTPOOL classname INTO lt_table LANGUAGE lang.

this will read all the text elements of class. even if you add net text element also no need to change your class code.

Now in your web dynpro component call this method and create a global internal table in component controller and set the text elements to that.

Now where ever required read the global internal table of component controller instead of calling the method wd_assist->if_wd_component_assistance~get_text each time

Hope this helps u.,

Thanks & Regards,

Kiran


Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ajit...

Make use of SO10 ..

->Create text object in SO10

->Do coding like below...

     data:      lt_tline type table of tline,

               ls_tline type tline,

                lv_string type string.

1. use 'READ_TEXT' FM to get text from SO10 which give you TLINE format table (lt_tline).

loop at lt_tline into ls_tline.

      concatenate lv_string ls_tline-tdline into lv_string.

      clear: ls_tline.

endloop.

2. Now lv_string contains full text of SO10.

            3. Bind lv_string to textedit UI element text.

Regards,

Venkat