cancel
Showing results for 
Search instead for 
Did you mean: 

Text Symbols in WDA application

ChandraMahajan
Active Contributor
0 Kudos

Hi All,

i want to use Text Symbols in my WD aplication. i read in the WDA documentation that its possible using Assistance class. Could you please guide me step-by-step how to achive the same?

Regards,

Chandra

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Chandrashekhar,

Create a Z class from se24 and make the super class as

CL_WD_COMPONENT_ASSISTANCE

now move to your WD Component and

double click on your component

there is a Assistance class field there you give your Z Class which you created.

and you find an Attribute in the component controller , all the views and windows you create 'WD_ASSIST'

In the Z class you can define your text symbols.

If you observe your Z class there is a method which is inherited

IF_WD_COMPONENT_ASSISTANCE~GET_TEXT to get your Text symbols.

you can use this statement in your views, controllers methods

WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( '000' ).

to get your text-symbol

Regards

Abhimanyu L

Former Member
0 Kudos

i want to ask how to move to your WD Component .

Thanks a lot!

turing.wu

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Chandra,

Go to the Propery window of the WDA component,give a z class name and press enter.

then an assistance class of the given name is automatically created. then double click on that class name.. it will take u to that class.. then goto-> text>symbols-- where u can create text symbols.

Regards

Sarath

Former Member
0 Kudos

Hi Chandra.

Go to your assistance class and then choose goto->text elements. Here you

can add all your text elements (e.g. 001 -> Please enter your name).

In the any controller of you component you have the wd_assist attribute.

To get the text just call:


wd_assist->if_wd_component_assistance~get_text( '001' ).

The get text method takes some more parameters if you want to fill placeholders in your text element.

001 - Order %PARA1% saved.


wd_assist->if_wd_component_assistance~get_text( 
keys =  '001' 
para1 = '18272624524').

You can set up to 4 placeholders.

Hope this helps.

Cheers,

Sascha

UPPS double posting ... sorry

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

Hi, Sascha,

i want to use Text Symbols in my WD aplication with parameter.

The action:

According your document,

1. Code the text and fill placeholders in my text element.

M01 - This is test for %PARA1% .

2. Code in the wddoinit method in my WDA.

METHOD wddoinit .

DATA lo_nd_ee_test TYPE REF TO if_wd_context_node.

DATA lo_el_ee_test TYPE REF TO if_wd_context_element.

DATA ls_ee_test TYPE wd_this->element_ee_test.

DATA lv_test LIKE ls_ee_test-test.

wd_assist->if_wd_component_assistance~get_text(

exporting

KEY = 'M01'

PARA1 = 'wangpeng'

receiving

text = lv_test ).

lo_nd_ee_test = wd_context->get_child_node( name = wd_this->wdctx_ee_test ).

lo_el_ee_test = lo_nd_ee_test->get_element( ).

lo_el_ee_test->set_attribute(

EXPORTING

name = `TEST`

value = lv_test ).

ENDMETHOD.

create a context node(ee_test) with attribute(test).

Bind the context attribute(ee_test-test) to a textview.

3. run my WDA.

The result is in the WEB page: This is test for %PARA1% . I found that the %PARA1% isn't replaced by 'wangpeng'.

How can I send the 'wangpeng' to the parameter for replacing the %PARA1%.

Best regards,

tao