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

regarding loop statement

Former Member
0 Likes
615

hi experts,

i am using loop statement in my program to segregate 'H' AND 'S',BUT MY LOOP statement picking 'H' also if i run loop for 'S'....here is my loop statement..plz help me rectify this:::

loop at itab_101 where bwart eq '101' or bwart eq '531' OR BWART eq

'309' OR BWART eq '301' and shkzg eq 'S'.

endloop.

*where bwart eq movement type.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
577

Hi

loop at itab_101 where ( bwart eq '101' or bwart eq '531' OR BWART eq

'309' OR BWART eq '301' ) and shkzg eq 'S'.

reward points to all helpful answers

kiran.M

4 REPLIES 4
Read only

Former Member
0 Likes
578

Hi

loop at itab_101 where ( bwart eq '101' or bwart eq '531' OR BWART eq

'309' OR BWART eq '301' ) and shkzg eq 'S'.

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
577

Hi,

Try this,

loop at itab_101 where itab_101-bwart eq '101' or itab_101-bwart eq '531' OR itab_101-BWART eq '309' OR itab_101-BWART eq '301' and itab_101-shkzg eq 'S'.

Regards,

Padmam.

Read only

Former Member
0 Likes
577

Hi Ravi,

Put the two conditions in different blocks. Eg.

loop at itab_101 where ( bwart eq '101' or bwart eq '531' OR BWART eq

'309' OR BWART eq '301' ) and shkzg eq 'S'.

something like this will solve your issue.

revert for more clarifications if required.

regards,

Vikas

<b>Always reward helpful answers.</b>

Read only

Former Member
0 Likes
577

Hi Ravi,

loop at itab_101 where bwart eq '101' or bwart eq '531' OR BWART eq

'309' OR BWART eq '301' .

if itab_101-shkzg eq 'S'.

endif.

endloop.

Regards

Arun