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

Improper List Navigation

Former Member
0 Likes
447

Hi gurus,

I am generating a list screen for Flight data, but in my case, I have provided user with interactive push-buttons on basic list for sorting in ascending and descending order. But, when I press sort-ascending it's displaying the data on another list and further more when I press sort-decending it's displaying the data on another list.

I noticed this problem, when I pressed F3 to get back to selection-screen, rather it took the screen with values sorted in ascending order and then again to basic list.

Can anyone suggest to overcome this.

I wait for your valuable suggestions.

Thankyou.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
374

Hello Johny,

help.sap.com is the best temple to search your queries first.

And Johny, don't hesitate to search SCN.

The actual problem is due to not using SY-LSIND EQ listnumber.

Look, basic list number is 0, secondary list is 1.

What you have done is, you coded but forgot to REDEFINE LIST-NUMBER ,

Please read about SY-LSIND system field, which holds list-numbers. It's usually assumed that SY-LSIND is to check list-number in conditions. But, it can also be used to redefine list-numbers.

For example:


PERFORM get_flight_data.
PERFORM put_flight_data.
sy-lsind = 1.               " Re-directing to secondary list.
"or
sy-lsind = 0.               " Re-directing to basic list

PERFORM sort_flight_data_ascending.
PERFORM put_sorted_data.

sy-lsind = 1.

PERFORM sort_flight_data_descending.
PERFORM put_sorted_desc_data.

Try, with this code Johny, hope that would sweep-away your problem.

Thanks: Zahack

2 REPLIES 2
Read only

Former Member
0 Likes
375

Hello Johny,

help.sap.com is the best temple to search your queries first.

And Johny, don't hesitate to search SCN.

The actual problem is due to not using SY-LSIND EQ listnumber.

Look, basic list number is 0, secondary list is 1.

What you have done is, you coded but forgot to REDEFINE LIST-NUMBER ,

Please read about SY-LSIND system field, which holds list-numbers. It's usually assumed that SY-LSIND is to check list-number in conditions. But, it can also be used to redefine list-numbers.

For example:


PERFORM get_flight_data.
PERFORM put_flight_data.
sy-lsind = 1.               " Re-directing to secondary list.
"or
sy-lsind = 0.               " Re-directing to basic list

PERFORM sort_flight_data_ascending.
PERFORM put_sorted_data.

sy-lsind = 1.

PERFORM sort_flight_data_descending.
PERFORM put_sorted_desc_data.

Try, with this code Johny, hope that would sweep-away your problem.

Thanks: Zahack

Read only

Former Member
0 Likes
374

Hi,

Use the code below...

case sy-ucomm.
  when 'ASCENDING'.
    sy-lsind = sy-lsind - 1.
    <code to sort ascending>
  when 'DSCENDING'.
    sy-lsind = sy-lsind - 1.
    <code to sort ascending>
endcase.

Regards,

Siddarth