Show TOC

Getting the ALV Configuration ModelLocate this document in the navigation structure

Use

To make the ALV configuration model available, you use, for example, a method from class IWCI_SALV_WD_TABLE in WDDOINIT . You choose one of the following methods:

  • GET_MODEL

    You get a complete ALV Configuration Model with all column objects and all field objects.

    This is the default variant. The method does not have any parameters.

  • GET_MODEL_EXTENDED

    The system returns all field objects (as above), but only returns column objects when required.

    If, for example, you want to manage a large number of field objects but you only want to display a few columns, create the field objects first and later generate the column objects you require to display the content.

    Parameter S_PARAM of method GET_MODEL_EXTENDED consists of the field DEFAULT_COLUMNS . This enables you to specify whether the column objects are to be generated or not.

Note

You can specify a new internal data table for the ALV display at a later stage. Use method SET_DATA of the Interface Controller for this. However, by using this method you also automatically delete the entire ALV configuration model with all fields and column objects. To make the configuration model available again to the new data table, use method GET_MODEL or method GET_MODEL_EXTENDED .

Procedure

To be able to user the ALV Configuration Model you must initiate the ALV Component explicitly.

  1. At a suitable point in your coding (for example in method WDDOINIT of your Component Controller) open the Web Dynpro Code Wizard and choose Instantiate Used Component on the General tab.

  2. Select the required component usage of SALV_WD_TABLE (for example: MY_ALV_COMP_USAGE ) and confirm.

    The following coding is added to your method:

    data lo_cmp_usage type ref to if_wd_component_usage.  
    lo_cmp_usage =   wd_this->wd_cpuse_my_alv_comp_usage( ).
    if lo_cmp_usage->has_active_component( ) is initial.
            lo_cmp_usage->create_component( ).
    endif.
                   
  3. Open the Web Dynpro Code Wizard again and select Method Call in Used Controller .

  4. Select the INTERFACECONTROLLER of your ALV Component Usage and choose the rrequired method, for example, GET_MODEL .

    The following coding is added to your method:

    DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
    lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_my_alv_comp_usage( ).
    DATA lv_value TYPE ref to cl_salv_wd_config_table.
    lv_value = lo_interfacecontroller->get_model(  ).
                   
  5. Now you can access the different interfaces of the ALV Configuration Model.

    Example

    To be able to activate the standard function for displaying the table as a hierarchy, call:

    lv_value->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ).