Production order settelement to sales order......

Dear Experts,
Please some one look into the below issue....
Client following MTO with non-valuated sales order stock......at the time of sales order costing i will do sales order cost estimation and able to see th detailed plan prices in sales order....environment....cost report.....in that i have the options to see plan value and actual vlues....
After sales order costing i will able to see plan cost,,,,,,once the production order is completes ....i will settele the Production order to sales order....i am not able to see ,material wise comparision...the production order is setteled to sales order basedon the cost element insted of Materila......how will i get materila wise comparision at sales order level......for 100 raw material i have onbly one gl all cost is showing in single line item in sales order.....please some one look into this issue....
Thanks,
Chandrasekhar

it is not possible to caluculate OH for sales order???
my problam is if caluculate at production order level those OH will consider for variance caluculation?
Any workaround for this
Thanks
Chandu

Similar Messages

  • Settelment of (MTO) Production order to sales order.

    HI ,
    Can any one tell ,
    When we settle Production Order in MTO to Sales order
    What are the Accounting Documents Generated, Wheter system will generate Controlling document or Accounting Document.
    I have done the Process, But i m getting CO document.
    If it is wrong Pls tell me settings wht i m missing.
    Also Pls let me know the importance of settleing the MTO Production order to Sales order.
    Becos when i settle it there is not reflect on Sales order as System is generating Co document.
    Regards,
    Pavanidlur

    Dear PAVANIDLUR,
    Normally its generated automatically; by because here the Production Order and the Sales Order are the Cost Objects.
    Settlement Entry:
    FI:
    WIP Balance Sheet Acoutnt ...............Dr
            to WIP Balance Sheet Account
    CO:
    Production order witll be Credited
    Sales order witll be Debited.
    Dear experts correct if i m wrong;
    Regards.
    Raj

  • How to find out the list of Production orders created for sales orders

    Dear All,
    Our company wants to generate a report for a List of Materials sold out in a particular Product Hierarchy. Along with that we want to know the list of Production orders created for the sales orders.
    How to identify the production orders which are created based on Sales orders.
    Kindly suggest.
    Regards,
    Mullairaja

    Check these threads
    [Sale Order & Production Order|Sale Order & Production Order;
    [Re: Linking Production Order against a Sale Order MRP run|Linking Production Order against a Sale Order MRP run;
    thanks
    G. Lakshmipathi

  • Changing the Assignment of production order in sales order in MTO scenario.

    Hello all!
    I have following problem:
    After the MRP a production order was created for a sales order. Because of the production in another plant
    the production order which was created automatically had to be technically completed and a new one
    created.
    If you want to check now the availability, the sales order finds nothing, because it's linked to the one,
    which was technically completed. Now is the question how can I change the production order for this
    sales order. (In the production order the correct sales order is connected!)
    As I found out it's connected to the field AUFNR in the table VBEP. But how can I change this
    field within a transaction and not in the database?!?

    No replies

  • Production Order and Internal Order for each item of the sales order

    Hi
       I am developing Make To Order Report where I have to display the MTO Line Items and non MTO Line Items. For non MTO Line Items I have to display Internal order with Planned and Actual Costs and also Production Order with Planned and Actual Costs. Could anybody tell how to get the Internal order no and production order with Planned and Actual costs for each line item for a sales order.
    Thanks
    Naga

    Hi,
    You can get the Production orders, Planned orders, Internal orders generated for Sales order item from AFPO table (use fields KDAUF-Sales order number & KDPOS-Sales order item). Then to identify the order type use order category (AUTYP) from table AUFK.
    Once you have the Production/internal order, you can ge the cost from COSS and COSP table. Use the object number from AUFK to get the cost entries from COSS & COSP.
    You can use the following sample code as reference.
    Hope this is helps.. (Don't forget to mark it... )
    Form GET_COSTS                                                       *
    Get the material cost, labour hours and the labour cost for the      *
    sales order material.                                                *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_COSTS.
      DATA V_OBJNR LIKE AUFK-OBJNR.
    DATA v_menge LIKE vbap-kwmeng.
      SELECT SINGLE OBJNR
        INTO V_OBJNR
        FROM AUFK
       WHERE AUFNR EQ AFPO-AUFNR.
      SELECT * FROM COSS
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04'). " p_wrttp. "Labour Cost ( Plan, Actual)
        PERFORM GET_VALUES_FROM_COSS.
      ENDSELECT.
      SELECT * FROM COSP
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04')         " p_wrttp
         AND KSTAR NE '0000510033'. " EQ p_kstar2.      "Material Cost
        PERFORM GET_VALUE_FROM_COSP.
      ENDSELECT.
    Get the unit cost of the production order by dividing the production
    cost by the order quantity. The result will be multiplied by the
    GL posting qunatity (Delivery quantity) to get the production cost
    for the quantity being deluivered.
      IF NOT AFPO-PSMNG IS INITIAL.
        OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_ACT =
                          OUT_REC-ADDNL_LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_PLN =
                         OUT_REC-ADDNL_LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_ACT = OUT_REC-LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_ACT =
                         OUT_REC-ADDNL_LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_PLN = OUT_REC-LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_PLN =
                         OUT_REC-ADDNL_LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_ACT =
                         OUT_REC-ADDNL_MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_PLN =
                         OUT_REC-ADDNL_MATERIAL_COST_PLN / AFPO-PSMNG.
      ENDIF.
    Multiply the calculated Unit Production costs with the GL quantity to
    get the actual production cost of the quantity delivered.
    Calculation for Labour Hours
      OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_ACT = OUT_REC-ADDNL_LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_PLN = OUT_REC-ADDNL_LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
    Calculation for Material Cost
      OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_ACT =
          OUT_REC-ADDNL_MATERIAL_COST_ACT * OUT_REC-QUANTITY.
      OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_PLN =
          OUT_REC-ADDNL_MATERIAL_COST_PLN * OUT_REC-QUANTITY.
    Calculation for Labour cost
      OUT_REC-LABOUR_COST_ACT   = OUT_REC-LABOUR_COST_ACT *
                                   OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_ACT = OUT_REC-ADDNL_LABOUR_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-LABOUR_COST_PLN   = OUT_REC-LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_PLN = OUT_REC-ADDNL_LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
    Get the planned material cost from the total of the planned cost of
    the component materials in the production order confirmations.
      SELECT BWART MENGE MATNR SHKZG FROM AUFM
        INTO (AUFM-BWART, AUFM-MENGE, AUFM-MATNR, AUFM-SHKZG)
       WHERE AUFNR EQ AFPO-AUFNR.
        CHECK AUFM-BWART NE '101'.
        READ TABLE I_MBEW WITH KEY MATNR = AUFM-MATNR
                                   BWKEY = AFPO-DWERK.
        IF SY-SUBRC NE 0.
          SELECT MATNR BWKEY ZPLPR LPLPR PEINH
            FROM MBEW
            INTO I_MBEW
           WHERE MATNR EQ AUFM-MATNR
             AND BWKEY EQ AFPO-DWERK.
            APPEND I_MBEW.
          ENDSELECT.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IF I_MBEW-ZPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST +
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST -
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ELSEIF I_MBEW-LPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST +
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST -
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDSELECT.
    Get the Future material cost per Unit by deviding the calculated
    Future material cost above with the goods reciept quantity to, then
    multiply the unit cost with the GL quantity to get the Future material
    Cost for the Quantity delivered. (Quantity in the entery from GLPCA
    Table).
      IF NOT AFPO-WEMNG IS INITIAL.
        OUT_REC-PLANNED_MATERIAL_COST =
           OUT_REC-PLANNED_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
        OUT_REC-CURRENT_MATERIAL_COST =
           OUT_REC-CURRENT_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
      ENDIF.
    ENDFORM.                               " GET_COSTS
    Form GET_VALUE_FROM_COSP                                             *
    Get the Material cost from COSP table.                               *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUE_FROM_COSP.
      FIELD-SYMBOLS: <FS> TYPE ANY.
      DATA: V_COMPONENT TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT = 15.
      DO 16 TIMES.
        ADD 1 TO V_COMPONENT.
        ASSIGN COMPONENT V_COMPONENT OF STRUCTURE COSP TO <FS>.
        IF COSP-WRTTP EQ '04' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '04'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '01' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_PLN.
        ELSEIF COSP-WRTTP EQ '01'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUE_FROM_COSP
    Form GET_VALUES_FROM_COSS                                            *
    Get the Labour cost and Labour hours from the COSS table.            *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUES_FROM_COSS.
      FIELD-SYMBOLS: <FS1> TYPE ANY,
                     <FS2> TYPE ANY.
      DATA: V_COMPONENT1 TYPE I,
            V_COMPONENT2 TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT1 = 15.
      V_COMPONENT2 = 111.
      DO 16 TIMES.
        ADD 1 TO: V_COMPONENT1, V_COMPONENT2.
        ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
        ASSIGN COMPONENT V_COMPONENT2 OF STRUCTURE COSS TO <FS2>.
        IF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '04'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '01' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_PLN.
        ELSEIF COSS-WRTTP EQ '01'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUES_FROM_COSS

  • Production order from sales order with multiple line item(for one material)

    Dear Gurus,
    I am working in MTO scenarios. If there is several line item in a sales order for one material, multiple production order( same as no. of sales order line item) is getting created against each of the line item.My requirement is,since the material code is same in each line item and sales order is one, one production order should be generated for all line item. please tell me how to do it.
    (Here for one material, multiple line item is required for some specific reason)
    Regards
    Rajib Pathak

    Hi,
    This is not possible.
    In Std SAP will create one production order for one sales order. The stock is also allocated to thet particular sales order only. Because each and every sales order may vary in any one of the parameters. Considering this, SAP has designed like this.
    Regards,
    V. Suresh

  • Fields required for linking production order with sales order

    I need to link production order and sales order to get the part no#. need to see in md04.

    The link between production order and sales order can be made by using the KDAUF KDPOS fields of AUFK or AFPO and linking them to VBELN and POSNR of VBAP.
    Regards,
    Rich Heilman

  • Sales order - show total plan costs (from production order) on sales order

    Hi all,
    I have the following question/scenario:
    We create prodction order to collect cost (hours) for a service. There exists also a material master for this service.
    The confirmed hours are posted on the production order and then setteld to the respective sales order (settlement rule SDI).
    What to I have to maintain/customize to show the total plan cost (for the service) on gthe sales order?
    If I check the sales order via VA03 --> environment --> cost report , I can see the planned sales revenue but no planned costs?
    (the actual value flows work so far, postings via settlement or billing document).
    I hope the topic is understandable. Any ideas?
    Thanks in advance.
    Edited by: Butch66 on Sep 27, 2010 7:07 PM
    Edited by: Butch66 on Sep 27, 2010 7:08 PM

    Hi
    Planned costs from prod order can not show on sale order.. Both are 2 separate entities in their own respects
    Unless you calculate sales order cost estimate on your sales order, you cant see planned costs on sale order...
    To calculate sale order cost estimate, make settings in your requirement class...
    1. Go to procurement tab of sale order
    2. See whats the requirement type
    3. Go to IMG > Controlling > Prod cost Contr > Cost Obj Contr > Prod Cost by Sales Order > Control of Requirements
    4. Here you can see mapping of req type to req class....
    5. If you want to have sales order costing and have sales order as CO object inorder to have sales order wise profitability, you should have following settings in Req class...
    >Acct Assignment Category should be E
    >Costing: Either Blank or X
    >Costing Id and Costing Method: As per your requirement
    Regards
    Ajay M

  • Confirmation of the production order qty equal to sales order qty

    Hi Experts,
    I need to control the confirmation of the production order should be equal to sales order qty.
    I'm having the scenario as follows
    If sale order qty for X material = 3
    while running the MRP, system will plan the order qty as 8 because of we maintained rounding profile in the Material master and enhancement we used for this.
    Rounding Profile Qty=5
    Total Production Order Qty=8.
    But, finally they will do the GRN for sales order qty only, remaining will be used for testing purpose.
    So, the confirmation also has to happen for only sales order qty. There, we need to control the qty based on the sales order.
    Is there any exit or Enhancement is available for this.
    Please help me.
    Naren

    Hi,
    Exit for confirmation check is CONFPP04.
    However, opening orders for quantities higher than demand and leaving pieces undelivered and unconfirmed in production orders does not make sense. I could not get the requirement of incresing production quantity by adding rounding value? Moreover, if rounding is to be used for test purposes, why not do you receive them into stock? Why don't you receive 8 pieces into stock, deliver 3 pieces to sales order and transfer 5 pieces to related department?
    If it is because of MRP and you really do not want to produce extra 5 piece immediately, you may use material reservation or any other form of demand for 5 pieces, use EX for lot size calculation and have MRP create two planned orders for sales order and testing requirement, then you can convert planned order for sales order requirement into production order and continue processing.
    Regards.

  • Issue with production order linked to quote instead of sales order

    Hi Gurus,
    I did a lot of digging through SAP notes and accross the internet. Before I contact SAP, just wanted to give a shot @ SDN. Please help.
    Background- for ATO (VC assemble to Order):
    i) Created a quote
    ii) Created a sales order with reference to a quote
    iii) MRP created a planned order and the planned order is linked to the quote
    iV) Production order created and it is also linked to a quote
    v) All reports, MD04/COOIS shows that the plnd order/prd order is linked to the quote
    My issue - print a shop paper or a customer specific product ID label....guess what 'it prints the quote number everywhere'.
    Everything is tied to a quote - which is not a real demand. All purchase orders are tied to the quote. THIS IS STUPID.
    I refered to SAP Notes - 181685 and 459734. But I need details of what config settings I should do and where?
    I'm a pure PP guy, getting into SD requirement type & account assignement settings. Please help me with details.
    http://scn.sap.com/message/8018953#8018953
    This guy also had the same problem and his issue was never resolved.
    Thanks,

    Hello
    Take a look on the following note where this scenario is described:
    16658 - Generate sales order stock based on quotation
    The note proposes the following setting as a workaround to this issue:
    "As of 3.0, when the requirements type is assigned to the transaction
    during requirements type determination, it is possible to assign a
    requirements type to the quotation that does not represent make-to-order
    production."
    Therefore, please check your customizing settings and make sure that a requirement class/type (transactions OVZG and OVZI) without MTO is assigned to the quotation item category (transaction OVZI).
    On transaction OVZI, there is a field called "Origin of requirement type in requirement type determination". Please take a look on the information provided on the F1 help of this field:
    ========================================================================
    Origin of requirement type in requirement type determination
    In the standard release, the requirements type is determined according
    to a certain search strategy depending on the strategy group of the
    material.
    In this field you can select an alternative search strategy (source):
    Source 0 = Material master strategy, then item category and MRP type
    Source 1 = Item type and MRP type strategy
    Source 2 = Item type and MRP type strategy (as for source 1) with
    additional check of the allowed requirements type
    ========================================================================
    Therefore, my suggestion is to set this field to 1 for the quotation item category and assign an MTS requirement type on OVZI.
    BR
    Caetano

  • Sales order Link to Production order

    Hi
    Expert
    We dont have MRP and not MTO but it is MTS item categary maintain is NORM.
    In this i want to link the Sales order to Production Order.
    I tried Co08 but i got error like this sales order has no CO object
    Message no. CO323
    Is there is need to done customization in PP point of view or in CO point of viewplease tell me.
    Thanks & Regards
    Pert

    Not answered closing thread

  • Sales Order Conversion to Production Order

    Dear All,
    I am from SD and have a doubt reg SD - PP ...
    If i have 3 sales orders and each sales order has 3 line items. Now i need to make a production order --- the production order to have 1 line item from each sales order so in all 3 production orders for the 3 sales orders and each production order has 3 line items and each line item is from diffrent sales orders i.e as above 3 sales orders.
    is it possible and how ?
    I am awaiting for a suitable solution ASAP...
    Thnks
    krishna

    Hi,
    In PP always 1 production order is for only 1 product ( if no co-product is added in BOM).
    In your scenario, If the PP settings & master data are maintained perfectly.
    System will create 9 production orders ( this may vary with respect to the lotsizing procedure used).
    Reward points if useful
    Thanks & regards
    Mahesh babu
    Edited by: Mahesh Babu MG on Jan 30, 2008 7:19 PM

  • Sales Order Text to Production Order Text

    Dear Experts,
    When creating a sales order in VA01, I added in some comments in the item level Texts tab.
    How can I configure the system so that when a production order is created from this sales order, the comments entered in the sales order will be automatically populated in the Long Text tab of Production Order header.
    This is because during the creation of sales order, there may be certain comments and/or instructions that need to be passed to the production line. We want the texts to flow through to the production order automatically.
    Any ideas?
    Thanks in advance.

    Hi,
    The problem is solved.
    In SD side, there's a transaction VOTXN. Change the configuration for Sales Order Item.
    Add a Text ID 0006 (Production Memo) in Textprocedure with Access Sequence 21 (Material Sales).
    In Access Sequence 21, map Text Object VBBP (Sales Order Item Text) to ID 0006 (Production Memo).
    Save it.
    When you create your sales order, in the item text level, you'll be able to see an additional text type of Production Memo. Enter your text here and save the sales order. When production order for this Sales Order is created, Production Memo tab will automatically appear (as mentioned by Peter earlier).
    Thanks.

  • How to compare sale order bom and production order bom.

    i would like to provide report with respect to comparation of sale order bom and production order bom, but i am not familiar with SD and PP, can anyone give me some clue? i only know sale order bom is created via 'CS61', afterwards run mrp to get production order, the process appears complicated, i needn't know the process detail, just want to know how to get sale order bom and relative production order bom. please guide me.

    Hi,
    Check Tcode:CS14 to SD/PP BOM's
    Chidambaram

  • Sale Order & Production Order

    Hi! Friends
    is there any table that links Sale Order and Production Order.  In a report i need to display the Production order based on the sale order .
    as there is no key field for the table MSEG im not able to use it.
    i have tried using the table AFPO and a Function Module - MD_MRP_LIST_API but dnt help me
    Is there any table that links Sale Order and Production Order.
    Thanks and Regards
    Kv

    TABLES : VBAK,  " Sales Header Data
             AFKO,  " Order Header Data
             AFPO,  " Order Item Data
             AUFK
    DATA : IT_VBAK LIKE VBAK OCCURS 0  WITH HEADER LINE,  "To get Customer No,Sales Order Creation Date.
           IT_AUFK LIKE AUFK  OCCURS 0  WITH HEADER LINE, " ORDER MASTER TO GET ERDAT.
           IT_AFKO LIKE AFKO  OCCURS 0  WITH HEADER LINE, "To get Target Qty & Confirm Qty.
           IT_AFPO LIKE AFPO OCCURS 0  WITH HEADER LINE,  "To get Sales Order No.,Material
    SELECT * FROM AFKO INTO TABLE IT_AFKO
           FOR ALL ENTRIES IN IT_AUFK
           WHERE AUFNR = IT_AUFK-AUFNR.
          SELECT * FROM AFPO INTO TABLE IT_AFPO
            FOR ALL ENTRIES IN IT_AFKO
            WHERE MATNR IN SO_MATNR
            AND AUFNR = IT_AFKO-AUFNR.
          SELECT * FROM VBAK INTO TABLE IT_VBAK
            FOR ALL ENTRIES IN IT_AFPO
            WHERE VBELN = IT_AFPO-KDAUF.
    I.E
    AFPO-KDAUF = VBAK-VBELN

Maybe you are looking for