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

ALV Sorting Problem

Former Member
0 Likes
2,295

Hi Experts,

I am facing an issue while using SORT option in 'REUSE_ALV_GRID_DISPLAY'.

Suppose i have Equipment number, characteristics and Date of Creation fields in the layout.

I have values of these two fields a follows:

Equipment No. Date of Creation Characteristics

1 26.10.2010 MAP-ID

1 26.10.2010 CERTIFICATION-DATE

2 26.10.2010 MAP-ID

2 26.10.2010 CERTIFICATION-DATE

Now when i use sort optoin in ALV, it gives me a layout as below

Equipment No. Date of Creation Characteristics

1 26.10.2010 MAP-ID

. . CERTIFICATION-DATE

2 . MAP-ID

. . CERTIFICATION-DATE

Date of Creation field value is common for both the equipments so it is getting diplayed just one for both the equipments.

I want to sort the table but Date field should come seperate for both the equipment. I want layout like below:

Equipment No. Date of Creation Characteristics

1 26.10.2010 MAP-ID

. . CERTIFICATION-DATE

2 26.10.2010 MAP-ID

. . CERTIFICATION-DATE

How to get this layout in 'REUSE_ALV_GRID_DISPLAY' ?

Please help me out with this requirement. Just using SORT option is not helping me out.

Thanks,

Nitin Karamchandani.

8 REPLIES 8
Read only

Rushikesh_Yeole
Contributor
0 Likes
1,274

declare the internal table with type SLIS_T_SORTINFO_ALV .

an pass to parameter in function module REUSE_ALV_GRID_DISPLAY

Read only

0 Likes
1,274

Hi RUSHIKESH,

My problem is after using SORT option in ALV.

So this is already in my code...

Regards,

Nitin Karamchandani.

Read only

0 Likes
1,274

Hi,

If there is no need of calculating subtotals or anything specific available in it_sort of REUSE_ALV_GRID_DISPLAY, just comment this it_sort in the FM and for sort basing on equipment no., sort your final internal table by equipment no. just before the fm REUSE_ALV_GRID_DISPLAY call.

Please check. This should work.

Regards

Srinivas

Read only

0 Likes
1,274

Hi Nitin,

Please check by passing no_merge as 'X' in the layout while creating the grid.

Regards,

Archna

Read only

deepak_dhamat
Active Contributor
0 Likes
1,274

Hi ,

Directly use

SORT internal table according to your requirment before passing to ALV grid Function module .

Regards

Deepak.

Read only

Former Member
0 Likes
1,274

hello guru,

sort the internal table for the first column ok .

thanks,

anji.

Read only

Former Member
0 Likes
1,274

Hi Nitin

Once you added a sort entry to an ALV grid, the groupings will automatically happen and cannot be changed. You can view the contents of the sort entry by holding ctrl and shift in and double-right click on the header next to the last column. Now click on the Sort Sequence. I tried changing the COMP == ' ', but that does not help either. The only way to display all data entries is to propose sort sequences on the selection screen, sort your data this way internally and remove this sort buttons - use IT_TOOLBAR_EXCLUDING as part of your first call to CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY.

Hope this helps, else post a bit more info if we're misunderstand your question.

Best regards, Adrian

Read only

Former Member
0 Likes
1,274

Equipment number, characteristics and Date of Creation fields

Change the order of the fields in ur internal table to equipment no., date..and then character..