SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




CRM Companies List
Web Based CRM Software


Read Checkbox Value in Web Dynpro Editable ALV

This Web Dynpro tutorial shows how to retrieve value of a checkbox control in editable ALV table in a Web Dynpro component. To read checkbox value and identify if it is marked or unmarked (cleared), ABAP programmers can use ALV event like ON_CELL_ACTION and R_PARAM parameter value R_PARAM->VALUE

I register ALV events and enable them in WDDOMODIFYVIEW method. When the SAP user clicks on checkbox control displayed on an editable ALV control in Web Dynpro component, I can catch the user interaction using the ON_CELL_ACTION event handler of the ALV control.

R_PARAM parameter of the Event provides ABAP developer all required information about the event details triggered like the row index, column name and the value of the column, etc.

For example, if you put a break point and debug your Web Dynpro code you can watch the R_PARAM values as follows:

on_cell_action event parameters to get value of checkbox in ALV

R_PARAM->INDEX is showing the index of the row displayed on the ALV table on Web Dynpro page.

R_PARAM->COLUMN is showing the name of the column that the cell triggering the event belongs to.

R_PARAM->VALUE event parameter attribute gives the value of the checkbox control to the ABAP developer. ABAP developer can retrieve the checkbox value, or identify if the checkbox is marked or cleared by using the R_PARAM->VALUE

Unfortunately, developers can see the checkbox value on the debugger screen using R_PARAM->VALUE in order to use this in ABAP codes following syntax should be used.

*** --> if checkbox is marked or cleared, P_ALL_NONE parameter is populated with data
data LV_ALL_NONE type C1. " default initial
field-symbols: <FS> type DATA.

if R_PARAM->COLUMN = 'CHECKBOXMARKED'. " ALV column name with checkbox in its cells

 assign R_PARAM->VALUE->* to <FS>.

 if <FS> = 'X'.
  LV_ALL_NONE = 'A'.
 else.
  LV_ALL_NONE = 'N'.
 endif.

endif.
*** <-- read checkbox value (END)

The R_PARAM->VALUE should be assigned to a field symbol and the value of this field symbol should be used within ABAP control statements.

Using field symbol in <FS> = 'X' equality shows that the checkbox created in editable ALV table is marked. Otherwise developers can assume that the checkbox is cleared or unmarked.

If you directly compare R_PARAM->VALUE with 'X' to check if the checkbox is marked or not, developers will get the ABAP exception saying that:
cant compare 'X' and R_PARAM->VALUE






SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Related Articles and Tutorials(http://www.kodyaz.com/sap-abap/web-dynpro-checkbox-value-in-editable-alv.aspx)
Display Data on Web DynPro Table Element
Display Adobe Form in SAP Web Dynpro
Add Button to ALV Table Header on SAP Web Dynpro
Add Web Dynpro Applications to SAP Favorites Menu
Traffic Lights in SAP Web Dynpro ALV Table
Component Usage ALV Does Not Have an Active Component
Create Search Help in ABAP for Web Dynpro Component
Create Transaction Code for Web Dynpro Application
Display and Download Adobe Form as PDF File in SAP Web Dynpro
Find Web Dynpro Class Name to Search in ABAP Code
How to Clear Web Dynpro Cache
Web DynPro Tutorial - How to create Web Dynpro Application (Web Dynpro Component)
Test Web Dynpro ABAP Component by Creating Web Dynpro Application
Remove ALV Buttons on SAP Web Dynpro Component
Set Page Title in Web Dynpro Application
Web Dynpro Text Translation using Assistance Class
Trigger ALV Events in Web Dynpro Component
SAP Web Dynpro ALV Tutorial
Read Checkbox Value in Web Dynpro Editable ALV
SAP Web Dynpro File Upload using GOS cl_fitv_gos Class
Add Value Help to Web Dynpro Select Options
Web Dynpro Component Service Syntax Error in Program /1BCWDY/O3EC1AX6A3OVKK9L5FXO==CP
Translate Web Dynpro Header Title displayed on Web Browser
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table
SAP Web Dynpro Service Cannot be Reached Error
SAP - ABAP ALV Grid Sample Code using REUSE_ALV_GRID_DISPLAY


Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems