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

How to get current loop pass for LOGICAL DATABASE

Former Member
0 Likes
839

HI,

can anyone tell me how to find the current loop pass in case of logical db.

As i have to put some condition when cursor goes to GET statement 2nd time..??

Mrunal

5 REPLIES 5
Read only

Former Member
0 Likes
654

HI

Try sy-loopc.

Aditya

Read only

0 Likes
654

hi,

SY-loopc is not working?

any other solution?

Mrunal

Read only

Former Member
0 Likes
654

Hi,

You could first declare a variable and set it value initially to 0.Then just after the Get statement increment the value by 1.

So when the Get statement is executed for the first time,the value of variable will be 1,when it is executed the 2nd time,the value of variable will be 2 and so on...

Hope it works,

Thanks,

Sandeep.

Read only

Former Member
0 Likes
654

U need to explicitly handle this in the program.

START-OF-SELECTION.

DATA V_I TYPE I.

    • Get Event starts

GET PERAS.

V_I = V_I + 1.

IF v_i = 2.

*write the condition ...

ENDIF.

END-OF-SELECTION.

Read only

0 Likes
654

..Or similarly


DATA count TYPE i VALUE 1.

GET BSEG.
* do something
  ADD 1 TO count.

END-OF-SELECTION.