Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help required - For ALV program

Former Member
0 Likes
706

Hi Guys,

I have created an ALV (using containers) with , say , 10 fields. As the container size is not large enough to accomodate all the 10 fields, it is getting displayed as

field1, field2,field8, field9 and field10.

When I click on the horizontal scrollbar, the fields getting displayed should change as follows.

First click: Field2, Field3, Field8,Field9, Field10

Second click: Field3,Field4, 8, 9,10

Third click: Field4,Field5,8,9,10

This is for one of my friends.Can you provide me with good ideas as to how to approach this problem and if any one has worked on similar problem, please provide the code for it.

I will check the code and will award points to all helpful answers.

Have a nice day .

Regards,

SP.

6 REPLIES 6
Read only

Former Member
0 Likes
661

Hi Sylendra,

I dont know if you we have any event to catch the user scrolling for the CL_GUI_ALV_GRID method.

Here is a possible solution though, you could set up three buttons on the toolbar for selecting the three field combinations. Then when the user presses any of the buttons. one way could be use the method 'set_scroll_info_via_id' and set the existing grid to the new position without even having to scroll.

But since you need the fields in a specific order, say 1st click : Field 2, 3 , 8 etc..you would need to modify the Field catelog and change the order in which the fields were displayed and and then use the refresh grid display method also here specify the order in which you want to display the fields.

See if this helps..

Ketan

Read only

Former Member
0 Likes
661

Hi,

Don't fix the columns..

Meaning don't pass KEY= 'X' OR FIX_COLUMN = 'X' to the fieldcatalog internal table..

Then if you move it..The for first time , the first column will be moved..Second time 1 and 2 will be moved.

Is that what you want??

Thanks,

Naren

Read only

uwe_schieferstein
Active Contributor
0 Likes
661

Hello Sylendra

As developer of ALV lists we do not care that much about the layout of the list because the user has all the options available to adjust it to her specific needs.

Your requirement is to be able to "freeze" columns at the right border of the ALV list. This is, as far as I know, not possible, only at the left border.

When you call the context menu for a column heading you will see the options

- Freeze to Column
- Unfreeze Columns

If you freeze a column all columns to its left side remain fixed. Thus, in your case you have to change the order of your columns that the fixed columns (field8 - field10) appear on the left side of the ALV list.

Regards

Uwe

Read only

0 Likes
661

Hi ,

I will modify the requirement slightly.

It is the left hand side columns, which are fixed

So initially, the ALV should display field1, 2, 8,9,10.

Now when I click on horizontal scrollbr, the visible fields should be field 1, 2, 7,8,9

in the next click , it should be field 1, 2, 6,7,8.

What my idea, is that we should load all the 10 fields in the field catalog. By setting a field in the field catalog structure ( I don't know which field it is ), only fields 1,2,8,9,10 should be visible . Then by clicking on the horizontal scrollbar, it should be changed to 1,2,7,8,9. and so on.

Is such a concept possible...?

Regards,

SP.

Read only

0 Likes
661

The field in the fieldcatalog, is NO_OUT, by setting this, the column will not be display, but can be by changing the layout.

fc_tmp-no_out = 'X'.

As far as using the horizontial scroll bar to fire an event, I don't think that this is one which will be handled by the application. You should add "Scroll" buttons to the application toolbar of the grid to handle this.

To be honest, I don't see why there is a need to hide the columns in the first place, but again, I don't know your real requirement.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
661

Hi all,

Thanks for your replies. I will check all your suggestions in my system later and let you know about the progress.

Regards,

SP.