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: 

loop at ITAB where condition

Former Member
0 Kudos

Hi,

here i want to use Loop at itab where fkart eq 'YRE' and fkart eq 'YPR'.

LOOP AT ITAB WHERE ?

l_stk2 = l_stk2 + ITAB2-FKLMG.

ENDLOOP.

here in the itab if any(YRE,YPR) one of the condition matches then populate the data.How to write the statement.

Thanks,

Rajendra.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

LOOP AT ITAB WHERE FKART = 'YRE' OR FKART = 'YPR'.
l_stk2 = l_stk2 + ITAB2-FKLMG.
ENDLOOP.
6 REPLIES 6

Former Member
0 Kudos

hi ,

try this

LOOP AT ITAB WHERE YRE = 'value' or YPR = 'value'.

l_stk2 = l_stk2 + ITAB2-FKLMG.

ENDLOOP.

Former Member
0 Kudos

LOOP AT ITAB WHERE FKART = 'YRE' OR FKART = 'YPR'.
l_stk2 = l_stk2 + ITAB2-FKLMG.
ENDLOOP.

Former Member
0 Kudos

Hello,

Use this code:

LOOP AT itab WHERE fkart EQ 'YRE' OR fkart EQ 'YPR'.

....

ENDLOOP.

Former Member
0 Kudos

Hi ,

I dint think the condition you have said will ever come a varaible can never have 2 values at the same time.

My understanding is your requiremetn is when fkart eq 'YRE' or fkart eq 'YPR'.

the code for this is as given below

LOOP AT ITAB WHERE fkart eq 'YRE' or 
                                    fkart eq 'YPR'.


ENDLOOP.

Regards

Arun

Former Member
0 Kudos

LOOP AT ITAB WHERE FKART = 'YRE OR FKART = 'YPR'.

ENDLOOP.

Regards,

Ravi

p291102
Active Contributor
0 Kudos

Hi,

LOOP AT ITAB WHERE FKART = 'YRE AND FKART = 'YPR'.

ENDLOOP.

Regards,

Star Shankar