Setting ALV row color based on condition in ABAP WebDynpro


9. Go to main view context and map the node of the component controller to the view component controller.

10. Go to methods tab and in WDDOINIT method on MAIN view using code wizard set the ‘table’ node as table operation. As shown below.

Source code in WDDOINIT


data ls_table like LINE OF LT_TABLE.
from vbap
UP TO 20 rows.

LOOP AT LT_TABLE into ls_table.
if sy-tabix = 2.
ls_table-celldesign = 
MODIFY LT_TABLE from ls_table.

*   navigate from <CONTEXT> to <TABLE> via lead selection


In the below code the red marked section is where the based on condition the color code (01,02..etc) is set to the field celldesign in the ALV.


11.     Go to Component Usage and under properties tab click create to add the ZD_ALV_ROWCOLOR component.

Select the ZD_ALV_ROWCOLOR component to add it.

12. Go to Component Usage and under Context tab Map the ALV node TABLE of the component controller to the DATA of the interface controller of ALV

13.     Go to layout tab of MAIN view and create a VIEWCONTAINER UI element under rootelementcontainer.

Click here to continue...

SAP Virtual/Onsite Trainings

Document Categories:

What's New?


Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 

Join the Mailing List
Enter name and email address below:
Subscribe  Unsubscribe 

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