Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV View dropdown value reading

Dear Mates,

I have designed an ALV, in which i have few views as shown at below image. I have created these views through configuration. Now i need to read in my code which view has been selected by the user.

I have created event handler for event ON_STD_FUNCTION_AFTE to read the selected view name. Below is the code where am getting an error is "wd_this->wd_cpifc_alv_table( ) is unknown", Please let me know the reason why or tell me any other way to read the ALV dropdown selected view name:


    data lo_alv_ifc      type ref to iwci_salv_wd_table. 

    data ls_config_in  type if_salv_wd_table=>s_type_param_config_in. 

    data ls_config_out type if_salv_wd_table=>s_type_param_config_out. 

    data lo_model        type ref to cl_salv_wd_config_table. 

    data lo_field          type ref to cl_salv_wd_field. 

 

  * Get the ALV interface controller 

    lo_alv_ifc = wd_this->wd_cpifc_alv_table( ). 

 

    case r_param->id. 

  *    Handle selection of an ALV view variant 

        when if_salv_wd_c_std_functions=>view_load " select view from view dropdown 

            or if_salv_wd_c_std_functions=>settings.    " select view from settings > ok/apply 

 

  *        Determine what ALV view variant is currently selected 

            ls_config_in-action = if_salv_wd_table=>actual. 

            ls_config_out = lo_alv_ifc->get_config_data( ls_config_in ). 

 

  *        Process each ALV view variant as needed 

            case ls_config_out-view-description. 

                when 'Standard Profile View'. 

 

                when others. " other view variants 

 

            endcase. " view variant 

 

        when others. " other standard functions 

 

    endcase. " ALV standard function 

Tags:
Not what you were looking for? View more on this topic or Ask a question