Demo on input enabled table using Web Dynpro for ABAP

...Previous 

10.  Right click on the table and click on ‘Create Binding’, the following screen will appear.

11.    Here click on the ‘Context’ button. And bind the table with the node (Here the Node is Material).

12.    Now change the ‘Standard Cell Editor’ from ‘Textview’ which will come as default to ‘Input Field’ as shown below:

13.  Click on Continue. And we will be back to the Layout page of the View.

14.    Now click on the ‘Methods’ tab of the same View and then double click on the WDDOINIT method.

15.    Write the following Code in this method.

METHOD WDDOINIT
Types : Begin of ty_mara,
        MATNR type mara-matnr,
        ERSDA type mara-ERSDA,
        ERNAM type mara-ERNAM,
        LAEDA type mara-LAEDA,
        AENAM type mara-AENAM,
        end of ty_mara.
*Creating internal table and Work Area of the same structure
*as that of the Node created.
Data : lt_material type standard table of ty_mara,
       wa_mara type ty_mara.
*Appending Blank Work Area to Internal table.
Do 10 times.
Append wa_mara to lt_material.
enddo.
"Binding the table
 
 DATA lo_nd_material TYPE REF TO if_wd_context_node.
*  DATA lt_material TYPE wd_this->Elements_material.
* navigate from <CONTEXT> to <MATERIAL> via lead selection
  lo_nd_material = wd_context->get_child_node( name = wd_this->wdctx_material ).
* @TODO handle non existant child
* IF lo_nd_material IS INITIAL.
* ENDIF.
** @TODO compute values
** e.g. call a model function
*
  lo_nd_material->bind_table( new_items = lt_material set_initial_elements = abap_true ).
ENDMETHOD.    

 In the above Code We will just create an internal table and Work Area that should have the same structure as that of the Node created in the Component Controller. And then we have to just append blank Work Area to the Internal Table in order to get Input Enabled Table. Once done we will bind the table.  

16.   Now Right Click on the Component (ZWD_INPUT_ENABLE_TAB) and create WebDynpro Application as shown below, give a description.      

17.   Now save and activate and then Right click on Application and test it. Now you will see that your table is input enabled & user can enter data in it. 

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image