cancel
Showing results for 
Search instead for 
Did you mean: 

How can i hide unwanted columns on ALV dashboard

former_member202077
Participant
0 Kudos

Hello

( I am aware of that the standard SAP is giving an option of Persenalization to the users on ALV grid/table/dashboard settings, of WDA, but in my case for some reason we don't want to opt that choice)

My requirement is to hide some coluns/fields of ALV dashboard of a Standard SAP's (WDA/WDC) app , say, the Standard SAP is displaying 10 coumns, but we need only 8, hence i need to hide the unwanted 2 columns programitically with my custom code

After debugging i realized that the complete ALV is coming/building dynamically on run time.

Pls. let me know how can i hide the stndard SAP delivering ALV's column on dashboard

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello

You can hide a field in ALV we need to DELETE _COLUMN method of the interface IF_SALV_WD_COLUMN_SETTINGS and pass the attribute name which needs to be hidden

lo_value->if_salv_wd_column_settings~delete_column( id = 'VBELN' ).

We need to paste the above code in WDDOINIT method of the view in which ALV is present

Using this we can hide the two fields which you need to hide in your case.

Points please if helpful

Regards

Subhash

Former Member
0 Kudos

Hi,

In the fieldcatalog there is a field call no_out. Populate 'X' to that field.

wa_fiedcat-no_out = 'X'.

Regards,

Vidya Chowdhary A.

Answers (1)

Answers (1)

Amarpreet
Active Participant
0 Kudos

the easiest way is to use the layout option in the ALV output.

when using the ALV grid FM or Class just pass the parameters I_SAVE and IS_VARIANT and you'll have that option enabled.

Syntax :

IS_VARIANT = <layout structure>                         " pass the name of the report

I_SAVE = <'X', 'U' or 'A'>

NOTE : by setting the I_DEFAULT  we can enable the ability to save default layout settings . ( set in default settings ) .

  • if you pass on IS_VARIANT - only load layouts is enabled .
  • if you pass I_SAVE , passing IS_VARIANT is a required step .

Possible value for I_SAVE .

I_SAVE = SAVE ( layouts cannot be saved )

I_SAVE = 'U' ( only user-defined layouts can be saved )

I_SAVE= 'X' ( only global layouts can be saved ) .

I_SAVE = 'A' (both  user defined and global layouts can be saved . ) 

Example :

DATA:     X_SAVE, "for Parameter I_SAVE

GS_variant TYPE DISVARIANT. "for parameter IS_VARIANT

G_REPID = SY-REPID.

   GS_variant-REPORT = G_REPID." minimum step


X_SAVE = 'U'.


  • CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
     EXPORTING I_STRUCTURE_NAME = 'SFLIGHT'
          IS_VARIANT = GS_variant
          I_SAVE = X_SAVE
     CHANGING IT_OUTTAB = GT_SFLIGHT.

On the output screen press the layout (CTRL + F8 ) and chose the fields that you want to show . and hide the once that you don't.

You can also pass the I_DEFAULT = 'X'  if you want to let the user save the layout as default.

you can use this on a Standard SAP  ALV  Report without any coding .

Hope this helps

Amarpreet.

Message was edited by: Amarpreet Singh