cancel
Showing results for 
Search instead for 
Did you mean: 

CREATE UI ELEMENTS AT RUNTIME

mariano_gallicchio2
Participant
0 Kudos

Hello experts

I need to know how to create UI elements in runtime

Thanks.

.

Accepted Solutions (1)

Accepted Solutions (1)

former_member189058
Active Contributor
0 Kudos

If you need to create an input field, for eg.



data lr_input_fld type ref to CL_WD_INPUT_FIELD.

lr_input_fld = CL_WD_INPUT_FIELD->NEW_INPUT_FIELD(
                       EXPORTING
                            BIND_VALUE = <node_path> ).


Similarly for each UI element, there is an associated class having a NEW_<UI_ELEMENT> method.

Check the class and the method for the signature.

You will also need to use SET_LAYOUT_DATA()

Eg, if you want to add the fields in a group that has matrix layout, you will first need to create CL_WD_MATRIX_HEAD_DATA->NEW_MATRIX_HEAD_DATA and pass the return parameter to SET_LAYOUT_DATA().

If adding in the Group on the view, get refernce of the group using view->get_element(<element_name>)

and then ADD_CHILD()

Note that you have the reference of the view in WDDOMODIFY method

Regards,

Reema.

mariano_gallicchio2
Participant
0 Kudos

Thanks a lot for the answer!

Answers (3)

Answers (3)

rainer_liebisch
Contributor
0 Kudos

Hello Mariano,

a good introduction can be found in the following Blogs:

Regards,

Rainer

Former Member
0 Kudos

check these standard examples

WDR_TEST_DYNAMIC

WDR_TEST_DYNAMIC_1

WDR_TEST_DYNAMIC_2

WDR_TEST_DYNAMIC_3

WDR_TEST_DYNAMIC_CI

Thanks

Suman

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos