Tuesday, July 16, 2013
Previously we worked on how to display data, how to handle check box on Table and discussed on table events SORTING and FILTERING.
The following article gives you step by step procedure to create and handle radio buttons on Table row.
The following article gives you step by step procedure to create and handle radio buttons on Table row.
- Create Web Dynpro Component(ZOVH_RADBUT_ON_TABROW) with Window and View(Automatically View is embedded into Window).
- Go to COMPONENTCONTROLLER context and create one IT0001 with cardinality 0-n.
- Get PERNR and ENAME from PA0001 structure as shown in the picture
- Click on IT0001 and take out Dictionary structure PA0001.
- Add attributes YES, NO, AMENDMENT, KIV and SELECTEDKEY with type STRING.
- Go to view->Context->Map Component controller context node IT0001 to View context.(Drag IT0001 and drop at viwe context)
- Go to view-> Layout.
- Change ROOTUIELEMENTCONTAINER layout to MatrixLayout.
- Insert Table UI element and Bind context node to table UI element.
- While binding change Cell element to RadioButton for YES, NO, AMENDMENT and KIV and continue
- Table appears this way.
- Click on radio button in table cell and set keyToSelect = 'a' and bind selectedKey with RADBUT_TAB_V.IT0001.SELECTEDKEY as shown in the picture. Continue same thing to NO, AMENDMENT and KIV.
- Insert Button with text 'Update' and change layout to MatrixHeadLayout
- Copy existing table ui element and right click on Root Ui element and use Insert copied element menu and change layout to MatrixHeadLayout.
- Go to Methods->Double click on WDDOMODIFYVIEW.
- Method code
- Activate Web Dynpro Component.
METHOD WDDOMODIFYVIEW . CASE FIRST_TIME. WHEN ABAP_TRUE. DATA LO_ND_IT0001 TYPE REF TO IF_WD_CONTEXT_NODE. DATA LT_IT0001 TYPE WD_THIS->ELEMENTS_IT0001. DATA LS_IT0001 TYPE WD_THIS->ELEMENT_IT0001. " navigate from to via lead selection LO_ND_IT0001 = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_IT0001 ). SELECT * FROM PA0001 INTO CORRESPONDING FIELDS OF TABLE LT_IT0001 UP TO 20 ROWS. LOOP AT LT_IT0001 INTO LS_IT0001. LS_IT0001-SELECTEDKEY = 'd'. MODIFY LT_IT0001 FROM LS_IT0001 INDEX SY-TABIX. ENDLOOP. LO_ND_IT0001->BIND_TABLE( NEW_ITEMS = LT_IT0001 ). ENDCASE. ENDMETHOD.
- Create Web Dynpro Application.
- Run Web dynpro Application
- Application output. Select different radio buttons for different columns and click on Update button.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.