cancel
Showing results for 
Search instead for 
Did you mean: 

Get all the ui elements present in a view

former_member205144
Active Participant
0 Kudos

Hi,

  How to get all the ui elements used in a particular view?

Accepted Solutions (0)

Answers (4)

Answers (4)

UmaArjunan
Active Participant
0 Kudos

did you solve this ? please post the solution if you have solved

Former Member
0 Kudos

Hi Lavanya,

can you elaborate your question and what's your exact requirement

Thanks

Madhukiran.

former_member205144
Active Participant
0 Kudos

Ho to use the SET_TEXT method in CL_WD_LABEL?

Former Member
0 Kudos

if you want create or change a UI element dynamically to that particular UI you have a Class.

In your case CL_WD_LABLE has a static method NEW_LABEL and this method return's the reference of CL_WD_LABLE and then with that reference you can access to set_text method or any other.

former_member205144
Active Participant
0 Kudos

This is what i am trying to use.But not working.I know only the name of input field for which a label is assignd.Using that i have to get the label from the 'label for' property.I don't have the id of the label.Can anybody please tell me whether this class can be used for this requirement?

DATA    lo_label  TYPE REF TO cl_wd_label.

lo_label ?= cl_wd_label=>new_label( label_for = 'NAME1' ).

lo_label->set_text( 'TESTTT' ) .

Former Member
0 Kudos

Hi lavanya,

 

  If you want to change text for a label ..create an attribute in context node ..bind the text property of label in view..and wherever u want to change the text..u can set attribute

former_member205144
Active Participant
0 Kudos

If we do like that,we need to create as many attributes as the number of ui elements rt?

former_member205144
Active Participant
0 Kudos

Any other solution?

Former Member
0 Kudos

Hi lavanya,

        are u creating ui elements dynamically?

former_member205144
Active Participant
0 Kudos

no.statically only i am creating.

former_member185241
Active Participant
0 Kudos

Hey,

i dont think we can get all ui elemnt of a view using program..

But why do you need this, can you explain your requirement ?

Thanks

Abhi

former_member205144
Active Participant
0 Kudos

i want to change some of the labels dynamically....

former_member185241
Active Participant
0 Kudos

what is your requiremnt please make me understand also, so that i can get the solution.

Thanks

Abhi

former_member205144
Active Participant
0 Kudos

based on certain conditions,i want to change some of the label text dynamically.I knw the input field whose label needs to be changed.But,i need to get the label corresponding to that input field and then set a new text.How can i do this?im also trying...

former_member185241
Active Participant
0 Kudos

Check if we bind the labelfor property to attribute then from that attribute you can get the input field name, and you can set different text to label base on condition.

Thanks

Abhi

former_member205144
Active Participant
0 Kudos

see...if your input field is name1,first  we need to get the label whose 'label for ' is name1.rt?how to get tht?CL_WD_LABEL should be useful i think.