on 2005 Jul 29 2:35 PM
First of all I would like to know the difference between sy-lsind and sy-listi.
Below is one code snippet wherein my requirement is that when I click on list number 5 it should take me to basic list.
But when I click on list number 5, it takes me to list number 1.
How should I go about this to come from top level list to basic one again ?
REPORT Test.
AT LINE-SELECTION.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List',sy-listi.
IF sy-lsind = 5.
sy-lsind = 0.
ENDIF.
START-OF-SELECTION.
Write : 'This is Basic List'.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List', sy-listi.
hey man this is very simple, just play with LSIND.
subtract -n to go back
and add +n to go forward, try it .
n = 1,2,3.....n
regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nitin,
Sy-lsind = Index of the list being created.
sy-listi = Index of the list from which an event was fired.
Look at the code below :
START-OF-SELECTION.
Write : 'This is Basic List'.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List', sy-listi.
AT LINE-SELECTION.
IF sy-listi = 5.
sy-lsind = 0.
else.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List',sy-listi.
ENDIF.
So, if you want to go to basic list after clicking on list number 5, you will have to use sy-listi in your condition.
I have added an additional else part in my code. This will make it easier to understand.
Regards
Mitesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Change the position of the if clause
AT LINE-SELECTION.
IF sy-lsind = 5.
sy-lsind = 0.
ENDIF.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List',sy-listi.
START-OF-SELECTION.
Write : 'This is Basic List'.
WRITE : 'Current Index', sy-lsind.
WRITE : 'Current List', sy-listi.
SY-LSIND - Index of the list created during the current event (basic list = 0)
SY-LISTI - Index of the list level from which the event was triggered
Svetlin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regards.
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
11 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.