‎2008 Apr 29 10:10 AM
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?
‎2008 Apr 29 10:14 AM
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
‎2008 Apr 29 10:17 AM
Hi,
read the second loop using where condition ...
loop at po_tab where vendor = vendor.
endloop.
‎2008 Apr 29 10:20 AM
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