Need to Post Components in Production Order in MB1A through BAPI as Planned Good Issue

Hi ,
I have created a Program to upload data s for MB1A through BDC , it works fine, but for huge data s it takes more time.  alternatively created one more Program which updates through BAPI Function Module  "BAPI_GOODSMVT_CREATE".  It works fine , but one issue noted, after posting through Function Module , components are posted as Unplanned Goods Issue.   I need to post the components as " Planned Goods Issue" instead of "Unplanned Goods Issue " . This can viewed through Tcode : C003
Below are the  inputs passed for BAPI Function Moduel
**&------Header Contents of bapi Upload-------------------&*
header-pstng_date = sy-datum.                                              " Posting date
header-doc_date    = sy-datum.                                             " Document Date
header-header_txt  = '000001002280'.                                     " Header text
header-pr_uname   = sy-uname.                                            " User Name
header-ref_doc_no  = '000001002280'.                                    " Header Ref. Doc. No.
CONCATENATE sy-uname sy-uzeit c_method INTO  header-ref_doc_no_long SEPARATED BY '-'.  " Refer  Text
*Item Data
wa_item-material   = '000000000010000800'.                             "Material
wa_item-plant      = '3910'.                                              "Plant
wa_item-stge_loc   = 'WIP'.                                            "Storage Location
wa_item-move_type  = '261'.                                            "Movement Type
wa_item-entry_qnt  = '1'.                                                  "Quantity
wa_item-entry_uom  = 'PC'.                                              "Unit
*wa_item-res_item  =  1.                                                  "Reservation Item
*wa_item-reserv_no =                                                      " Reservation Number
wa_item-batch      = '0000011027'.                                    "Batch No
*wa_item-mvt_ind   = 'F'.                                                  "Movement Indicator
*wa_item-stck_type = 'F'.                                                 "Stock Type
wa_item-orderid    = '000001002260'.                                 "Order ID
wa_item-prod_date  = SY-DATUM.
*wa_item-GL_Account = '610000'.                                     "GL Account
*TRANSLATE wa_item-batch TO UPPER CASE.
*APPEND wa_item TO it_item.
c_code = '03'.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header       = header
goodsmvt_code         = c_code
TABLES
goodsmvt_item         = it_item
goodsmvt_serialnumber = it_sno
return                = return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
      wait = 'X'.
    commit work and wait.
Even i tried to pass "Movement Indicator , GL Account etc" , Still not able to fix the issue. Can anyone suggest how to post the Production Order components as "Planned Goods Issue".  I am not sure any other values to be password.
BR,
Murali

I have made something like your :
* Alimtentation de la BAPI de mouvement de stock MM.
move : sy-datum        to ls_header-pstng_date ,
        sy-datum        to ls_header-doc_date ,
* Indique le code mouvement
        '03'            to lw_code.      " 03 normalement, mais je veux que ca plante
loop at lt_ltap
      into ls_ltap.
   move : ls_ltap-matnr   to ls_item-material ,
          ls_ltap-werks   to ls_item-plant ,
          ls_ltap-lgort   to ls_item-stge_loc ,
          '261'           to ls_item-move_type ,
          ls_ltap-vsolm   to ls_item-entry_qnt ,
          ls_ltap-meins   to ls_item-entry_uom ,
          i_ltak_vb-benum to ls_item-orderid ,
          i_ltak_vb-rsnum to ls_item-reserv_no ,
          ls_ltap-rspos   to ls_item-res_item ,
          ls_ltap-rsart   to ls_item-res_type.
   append ls_item to lt_item.
   clear  ls_item.
endloop.
I have to put the reservation number to have it works.
Fred

