Skip to Content
author's profile photo Former Member
Former Member

WD ALV Settings for personalization

Hi experts,

within an ALV I want the user to personalize the columns of the ALV. Subsequently I needed to programmatically find out, which columns were selected in order for me to adjust the linked graphic to the selected columns.

Where would I find the info regarding the selected columns? All hints are higly appreciated.

Cheers, Rene

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 12, 2006 at 07:39 AM

    Hi Rene,

    IF_SALV_WD_COLUMN_SETTINGS=>GET_COLUMNS should do the trick.

    regards Ulli

    Add a comment
    10|10000 characters needed characters exceeded

    • Rene

      You can use the following code to find out which columns have been selected:

        
        DATA:
          lt_SALV_WD_T_COLUMN_REF TYPE SALV_WD_T_COLUMN_REF,
          wa_SALV_WD_COLUMN_REF   TYPE SALV_WD_S_COLUMN_REF,
          l_fieldname             TYPE string,
          l_tabix                 TYPE sytabix.
      
        field-symbols <column> type any.
      
      CALL METHOD wd_this->SALV_CONFIG->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMNS
          RECEIVING
            VALUE = lt_SALV_WD_T_COLUMN_REF.
      
      * itSelectedData contains the data in the ALV
        loop at itSelectedData into isSelectedData.
          l_tabix = sy-tabix.
          loop at lt_salv_wd_t_column_ref into wa_salv_wd_column_ref.
            concatenate 'ISSELECTEDDATA-' wa_salv_wd_column_ref-id into l_fieldname.
            assign (l_fieldname) to <column>.
      *     Is the column invisible
            if wa_salv_wd_column_ref-r_column->visible = '01'.
              clear <column>.
              modify itSelecteddata from isSelecteddata index l_tabix.
            endif.
          endloop.
        endloop.

      Regards

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.