cancel
Showing results for 
Search instead for 
Did you mean: 

How to add input field dynamically .

Former Member
0 Kudos

Hi All,

How to add input field dynamically .

If any sample code present pls send.

Thanks

hemalatha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hemalatha,

Below is the code snippet using which you can add an input field to the view dynamically. You have to put this code in the view's WDDOMODIFYVIEW method:

DATA: lr_container TYPE REF TO cl_wd_uielement_container,

lr_flow_data TYPE REF TO cl_wd_flow_data,

lr_input_field TYPE REF TO cl_wd_input_field.

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lr_input_field = cl_wd_input_field=>new_input_field( ).

lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_input_field ).

lr_container->add_child( lr_input_field ).

You can pass other details for your input field in the "cl_wd_input_field=>new_input_field" method. See class "cl_wd_input_field" for method parameter details.

Hope this solves your question. If so, reward and close the thread ASAP.

Regards,

Ram

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

please check coding in [Wiki|https://wiki.sdn.sap.com/wiki/display/WDABAP/Dynamicuseof+Dictionary]

grtz,

Koen

Former Member
0 Kudos

Hi Hemalatha T C ,

For creating inputfied dynamically you have to use the class cl_wd_inputfield. you can use the method to create input field of this class. you have to write the coding at mofify view

Regards

Sarath