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

Logic

Hi

I need to display the list of consumed materials under a production order using a RFC FM.if the Production order is made up of a material 100 wih a components X & Y .I need to display Material :100 Component X qty :10

Material :100 Component Y qty :10.

If production order is made up of Material 200 with components Z & 100. I need to dispaly Material 200 Component X qty :10

Material 200 Component Y qty :10

Material 200 Component Z qty :10.

If production order is made up of Material 300 with components A & 200.I need to dispaly Material 300 Component A qty :10

Material 300 Component X qty :10

Material 300 Component Y qty :10.

Material 300 Component Z qty :10.

Please help me how to write a logic for this ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2007 at 12:16 PM

    sort the itab data by material and components..

    you'l get desired result..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2007 at 01:49 PM

    Hi,

    Try like this:

    DATA OFF TYPE I.

    DATA: BEGIN OF LINE,

    COL1(10) TYPE N,

    COL2(10) TYPE C,

    COL3(6) TYPE p decimals 3,

    COL4(10) TYPE C,

    END OF LINE.

    DATA ITAB LIKE STANDARD TABLE OF LINE

    WITH NON-UNIQUE KEY COL2.

    LINE-COL1 = 4500000327.

    LINE-COL2 = '5000000539'.

    LINE-COL3 = '10.000'.

    LINE-COL4 = '04.09.2007'.

    APPEND LINE TO ITAB.

    LINE-COL1 = 4500000327. LINE-COL2 = '5000000542'. LINE-COL3 = '10.000'. LINE-COL4 = '14.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000327. LINE-COL2 = '5000000543'. LINE-COL3 = '10.000'. LINE-COL4 = '04.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000329. LINE-COL2 = '5000000554'. LINE-COL3 = '10.000'. LINE-COL4 = '06.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000329. LINE-COL2 = '5000000554'. LINE-COL3 = '10.000'. LINE-COL4 = '06.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000303. LINE-COL2 = '5000000550'. LINE-COL3 = '5.000'. LINE-COL4 = '06.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000303. LINE-COL2 = '5000000551'. LINE-COL3 = '2.000'. LINE-COL4 = '07.09.2007'. APPEND LINE TO ITAB.

    LINE-COL1 = 4500000334. LINE-COL2 = '5000000556'. LINE-COL3 = '5.000'. LINE-COL4 = '06.09.2007'. APPEND LINE TO ITAB.

    PERFORM LIST.

    FORM LIST.

    data: cl like line-col1.

    SKIP TO LINE 3.

    LOOP AT ITAB INTO LINE.

    if cl <> line-col1.

    write : / line-col1.

    else.

    write :/10 ''.

    endif.

    write : line-col2, line-col3, line-col4.

    cl = line-col1.

    ENDLOOP.

    ENDFORM.

    Regards,

    Bhaskar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Bhaskar

      My requirement is like this .Input to the function module are Plant,Material No & batch no.Batch no is the last 10 digits of the production order.so In the function module I prefix 10 to the Batch no to get the production order no and I am fetching the consumed components for that specified FG and Batch.

      I.e user inputs Plant :X material 100 batch no :0000000001

      If prod 100000000001 for material 100 is created,I need to display all the consumed components for this.as this material is made up of material type raw.I am fetching and displaying.

      O/P :Assembly :100 Component X qty :10,Assembly :100 Component Y qty :10.

      I.e user inputs Plant :X material 200 batch no :0000000002

      If prod 100000000002 for material 200 is created, Material 200 is made up of raw material and semi finished good (it will have batch no 0000000001) so again I need to fetch the details of prod order 100000000001 cosndumed material and cumulate if there exists any same component.

      O/P : Assembly :200 Component X qty :10,

      Assembly :200 Component Y qty :10

      Assembly :200 Component Z qty :10.

      And this should drill down further by checking the batch no. How to implement this logic,so that program is robust.

      Please let me know if you need still further clarification.

      Thanks

      First

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.