Skip to Content
author's profile photo Former Member
Former Member

logic help!

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 09:17 AM

    Hi,

    read the second loop using where condition ...

    loop at po_tab where vendor = vendor.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2008 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.