cancel
Showing results for 
Search instead for 
Did you mean: 

Assign Text Symbols in assistance class directly to UI element properies

Former Member
0 Kudos

Can I assign Text Symbols in assistance class directly into UI element properties? I read something about assistance class and only find a way to get the value of text symbol by coding, such as 'my_text = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( KEY = '001' '. How can i assign the text symbol value to the property of UI element directly in view editor?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Define a context attribute TYPE string.Suppose name of the attribute is TEXT.

bind that attribute to the Text property of the UI element.

if text element is already there

Data:str type string.

CALL METHOD wd_assist->if_wd_component_assistance~get_text

EXPORTING

key = '001' ''provide Key of the text element

RECEIVING

text = str.

now read the attribute...

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_text LIKE ls_context-text.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • set single attribute

lo_el_context->set_attribute(

EXPORTING

name = `TEXT`

value = str ).

It's done.

Thanks,

Subhasis.

Edited by: subhasis on Sep 10, 2008 11:52 AM

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

I don't think you can directly assign the ui element property with a class text element.

You can use OTR texts using $OTR:Aliasname as property value

OR

http://help.sap.com/saphelp_nw70/helpdata/EN/43/787a85600d6fc9e10000000a1553f6/content.htm

Abhi