Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to work with loops if certain condition to be fulfill.


I have following conditions.


seq  plant storage loc  material

01    p1      s1                m1

02    p2      s2                 m1

03   p3      s3                m1 


material   plant   storage loc.      date                      qty.            mrp area

m1              p1       s1                00000000          0 or q1          mr1

m1              p1       s1                20140102           0 or q1         mr1

m1              p1       s2               00000000            0 or q1          mr1

m1              p1       s3                00000000           0 or q1          mr2

m1              p1       s3                20140102          0 or q1           mr2

now I have to pick the qty from itab 2 as follow.

I need to see first seq (01) in itab1 first and for that I have to pick the desired qty (suppose 6). first with the storage loc s1.

it should search in itab2 for s1 with date 000000.this belongs to mrp area mr1.if it finds the sufficient qty then process the remaing logic otherwise

it should search with other storage loc s2 in same mrp area MR1 where date is 000000.if not then go with s3 but as s3 has diff mrp now it should come back and search with s1 where date is not 0000000. then with s2 with same condition.after that it should go with other mrp area.

I am trying but not able to achieve it completely. please help me to code this.

Former Member
Not what you were looking for? View more on this topic or Ask a question