cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit text of UI elements in sap standard ABAP webdynpro component

Former Member
0 Kudos

Hi All,

I have a requirement wherein I want to change the standard text of mainly LABEL UI in travel and expenses ABAP webdynpro components. As per my knowledge we canu2019t change UI text directly by changing it in layout in enhancement. We have to do it via wdmodify view method and post and pre exits methods.

Can you please help me with the steps that I have to follow and code?

Regards,

Madhvika

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

1. Create and enhacement.

2. in the preexit method of wddomodify.

write the code to dynamically modify the label'text property as shown below.

data lr_lbl type ref to  cl_wd_label.

lr_lbl ?= view->get_element( 'LABEL1' ).          "label1 is the ID of the label UI element
LR_LBL->SET_TEXT( 'New Text' ).

3. save it and activate.

done.

thanks

sarbjeet

Answers (3)

Answers (3)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Do you really want to use coding in an Enhancement to just change labels? Why not use component configuration or administrative personalization? This is generally easier to maintain since it is done at runtime in the browser and doesn't involve any ABAP coding.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b170d256293c5ce10000000a421937/frameset.htm

sahai
Contributor
0 Kudos

hi madhvika,

in pre exit of wdmodify use this code

button TYPE REF TO cl_wd_button.
 
button ?= view->get_element( 'button' ).
button->set_text('message you want').

regards,

sahai.s

Edited by: sahai.s on Jan 28, 2011 8:25 AM

Former Member
0 Kudos

Thank you all .

My Problem has been solved because of you guys . Awarded points to you all .

0 Kudos

Thank you very mych, it solved for mee too

Former Member
0 Kudos

Hi ,

Please go through this document.

[Doc|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?quicklink=index&overridelayout=true]

Create a Pre Exit method for WDDOMODIFY method of the view , and in that method code somthing like this.

lo_button TYPE REF TO cl_wd_button.

lo_button ?= view->get_element( 'ID of button' ).
lo_button->set_text('New Text').

Thanks,

Aditya.