Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to add input field dynamically .

Hi All,

How to add input field dynamically .

If any sample code present pls send.

Thanks

hemalatha

Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question