Creating Production Order Through DI API Throws Error

Hi Experts,
I am trying to create Production orders automatically (using DI API)for Items from a Sales Order Thorough an Intermediate transaction.
But it throws an error on the line in which I am setting value to the Business partner code of the Production order object.
The error message shown first is  'Exception from HRESULT: 0xFFFFFFFF'
and then                         'Object reference is not set to an instance of an object'
The Code is Given below
objPrdOrdr = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oProductionOrders)
            objProdTree = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oProductTrees)
            With objForm.DataSources.DBDataSources.Item("HeadTab")
                intRowCount = .Size
                For intLoopCount = 0 To intRowCount - 1
                    If objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_POYN", intLoopCount) = "Y" Then
                   *objPrdOrdr.CustomerCode = objForm.DataSources.DBDataSources.Item("HeadTab").GetValue("U_BPCod", 0).ToString*
                        objPrdOrdr.DueDate = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_DueDate", 0)
                        objPrdOrdr.ItemNo = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_Product", intLoopCount)
                        objPrdOrdr.PlannedQuantity = objForm.DataSources.DBDataSources.Item("LineTab").GetValue("U_QTY", intLoopCount)
                        objPrdOrdr.PostingDate = .GetValue("U_DocDat", 0)
                        objPrdOrdr.ProductionOrderOrigin = BoProductionOrderOriginEnum.bopooSalesOrder
                        objPrdOrdr.ProductionOrderOriginEntry = .GetValue("U_SlOrd", 0)
                        objPrdOrdr.ProductionOrderStatus = BoProductionOrderStatusEnum.boposPlanned
                        objPrdOrdr.ProductionOrderType = BoProductionOrderTypeEnum.bopotSpecial
                        intPrdEnt = objPrdOrdr.Add()
                        If intPrdEnt > 0 Then
                            objPrdOrdr.GetByKey(intPrdEnt)
                            objForm.DataSources.DBDataSources.Item("LineTab").SetValue("U_PrdEnt", intLoopCount, intPrdEnt)
                            objForm.DataSources.DBDataSources.Item("LineTab").SetValue("U_PrdOrd", intLoopCount, objPrdOrdr.DocumentNumber)
                        Else
                            B1Connections.theAppl.SetStatusBarMessage("Production Order Creation Failed", SAPbouiCOM.BoMessageTime.bmt_Short, True)
                            oForm.ActiveItem = "txtBPCod"
                            Return False
                        End If
                        intLoopCount += 1
                    End If
                Next
            End With
Please Help... We are using SAP b1 2007B SP00 PL13
Thanks and Regards
Ajith G
Edited by: Ajith G on Mar 12, 2010 10:57 AM - Sorry, Tried to format text properly but failed

Rectified

