Skip to Content
avatar image
Former Member

regarding loop statement

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 20, 2007 at 06:11 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 06:12 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 06:16 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 06:24 AM

    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

    Add comment
    10|10000 characters needed characters exceeded