Sunday, April 8, 2012
  1. Create Web dynpro component and application as in the my previous post - Web Dynpro ABAP - ALV Total and Subtotal
  2. Setting the ALV design
    •   Define the usage of ALV component ALV_COMPONENT in the properties for your view. Since we need the object model for our changes, choose the With Controller Access variant (component interface).
    • Go to view ALV_V -> Methods tab ->Create GET_COLOR-Write the code to get the layout with different designs->Call that method in WDDOINIT. 
    • Steps in GET_COLOR method. 
      1. Getting the instance of ALV Component and Interface Controller. 
      2. Change the layout design. 
  3. Code in GET_COLOR method. 
  4. METHOD get_color .
    
      "Create instance for ALV Component usage.
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    
      lo_cmp_usage =   wd_this->wd_cpuse_alv_component( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      "Get config model
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv_component( ).
      DATA lr_config_table TYPE REF TO cl_salv_wd_config_table.
      lr_config_table = lo_interfacecontroller->get_model( ).
    
      "Layout design
      lr_config_table->if_salv_wd_table_settings~set_design( value = cl_wd_table=>e_design-transparent ).
    ENDMETHOD.
    
  5. Report outputs with colors




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.