on 06-28-2012 5:17 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.