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

logic help!

Former Member
0 Likes
458

Hi frnds

the requirement is for contract details report..

i have to first select first vendor then process corresponding po's individually

then come back to second vendor and process its po's individually ... goes on

the problem is that, i took two loops for vendor and po of same content..

i am doing with on change of ..

for the first vendor and and its po's its working..

its coming back to vendor and when it goes into second loop for its po's ... it processing the first po of the

table ... but i want to take and process its corresponding po's and repeat..

can u help?

3 REPLIES 3
Read only

Former Member
0 Likes
431

Hi!

You might try out this way:

SORT gt_po BY lifnr ebeln. "if you have performance issues, use SORT

LOOP AT gt_vendor INTO gs_vendor.

...

LOOP AT gt_po INTO gs_po WHERE lifnr = gs_vendor-lifnr.

...

ENDLOOP.

...

ENDLOOP.

Regards

Tamás

Edited by: Tamás Nyisztor on Apr 29, 2008 11:14 AM

Read only

Former Member
0 Likes
431

Hi,

read the second loop using where condition ...

loop at po_tab where vendor = vendor.

endloop.

Read only

Former Member
0 Likes
431

Hi,

One thing you can do is get all then vendors into an internal table, so based on vendors u can select the relevant vendors by using loop statement. the other way if you want to process using only one internal table,

make sure lifnr is set as 1st field of the internal table and then the PO field. now use AT NEW or AT END OF based on your requirement.

Regards,

Aravind M