Thursday, February 16, 2012


Simple method.
  • Create webdynpro component e.g. ZOVH_CHKBOX_ON_TABLE_002 →Save.
  • Go to Context tab → Create node e.g. EMP_ADD with cardinality 0-n. →>save

  • Go to Layout tab → Drag and drop Table UI element from UI elements library or right click on ROOTUIELEMENTCONTAINER → Create UI element → Give ID e.g.TAB_DAT and select type TABLE  → Save.

  • Bind Context node with Table UI element. Right click on Table UI element TAB1→Create Binding → Select the node from context → Continue → Save.

  • Go to Methods tab    Use WDDOINIT    SELECT the data and Set the table data to Context elements.
METHOD wddoinit .
  DATA lo_nd_emp_add TYPE REF TO if_wd_context_node.
  DATA lt_emp_add    TYPE wd_this->elements_emp_add.

"Navigate from <CONTEXT> to <EMP_ADD> via lead selection
  lo_nd_emp_add = wd_context->get_child_node( name = wd_this->wdctx_emp_add ).
 "Fetch data
  SELECT *
    FROM pa2006
    INTO CORRESPONDING FIELDS OF TABLE lt_emp_add
    UP TO 50 ROWS.
  "Find the table values to Context
  lo_nd_emp_add->bind_table( new_items = lt_emp_add set_initial_elements = abap_true ).
ENDMETHOD.
  • Save and activate Webdynpro component.
  • Create Webdynpro application and Run the application. 



Changing existing table for check box.
  • Create webdynpro component e.g. ZOVH_CHKBOX_ON_TABLE →Save.
  • Go to Context tab → Create node e.g. EMP_ADD with cardinality 0-n. →>save
  • Go to Layout tab → Drag and drop Table UI element from UI elements library or right click on ROOTUIELEMENTCONTAINER → Create UI element → Give ID e.g.TAB1 and select type TABLE  → Save.
  • Bind Context node with Table UI element. Right click on Table UI element TAB1→Create Binding → Select the node from context → Continue → Save.
  • Go to context tab again, create one attribute for check box in the node EMP_ADD.
  • Go to Layout tab    Right click on Table element  → Insert table column   Insert Cell editor  for Check box    Bind the context CHK1 attribute to Table check box cell.
  • Go to Methods tab    Use WDDOINIT    SELECT the data and Set the table data to Context elements.
  • Save and activate Webdynpro component.
  • Create Webdynpro application and Run the application. Table is displayed with data in window. 

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.