Similar Messages

  • Problem In Creating Sales Order Through DI API

    Hi
    I am Creating The Sales Order Through DI API.
    the Error Is Coming - " [OACT] , 'No matching records found (ODBC -2028)'"
    anyone  can help me solving it.

    Hi vivek,
    Have you tried adding the same document with the client ?
    OACT is the accounts table and this error message typically indicates that there is an account parameter missing somewhere in the system.
    Possible causes include:
    - you are using a tax group or warehouse which does not have all the required accounts set
    - There is a price rounding and the rounding price account has not been set in the account settings
    - etc.
    The first things I would check include the tax group settings and the G/L Account determination settings.
    Henry

  • Create Sales Order through OE_ORDER_PUB  API and get credit card authorizat

    Hi,
    I was trying to know if there is some way to get credit card authorization (when payment type is CREDIT CARD) creating a Sales Order through de OE_ORDER_PUB API.
    I need to reproduce the manual process where you get this authorization, through the Action Button, in the Sales Order Window.
    Thanks in Advance.
    Nicolas.

    Hi Nagamohan,
    Thanks for the reply..It was Vision Instance that i was working on..
    There was some problem in setups. I had run the same script on other instance and it is working.
    Before signing off i have one more doubt...
    The script which i used is creating a sales order with booked_flag='Y' but flow_status_code is still 'ENTERED'
    how can i change it to 'BOOKED' using API...
    Thanks for the help...

  • Error when creating Production Order

    Dear All,
    When i was trying to create Production Order using CO01, there was an error message that says "error when calculating cost, see log, log is deleted when saving"
    what is the problem from that error message? how can i solve this problem?
    best regard,
    MARUFAT

    Cost consist of material cost which are the direct cost, it is calculated from the component and the material itself for which the order is created. If the material is semifinished or finished check whether the accounting view for these material contains value. These material could be costed as per the method mentioned by our friend or you may enter value through MR21 (if the material is not costed atall since it is created). It is recommended to update cost through costing run and by CO member. Now if the material is Raw material you need to maintain PIR.
    The second part could be the activity cost. These follows from the routing/receipe. Mostly the costing error is due to the inappropriate defination of either cost center or activity types. You need to confirm whether activity price are define for the period.
    Appriciating you for taking a concern on the costing error and not overriding.

  • Error creating Production Orders in UNCONSTR version

    I am copying prodcution orders from version 000 to unconstr version through Report I am getting following error.
    Error creating Production Orders in UNCONSTR version and Message no. ZSXXPAPO140.
    when I am executed in background it is giving following error.
    PPM FG100203.01_19_FR04_P for product FG100203.01 is not valid at the required explosion date 14.01.2010  /SAPAPO/RRP      325          E
    Please suggest me any one it is a great help to me.

    Hi Venkat,
    It seems there is an inconsistent PPM FG100203.01 exists
    in your planning version from which you are copying.
    Check the possibilities of repairing that PPM and retry
    copying.  Orelse In the /SAPAPO/VERCOP transaction,
    under the product selection criteria, exclude that item and
    try copying the version.
    Regards
    R. Senthil Mareeswaran.

  • Update error while creating production order (TCODE CO01)

    Hello,
    We have created new plant into development server for testing. We have created production Order few days back at that time we have not faced any problem. But from last two days , when we create new production Order , system gives following error:
    ORA-00947: not enough values
    DBIF_RSQL_SQL_ERROR" "CX_SY_OPEN_SQL_DB
    SAPLCOVB" or "LCOVBF10"
    HEADER_POST"
    and
    Update was terminated
    System ID....   DEV
    Client.......   500
    User.....   HPLSU
    Transaction..   CO01
    Update key...   4B6E4F48C08D027FE1008000C0A802F3
    Generated....   08.02.2010, 10:35:48
    Completed....   08.02.2010, 10:35:49
    Error Info...   00 671: ABAP/4 processor: DBIF_RSQL_SQL_ERROR
    Our work is held up.
    Please also note that If we increase the QTY in the existing Order ( already created few days back) , System accept the same and Order is saved.
    We are looking for the solution for the above.
    Early reply will be highly appreciated.
    thanks
    harish

    Hi Rishi,
    You better check with your BASIS team.
    Check this link also
    Supervisor Error ADM0015
    Regards,
    Satyajit Kumar
    Edited by: Satyajit Kumar on Feb 8, 2010 7:47 AM

  • Error while creating Production order without BOM

    Hi Guys,
    While creating production order without a BOM i am getting the following error in the error log.
    Error: BOM for material xxxxxx does not contain any valid items
    Message no. CO636
    Kindly help.
    Regards,
    Sid

    Dear customer,
    could you check in the master data screen of the order if one BOM has been selected?
    please coudl you check your customizing the following transactions:
    OPJM
    OPJI
    what do you have in 'BOM slection field' MRP4 view of the header material?
    Please check if with this info you can find the missing data to explode the BOM
    regards
    Maria

  • Error in creating Production order

    When I create production order thorugh planned order Iam getting error message "No objects selected inside production order."

    Hello,
    The planned order that you may have use has been deleted already.  It is most probably deleted during an MPS/MRP run.  The planned order number is deleted and recreated with a different number.  Please try to check in MD04 and check the planned orders there and you can convert it from there.
    Thanks,
    Ernesto

  • Allocation error when I create production order

    Hi guys:
       I met allocation error when I created production order with CO01.could you help me out?urgent!

    hi
    What is the excatly the error so that we can tell u the reason
    regards
    ramakant

  • T-code CO01 to create Production order:error message "No routing found"?

    I use t-code CO01 to create Production order.At the first screen I select material 72 and plant HJW1 .At the Header creen,I input the data in the General tab and press return but the sap show the error message "No routing found".But I have create the routing for the material 72 and plant HJW1.I don't know why the sap found no routing.So my question was how to found the reason about why the sap can not found the routing and how to resolve this problem.Thank you.

    Hi,
    Probably you would have created the routing today, with valid from todays date. But the order you are creating may be with start date in past and system is not able to find and valid routing for the day.
    I would suggest you to remove both the Basic "Start" and "End" and change the scheduling type to "Current date Scheduling", now enter. If system still not finding the routing, use the function "Read PP Master data".
    Regards,
    Prasobh

  • Error when creating Production Orders: -5002 Invalid Code  [OWOR.Status]

    When creating Production Orders, I receive the error: -5002 Invalid Code  [OWOR.Status] on certain of the entries. Typically 200 orders are created at once.
    What could be causing the error?

    You may check this thread to have a reference:
    Setting the repByIns to Null
    Thanks,
    Gordon

  • Creating production order it gives error

    Dear Sir,
    I am using PP01 order type for production order we have two plant and i hAve maintained NUMBER RANGE in CO82 and also  in OPJH. but when i create production order in CO01order type PP01 for one plant 1000 it gives ERROR - number range not defined same i am creating for another plant 1020 it create order production order.
    Please guide me where i mainatined number range of production order for indiviual  plant

    Check your order type has been assigned to plant and also validate the number ranges as well.
    Mahee

  • Can i create production order using process material ?

    Dear All.
    Please help me.
    I want to create production order using process material (material type is PROC).
    For may knowledge, process order is standard for the process material, but my customer want to use the PP module for the process material.
    But I cant convert the planned order of precess material to production order in MD05.
    The system message is "System does not support planned orders for process materials."
    The followings are my test steps.
      1. Master Creation
          - Material Master, BOM, ROUTING
    In standard, process material (Material Type : PROC) need creation of master recipe. But due to my clients need (Using production order
               for the process material), I create the work center and ROUTING
      2. DM Creation
          - In MD61, I create the planned independent requirement (Type : LSF)
      3. Planned order creation for the process material using MRP
          - In MD01, I run the total MRP, the the planned order is created.
            It's order type is "LA"
      4. Converting the planned order to Production Order
          - In this step, the system give the error "System does not support planned orders for process materials."
             and can not do anything.
    I want to know that the above case is possible, and how.
    Please Help meu2026..

    Hi
    First of if yur want to create production order or process order why do you go for material type :PROC.
    you can create the same material as FERT & go ahead.
    I do not understand the logic to select the material type as PROC.
    Pl. go through SAP library where PROC is used.
    Regards
    YMREDDY

  • Procurement Key 'F' - System will allow to create production order

    Dear All,
    Pls help solve below issue
    Sub-assembly (HALB) material type with Procurement Key is 'F' - but System will allow to create production order, our management don't want to allow this. how to activate the error messges
    I checked the system messages CO 046, 047, 048 - it will not help for these messages
    Any way to control this (except user exit, badi)
    Regards,
    Sankaran

    Hi Sankaran,
       What I infer from your statement is that user is able to convert planned order into Production Order (MD04 or CO040). You want to issue a warning message during this converion.
      You can configure warning messages through OPJB.
       Whether this material with procurement type F was setup initially with a different setup? Please check whether any routing details exist for this material and also check whether there is any special procurement indicator. One more check is with your MRP Group settings.
    Hope this helps.
    With Best Regards,
    Srinivas

  • Prt availability.while creating production order

    while creating production order. system checking PRT availabilty
    if PRT is not there system throws warning msg
    PRT: Item: 0010  Material TESTPRT1 plant BP01 is not available.
    Message no. CF301
    Diagnosis
    You are attempting to use a PRT. However, the current status of this PRT does not permit you to use it.
    how can change into error msg.........
    thx in advance

    Hello,
    I've checked the WUL of the message CF301 and found:
    CALL FUNCTION 'CO_FU_FHM_AVAILABILITY_CHECK'
           EXPORTING
                index_imp             = affhd_sav-indbt
                tco11_imp             = tco11_tmp
           IMPORTING
                fhm_not_available_exp = fhm_not_available_tmp.
    FHM verfügbar
      IF NOT fhm_not_available_tmp IS INITIAL.
        CASE affhd_sav-fhmar.
          WHEN material.
            MESSAGE i301 WITH affhd_sav-psnfh
                              affhd_sav-matnr
                              affhd_sav-fhwrk.
          WHEN sonstige.
            MESSAGE i302 WITH affhd_sav-psnfh
                              affhd_sav-sfhnr.
          WHEN dokument.
            MESSAGE i303 WITH affhd_sav-psnfh
                              affhd_sav-fhmnr.
          WHEN equipment.
            MESSAGE i307 WITH affhd_sav-psnfh
                              affhd_sav-fhmnr.
          WHEN OTHERS.
            MESSAGE a886
                    WITH sy-repid
                         hlp-fname.
        ENDCASE.
    I'm afraid the attribute is hardcoded to be warning.
    BR,
    Tiemin

Maybe you are looking for