Application Development 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: 

system fields

Former Member
0 Kudos

Can we change system field values? Please give explanation on the basis of sy-lsind.?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

In case sy-lsind, we cann't make forward navigation, and we can make backword navigations.