cancel
Showing results for 
Search instead for 
Did you mean: 

How to get label element

jakob_steen-petersen
Active Participant
0 Kudos

Hi

How can i get the name of the label Element of a certain field?

I have 5 input fields and i need to read the text of the Label. I know how to read the label text when i know the name of the Label element - but in this case i need to find the assigned label from the Input field.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jakob,

I'm pretty sure you can navigate to the Label object via the following method inherited in the Input Field class (CL_WD_INPUT_FIELD):

GET__LABELLING_ELEMENT

You'll need to get a reference to the Input Field object from the container first and cast it to the class CL_WD_INPUT_FIELD.

The object you get back from GET__LABELLING_ELEMENT should cast to CL_WD_LABEL and from there you can get the text.

Hope this helps.

Regards,

Nick

jakob_steen-petersen
Active Participant
0 Kudos

Pefect - exactly what i needed!

Answers (0)