ALV with column color

Create a web dynpro component and Use the standard ALV web dynpro component as the used controller.

Go to the component controller  and the used component. Go to the context node.

Add a node(cardinality 0…n) and its attribute from the data dictionary structure.

Go to the component controller WDDOINIT method.

Add the below code which select the data and binds to the  context node.

 Go to the view and add a view container UI element.

 Select the INTERFACECONTROLLER_USAGE from the Component Usage. Click on the button Controller Usage.  Map the Component controller node FLIGHT to the DATA node of the Interface Controller.

Go to the window->main view->VC. Add the view TABLE in it.

 Create an application and test. Now ALV is displayed.

Go to the component controller methods and add a method here as COLOR_COLUMN.

First we have to instantiate the used component. Click on the button to open the wizard.

From the wizard call the method GET_MODEL from the used component.

 To color a  column(s) we have to use the marked method.

 Put the below code.

 Call the method  COLOR_COLUMN()  from the WDDOINIT method.

Test the application.

Color  can be  a different one.

Test the application.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s