12-21-2006 6:17 AM
Can we change system field values? Please give explanation on the basis of sy-lsind.?
12-21-2006 6:23 AM
Yes, few times the requirement makes us to change the system values that are populated fields at run-time.
Also note that some of these fields will be re-determined for each step execution.
<b>SY-LSIND</b> - This variable is for List Index.
Will be used in Interactive lists.
Consider an example where we have generated one basic list and 3 secondary lists.
So the users requirement is to get back to the selection screen when he/she uses the BACK(F3).
In this case, we can acheive by changing the list index.
SY-LSIND = 0.
Hope the info gives you some idea.
Kind Regards
Eswar
12-21-2006 6:20 AM
no u can not chnage the system field values but wht u can do is u can store them in some variabgle on some condition and then do processing based on tht variable..
otherwsie u can not change the sy values at runtime..
reward if helpfull
12-21-2006 6:23 AM
Yes, few times the requirement makes us to change the system values that are populated fields at run-time.
Also note that some of these fields will be re-determined for each step execution.
<b>SY-LSIND</b> - This variable is for List Index.
Will be used in Interactive lists.
Consider an example where we have generated one basic list and 3 secondary lists.
So the users requirement is to get back to the selection screen when he/she uses the BACK(F3).
In this case, we can acheive by changing the list index.
SY-LSIND = 0.
Hope the info gives you some idea.
Kind Regards
Eswar
12-21-2006 6:23 AM
Hi,
Yes..You can change SY-LSIND..
Example.
WRITE: / 'BASIC LIST'.
AT LINE-SELECTION.
WRITE: / 'AT LINE SELECTION'.
SY-LSIND = 1.
When user presses back button it will take you to the basic list..
Thanks,
Naren
12-21-2006 6:24 AM
Hi Sunil,
ABAP system fields are always available in your progams or system programs. You should treat them as constants & not modify them directly as important information for the flow of the program may be lost.
SY-LSIND-This system field is set by the runtime environment. Its content can be changed in the ABAP program to influence the runtime environment.
For a complete detail on this refer the link provided by SAP below:
<a href="http://help.sap.com/saphelp_erp2004/helpdata/EN/7b/fb96c8882811d295a90000e8353423/frameset.htm">http://help.sap.com/saphelp_erp2004/helpdata/EN/7b/fb96c8882811d295a90000e8353423/frameset.htm</a>
Regards,
Chetan.
PS:Reward points if this helps.
12-21-2006 6:32 AM
Hi,
Yes you can make changes to the system fields , you can do that in debugging also.
With respect to sy-lsind , when you make chages to this you bsaically move to the level you have specified in the new value of sy-lsind.
Only thing you need to remeber in case of sy-lsind is that it works when you reduce the value of it , but not when you try to modify the value with a higher value.
Execute this code , put a breakpoint at the event AT LINE-SELECTION , change the value of sy-lsind and see the result.
data : v_string(100),
v_count type num02 .
start-of-selection.
v_string = 'test'.
clear v_count.
write v_string.
hide v_string.
at line-selection.
v_count = v_count + 1.
concatenate v_string v_count into v_string.
write:/ v_string.
Regards
Arun
Reward with points if found helpful
12-21-2006 6:48 AM
Hi,
In case sy-lsind, we cann't make forward navigation, and we can make backword navigations.