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

Problem with Data element in an ALV

Former Member
0 Likes
782

Hi Team,

I am working on ALV with sort criteria.

I have 2 columns of data elements with domains as follows:

EISBE -- MENG13

LABST -- MENG13V

I have also applied a sort criteria on these both fields, as follows:

l_wa_sort-fieldname = 'EISBE'.

l_wa_sort-spos = 1.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

l_wa_sort-group = '*'.

  • l_wa_sort-subtot = c_x.

append l_wa_sort to l_i_sort.

l_wa_sort-fieldname = 'LABST'.

l_wa_sort-spos = 2.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

l_wa_sort-group = '*'.

append l_wa_sort to l_i_sort.

Now, passed the sort criteria to the FM " Reuse_Alv_grid_display".

Unfortunately, sort is working on the second column, but not on the first.

Kindly help me on the same.

Note:

1. I have also tried by using the same data elements for my internal table.

2. In SE16 in MARC table, we can find this data element, and when we display the contents as ALV grid, the same sort operations are not working.

Thank you,

Regards,

Shashi

Edited by: Shashikanth Divakaruni on Nov 19, 2009 12:45 PM

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
741

Hi Shashikanth Div...,

in display, in an area outside the grid values displayed (right of or below), hold left shift-key and double-right-click(!) the mouse. The ALV consistency check comes up. Click on the fieldcatalog button so see if you really use the correct field and table names for the sorting. You can also click the SORT button to see what is used for sorting.

I think the error will be obvious.

Regards,

Clemens

Hi Team,

I am working on ALV with sort criteria.

I have 2 columns of data elements with domains as follows:

EISBE -- MENG13

LABST -- MENG13V

I have also applied a sort criteria on these both fields, as follows:

l_wa_sort-fieldname = 'EISBE'.

l_wa_sort-spos = 1.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

l_wa_sort-group = '*'.

  • l_wa_sort-subtot = c_x.

append l_wa_sort to l_i_sort.

l_wa_sort-fieldname = 'LABST'.

l_wa_sort-spos = 2.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

l_wa_sort-group = '*'.

append l_wa_sort to l_i_sort.

Now, passed the sort criteria to the FM " Reuse_Alv_grid_display".

Unfortunately, sort is working on the second column, but not on the first.

Kindly help me on the same.

Note:

1. I have also tried by using the same data elements for my internal table.

2. In SE16 in MARC table, we can find this data element, and when we display the contents as ALV grid, the same sort operations are not working.

Thank you,

Regards,

Shashi

Edited by: Shashikanth Divakaruni on Nov 19, 2009 12:45 PM

5 REPLIES 5
Read only

Former Member
0 Likes
741

Hi,

try to pass below options in fieldcatalog and see

i_fieldcatalog-QUANTITY = 'X'.

i_filedcatalog-QFIELDNAME = MENGE.

thanks & regards,

sateesh.

Edited by: sateesh kumar on Nov 19, 2009 12:56 PM

Read only

0 Likes
741

Hi Sateesh,

The suggestion does not give the result..

Please let me know if there are any other ways for it.

Thank you,

Regards,

Shashikanth. D

Read only

0 Likes
741

Hi Shashikanth,

use the below code to sort.

l_wa_sort-fieldname = 'EISBE'.

l_wa_sort-spos = 1.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

append l_wa_sort to l_i_sort.

l_wa_sort-fieldname = 'LABST'.

l_wa_sort-spos = 2.

l_wa_sort-tabname = 'FP_I_OUTPUT'.

l_wa_sort-up = c_x.

append l_wa_sort to l_i_sort.

Hope this might help you.

Regards,

Phani.

Read only

Clemenss
Active Contributor
0 Likes
742

Hi Shashikanth Div...,

in display, in an area outside the grid values displayed (right of or below), hold left shift-key and double-right-click(!) the mouse. The ALV consistency check comes up. Click on the fieldcatalog button so see if you really use the correct field and table names for the sorting. You can also click the SORT button to see what is used for sorting.

I think the error will be obvious.

Regards,

Clemens

Read only

Former Member
0 Likes
741

Got the answer and thanks.