cancel
Showing results for 
Search instead for 
Did you mean: 

select columns dynamically?

Former Member
0 Kudos

Hi,

I have a question; with SAP ALV a user is able to easily choose fields, select columns in the display of fields. In the BSP application, I would like to have the possibility to switch from a long version (extra fields included as description et c) and a short version (only the most important field shown at screen).

One way to do it (but not the nicest one maybe) I suppose would be let the user click on a checkbox in order to have or not have the long version of the fields shown and then in the view itself test if the checkbox is filled, and in these cases output field1 and field 2 and field 3, if not filled, output field1 and field2, field3, field4, field5 etc, like this:

if lv_checkbox is INITIAL.

<crmic:gridLayoutCell columnIndex = 1 rowIndex = '<%=lv_r + 1%> colSpan etc

field1

field 2

et c

else.

output field 1, field2 and field3 et c

endif.

Is there a better way to do it?

Thank you,

rgrds Lena

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

Look at this blog. It might help you.

[Personalize My BSP|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/942] [original link is broken] [original link is broken] [original link is broken];

You can follow the similar approach to hide or enable the columns in your table or

as you said, have checkbox and handle it.

Raja

Answers (0)