Similar Messages

  • Modify production order tolerance limits through BAPI

    Hi experts,
    I need to modify tolerance limits at production orders, but I can't find a BAPI that acomplishes my needs. Nor BAPI_ALM_ORDER_MAINTAIN, neither BAPI_PRODORD_CHANGE have those fields (AFPO-UNTTO and AFPO-UEBTO).
    Could anybody help me?
    Thanks in advance.
    Maite.

    Hi,
    if you are using this BAPI, you must ensure the following,
        o   All the necessary master data has been created correctly (for
            example, material master, BOM, routing or recipe, work centers or
            resources).
        o   All the necessary Customizing settings have been made to the orders.
    For more information refer the BAPI Document in SE37. it is helpful to find out the which are the parameters are obligatory.
    Refer the below link.
    [Re: Can not display the Long Text in PO creation|Re: Can not display the Long Text in PO creation]
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • Function Module /BAPI for changing the components in Production order

    Hi,
    We are in ECC5.0. We have requirement wherein we want to change /delete the existing component of the production order and add new component through RFC call from an external system. We tried to use CO_XT_COMPONENT_ADD FM for adding new components and when we tested this FM in SM37  with data there were no error messages . When we checked the Production order ,no changes were made to the production order component. Tried to use Commit statement and there is no change in the system behavior.Can some one help me to  understand the system behavior . If possible kindly suggest me some alternate FM/BAPI .
    With regards,
    Joseph Anand B

    Dear,
    Please check this link,
    ADD COMPONENTS TO PRODUCTION ORDER
    Regards,
    R.Brahmankar

  • Committed Date For Components in Production Order

    Dear All,
    I m facing this,  Committed Date For Components in Production Order,
    the date appeared as 31.12.9999,
    How can i make this correct.
    please tell me..
    Thanks
    Raghu

    Hi, Thnkx,
    You Are correct, I got this while doing Availability Check, 2 dates.
    Requirement Date, and Committed Date.
    I tried your solution,
    I change the Quantity of one of my BOM , I tried to change the Quantity by Change Number,
    So in CS 03 I can see the Validity of that component up to 01-09-2010,
    I run MRP agian, new planned Order, tried to convert, the question is same.
    I still get the date as 31-12-9999.
    Thanks
    Regards
    Raghu

  • Class for Purchase order item components and Production order components

    I'm looking for a some classes.   I'm very new to objects, so I could be searching for them incorrectly.
    The first class I'm looking for is a purchase order class that contains the item components.  I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM.  I couldn't find components as a part of either of the classes.
    The second one I'm looking for is not as critical.  It is for the components for a production order.   I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order.  However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
    Any help that you could give would be greatly appreciated.
    Thank you!
    Michelle

    Hello Michelle
    I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
    *& Report  ZUS_SDN_OO_READ_PO
    *& Thread: Class for Purchase order item components and Production order components
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
    "& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
    REPORT  zus_sdn_oo_read_po.
    TYPE-POOLS: abap, mmpur.
    PARAMETER:
      p_ebeln   TYPE ebeln  DEFAULT '3000000045'.
    DATA: gs_document    TYPE mepo_document,
          go_po          TYPE REF TO cl_po_header_handle_mm,
          gs_header      TYPE mepoheader,
          gd_tcode       TYPE sy-tcode,
          gd_result      TYPE mmpur_bool.
    data: gt_items       type PURCHASE_ORDER_ITEMS,
          gs_itm         type PURCHASE_ORDER_ITEM,
          gs_item        type mepoitem.
    START-OF-SELECTION.
    *  prepare creation of PO instance
      gs_document-doc_type    = 'F'.
      gs_document-process     = mmpur_po_process.
      gs_document-trtyp       = 'A'.  " anz.  => display
      gs_document-doc_key(10) = p_ebeln.
    *  object creation and initialization
    **  l_ebeln = purchaseorder.
      CREATE OBJECT go_po.
      CALL METHOD go_po->po_initialize( im_document = gs_document ).
      CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
      CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
    *  read purchase order from database
      gd_tcode = 'ME23N'.
      CALL METHOD go_po->po_read
        EXPORTING
          im_tcode     = gd_tcode
          im_trtyp     = gs_document-trtyp
          im_aktyp     = gs_document-trtyp
          im_po_number = p_ebeln
          im_document  = gs_document
        IMPORTING
          ex_result    = gd_result.
    *  there was a problem in reading the PO
      IF ( gd_result EQ mmpur_no ).
    **    l_messages = l_handler->get_list_for_bapi( ).
    **    PERFORM return TABLES l_messages return
    **                          poitem poschedule poaccount.
    **    CALL METHOD l_po->po_close( ).
      ELSE.
        gs_header = go_po->if_purchase_order_mm~get_data( ).
        WRITE: / gs_header-ebeln,
                 gs_header-bukrs,
                 gs_header-bsart,
                 gs_header-lifnr.
      ENDIF.
      gt_items = go_po->if_purchase_order_mm~get_items( ).
      LOOP AT gt_items INTO gs_itm.
        gs_item = gs_itm-item->get_data( ).
        write: / gs_item-ebelp,
                 gs_item-matnr,
                 gs_item-menge.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • Reservation  of components against production order

    Dear all
    how to delete the  reservation  of components against production order
    guide me

    Hi
    When you execute TECO for a production order, all the reservation will be cleared.
    are no other screen using the order or material.
    Next option is to delete the reservation directly via MB22. sometimes this option is not possible, normally when Reservations are created automatically by the system, in this case only deleting the source of the reservation.
    Final option is to clean only the reservation for a given material, just go to the ordern in change mode, and then to the material details, and set the flag "on" for the field "Final Issue".
    Hope this helps.
    Thanks
    Saravana
    Reward if useful

  • Unable to Return Components of Production Order

    Hi,
    Created Production Order (PdO) with 9-10 components, the 8th component being Item HEX with planned quantity of 5 and actual issue of 200 at row number 8 of PdO. In meantime, someone had deleted some row of PdO. The user then tries to click "Report Completion" and "Return Components" and selects Item HEX. The row number for Item HEX is now strangely Row 9 and the user is unable to return the quantity of 200 for Item HEX.
    The "available batches" table of the Item HEX just does not show the quantity of 200 and the user is unavailable to "return components".
    Could someone help me what the problem could be?
    Thanks,
    Ajay Audich

    Hi Gordon,
    The item row deleted was some other item and not Item HEX. The Item HEX which now shows as row 9 DOES show the issued quantity as ~200 but the batches for this quantity are not visible and cannot be selected in the batch selection screen.
    Could the deletion of some OTHER item in the production order create this problem?
    Hi Sridharan- I do not understand your reply "wrongly posting"-could you please explain...this error is happening in the production order of SAP Business One.
    Thanks,
    Ajay Audich

  • Components of Production Order

    Hi experts,
    Does anyone know the table / function module where the components of a production order are stored?
    I am talking about when you go to CO03 transaction / Overviews / Components (F6). Here you get the components of the production order. I need to obtain these exact components in a program... Does anyone know if there's a specific dictionary table where these are stored? Or if there is a FM I could use to obtain these exact components?
    I tried with CSAP_MAT_BOM_READ, CS_BOM_EXPL_MAT_V2, but these don't retrieve the same records I'm getting in the transaction.
    As for CUKO_COMPONENTS_OF_ORDER_BOM, this is not retrieving anything.
    I also tried debugging the transaction, and saw that there's a FM being used called: CO_IT_OBJ_ITAB_CREATE. However when I try to use it in a program I don't get any information...
    Thanks in advance! Points shall be rewarded for good solutions...

    Here are the tables for the production orders with details.
    AUFK          Production order headers
    AFIH          Maintenance order header
    AUFM          Goods movement for prod. order
    AFKO          Order header data PP orders
    AFPO          Order item
    RESB          Order componenten     
    For BOM check STPO amd PLMZ.
    Regards
    TAJUDDIN

  • Storage location and Batch updation for components in Production Order.

    Hi Friends,
    After creating Production Order,need to update components with Storage Location(RESBD-LGORT) and Batch(RESBD-CHARG).
    Plese any one can help me by providing FM/BAPI for the same(Update Component level)
    Points will be rewarded.
    Thanks,
    Prb.

    Hi Prathap,
    Path - OCHA
    Condition type,access sequence, strategy type,
    Work on automatic batch determination. Assign standard search procedure to order type dependent parameter, check against manual entry.
    Make sort sequence for material by CU 70, tick ascending order, Then assign component in COB1, enter selection values and sort sequence. In finish product material master set automatic batch determination.
    System will copy the required material with batch & storage location, also check against manual entry.
    I think it will solve your problem.
    Regards,
    Suhas

  • Batch determination for components in Production order

    Dear All,
    I have components which are batch determined. and backflush active.
    There is no search procedure active, everything else is std.
    While doing confirmation in Co11n. i could not get all the Batches copied in Goods movement Tab. Though i have enough batches and stock available. with proper shelf life dates.
    What can be the issue??
    Please help.
    Regards
    Raghu

    Dear ,
    1.Please check in MRP 2 view Batch entry= 3 is maintained
    2.Check Classification view with characteristic that use in CU70
    3. Check whether you have assign Batch Search Procedure to this new order type in OPL8 i
    4.Check whether Batch Search Strategy is maintain or not for this new order type and Plant using COB1.If not then complete this assign it.
    5.Its not necessary that you shud always use GR date for batch determination.you can create any characteristic using CT04. and assign your own values.
    1.Assign that characterisitc to class,
    2.Maintain that class in material master, strategy type.
    3.Assign the strategy type to Search procedure, then assign that search procedure to required mvt type.
    4.Maintain the selection criteria for the strategy type in MBC1.
    While doing GI system will ask for the characterstic value for the batch.You maintain required value, same as maintained in MBC1.So, when you do that mvt type put * in the batch. system will propose yoou the batches
    Visit my earlier posting  :Automatic Batch Determination during Goods issue of Production Order
    Check and revert
    Regards
    JH
    Edited by: Jiaul Haque on Oct 11, 2010 11:27 AM

  • Userexit required to update operation of components in production orders

    Hello,
    Is there a userexit or badi that exists to change operations of components in a production order?
    As soon as a production order is created or modified, we need to have the system automatically adjust the operation of each component according to the value of a specific field in the material master. In certain cases, the operation must be 0010. In other cases, the operation must be 0030. Our PP master data is setup to have all materials assigned to a dummy workcenter (operation 0010).
    Enhancement PPCO0023 doesn't work because the user exit only gets executed if the user manually goes into the components screen and makes a change to a component.
    Thanks for your help,
    Marie-Eve

    Hi MARIE,
    There is no user exit as such.
    Regards,
    Satyajit

  • User-exit  for components in Production Order

    Hello
    I have to change automatically materials parameters in production order components  (  e.g    resb u2013 fmeng  I need to mark  or stand out the indicator ) before saving.
    Does anyone know a BADI or user-exit that i can use?
    Regards,
    Artur

    Hi Artur
    You can try BADI WORKORDER_UPDATE
    or
    user exit PPCO0001 and PPCO0008
    Hope it helps you .
    Regards
    Ritesh

  • Function Module for adding components to Production Order

    Is there a function module that can add components to an existing production order ?I believe CO_BC_INSERT_CMP_OF_ORDERS can do the trick but seems this alone would not suffice .Your feedback is very much appreciated

    Sudhir,
    U r right. we need to call the function module CO_BC_INSERT_CMP_OF_ORDERS with flg_banf_create  = X and apt entries in the component details table resbb_ins. Doing this is enough. I guess u have a problem passing correct data in the internal table. For the data you do not know, you will have to pass default data.
    Hope this helps.

  • I need help in Report for production orders for my customer.

    Hi All
    I have scenario where plant A needs the following report for Material XXX which has setting as Stock Trnasfer order from Plant B.
    Need report withthe following details, Storage Unit number, Material No, Quantity, Planned Order Date in plant A,  Date Produced in plant B, Date Received by Plant A. 
    Please tell me if there is any standard report to take the following details. Scenario is that the header material YYY in Plant A has one material XXX as BOM component. Now this material has setting as Stock transfer from Plant B. On creating a plan order for Header material it will create a Plan order in plant B for component XXX. The above said detail is required for component XXX in plant A.

    Dear
    Did you explore the report in CO46-Order Progress Report based on Sales Order /Material /Production Order
    Or COOIS/COHV  for your requirement.Here you can get the Planned Order Details and also Production Order Details .
    Regards
    JH
    Edited by: Jiaul Haque on Sep 27, 2010 2:57 PM

  • Prevent creation of reservation for selected components on Production order

    Hello all,
    I am aware that the production order reservation creation is dependant on the order type, but is it possible to avoid the reservation creation for few components on the order ? Any techincal way? We want to issue our components to a different batch than the one reserved during the production order creation.
    Any help will be greatly apprciated.
    Thanks,
    Swetha

    Your material is get reserved for Production order as per the Order start date & Order release. What you can do is make the start date of the Production order & release it. If any other production order are already there & you can re set the ATP of that production order.
    Say there is one production order starting 2 days after & your all raw material is blocked for this production order. And the other production is having date after this now you want to give ATP from 1st order to 2nd order. For this 1st make the start date of 2nd prod order before 1st. Then Go to COMAC select both Prod Ord & GO ATP with check reset ATP. You see that ATP is passed from 1st Prd order tp 2nd.
    Regards
    Abhijit Gautam

Maybe you are looking for