A/P Invoice created from Approved Drafts, through DIAPI

Please I need help with this error.
I need create A/P Invoice  from approved drafts with DIAPI.
There are no errors if the "A/P Invoice" is copy of "Purchase Order" or without base document. In this case the Invoice is created without problems.
But, if the invoice is copy of "Goods Receipt PO", it is not created and DIAPI retrieve an error:
"Field cannot be updated (ODBC -1029)"
is a bug in  sdk?
Thanks a lot.
Please help.

Hello Norman,
This sounds really like a bug which you should report to SAP Support... - sorry!
...but let me (and others) give you some advice how to be more sure in such conclusions:
In such cases you should check:
a) Does it work in the B1 GUI application?
If yes, it's a bug (or limitation?) which you should raise to SAP Support.
...and of course it works...
b) If you are not sure about a) - or if there are problems too, but you still think it should work... you should check the DB documentation.
In your case the information is more-or-less obvious (could surely be easier to find...) available as the "Constraints" for the field PCH1.BaseType...
The DB documentation says that Purchase Orders + Goods Receipts POs (GRPO) as base types - and thus your problem is certainly a bug (but Support will do the final judgement).
But you should make sure that the GRPO is OK - i.e. the lines you need are not closed etc., but I assume you checked all that a couple of times already.
Regards,
Frank

Similar Messages

  • AME Invoice workflow - When invoice moves from Approval Require to Not Req

    Hello,
    I have a small Issue with AP Prepayment invoice Workflow.Version: 12.1.1
    Issue Des:AME has been configured specifically for Prepayment invoices. however, when Initiate Workflow is clicked, the Approval status changes from Required to Not Required (instead of Initiated).
    AME Setup:
    1.IF supplier amount > O get approval from approval-grp.
    Steps:
    1.Create a invoice with amount 1000 and distributions with 1000 amount.
    2.Validate Invoice
    3.Intiate Approval using actions "Intaiate Approval" the Approval status changes from Required to Not Required (instead of Initiated).
    4.Invoice shows status 'Not Required'
    5. first time the customer was using AME Rule for Prepayment invoice type with approver type as HR People and In the employee form, the supervisor relationship was not defined.
    Any idea on why this is not working will be of great help!
    Regards,
    Venkat

    HI Venkat,
    Check the AME rules, Is the Priority filed have any values set or not.
    The Priority must be set to 1 and try again.
    Regards,
    Sunil

  • Payment of Expense Report invoice created from credit card transactions

    We are implementing corporate credit cards into iExpenses using the company pay method. When expense reports are created from aquitting credit card transactions and exported into Payables does anyone know if it is possible to pay the expense report invoice that has been created without needing to run the Create Credit Card Issuer Invoice program? The reason for this question is that I want to avoid running this program as our credit card provider direct debits our account from our bank account rather than us transmitting the funds to them and don't need to create an invoice for the credit card provider. Any assistance would be gretly appreciated. Thanks

    Hi  Harry
    You can use the badi TRIP_POST_FI   .you can create custom table & mention the different symbolic account number  & change your  symbolic account based on your expense type by using the above badi. While you do FI posting  your expense types will get posted in two hit two different G/L account
    It will surely solve your problem.. I had same issue in my earlier project which i have done the above solution.
    Thanks
    Anwar Hossain

  • Invoice create from DeliveryNote

    Good Day
    Experts:
    I have SalesOrders that were "Copied To" a DeliveryOrder using the Copy To button on the lower right portion of
    the SalesOrder screen. I then use the DeliveryNote object via the DocEntry value to get information to build an
    Invoice.  My code works fine.  However, I am a bit concerned that I am sending "enough" information for all the "behind the scenes" things that go on with the Invoice.  This after I found the amount of fields available on oDeliveryNote.  How can I know if I am sending all the information that is needed?  Here is my code:
                    oDeliveryNote.GetByKey(sDocEntry)
                    'Set DeliveryOrder header info to Invoice object
                    oInvoice.CardCode = oDeliveryNote.CardCode
                    oInvoice.CardName = oDeliveryNote.CardName
                    oInvoice.Address = oDeliveryNote.Address
                    oInvoice.DocDate = oDeliveryNote.DocDate
                    oInvoice.DocDueDate = oDeliveryNote.DocDate
                    For i = 0 To oDeliveryNote.Lines.Count - 1
                        oDeliveryNote.Lines.SetCurrentLine(i)
                        If i > 0 Then
                            oInvoice.Lines.Add()
                        End If
                        'Set DeliveryOrder line info to Invoice object
                        oInvoice.Lines.BaseEntry = oDeliveryNote.DocEntry
                        oInvoice.Lines.BaseLine = oDeliveryNote.Lines.LineNum
                        oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                        oInvoice.Lines.ItemCode = oDeliveryNote.Lines.ItemCode
                        oInvoice.Lines.Quantity = oDeliveryNote.Lines.Quantity
                        oInvoice.Lines.Price = oDeliveryNote.Lines.Price
                    Next
                    retVal = oInvoice.Add()
              Next
    Thanks for helping,
    Ed

    Hi Ed,
    actually you set the important things in your code.
    you might also set the Project, Discount and Freight in the Invoice.
    the important "scene" that happens is that the invoice create journal entries.
    lg David

  • Getting negative value of discount on adding ar draft through DIAPI 's

    Hi
    I am facing a scenario where in if I am creating the AR -draft for 1 day order through DIAPI's ADD method ,The sales invoice draft that gets created shows discount =some decimal value that on rounding off is equivalent to 10 in case 10% discount is given on order at line level.
    and in case i have made draft for an order having period more than 1 day then the discount values gets negative.
    For each line I am assigning the discount value in following ways:
    oDraft.Lines.DiscountPercent = 10
    then the draft that gets created shows me
    discount%= 9.125  in case I have 1 day period
    and
    discount%= -400 in case I have period of more tahn 1 day.
    I am not understanding why is it so .I mean on what values the discount on AR - invoice draft  calulation actually depends.
    why is it showing me decimal amount when i am assiging a roundoff value of 10 .
    and why is it making discount negative.
    Please help me out as early as possible.

    Hi ,
          Can u post the coding.

  • Incoming Invoice Create from data without posting the GR details

    Hi Experts,
    I am trying to create a MM invoice (MIRO) using the BAPI BAPI_INCOMINGINVOICE_CREATE and I do not want to post GR details in this invoice. But I have not been able to see the face of success yet.
    Following are the parameters that I pass to the structures of this BAPI:
    BAPI_INCINV_CREATE_ADDRESSDATA Addressdata = new BAPI_INCINV_CREATE_ADDRESSDATA();
    BAPI_INCINV_CREATE_HEADER Headerdata=new BAPI_INCINV_CREATE_HEADER();
    BAPI_INCINV_CREATE_ACCOUNTTable Accountingdata = new BAPI_INCINV_CREATE_ACCOUNTTable();
    BAPI_INCINV_CREATE_ACCOUNT Account = new BAPI_INCINV_CREATE_ACCOUNT();
    BAPI_INCINV_CREATE_ITEMTable Itemdata = new BAPI_INCINV_CREATE_ITEMTable();
    BAPI_INCINV_CREATE_ITEM Item = new BAPI_INCINV_CREATE_ITEM();
    BAPI_INCINV_CREATE_GL_ACCOUNTTable Glaccountdata=new BAPI_INCINV_CREATE_GL_ACCOUNTTable();
    BAPI_INCINV_CREATE_GL_ACCOUNT Glaccount = new BAPI_INCINV_CREATE_GL_ACCOUNT();
    BAPI_INCINV_CREATE_MATERIALTable Materialdata = new BAPI_INCINV_CREATE_MATERIALTable();
    BAPIRET2Table Return=new BAPIRET2Table();
    BAPI_INCINV_CREATE_TAXTable Taxdata = new BAPI_INCINV_CREATE_TAXTable();
    BAPI_INCINV_CREATE_VENDORSPLITTable Vendoritemsplitdata = new BAPI_INCINV_CREATE_VENDORSPLITTable();
    BAPI_INCINV_CREATE_WITHTAXTable Withtaxdata = new BAPI_INCINV_CREATE_WITHTAXTable();
    string Fiscalyear="", Invoicedocnumber="";
    Headerdata.Invoice_Ind = "X";
    Headerdata.Bus_Area = "ED";
    Headerdata.Comp_Code = "GAMB";
    Headerdata.Doc_Date = "20110505";
    Headerdata.Bline_Date = "20110505";
    Headerdata.Doc_Type = "RE";
    Headerdata.Diff_Inv = "0001736123";
    Headerdata.Currency = "USD";
    Headerdata.Exch_Rate = 7.33M;
    Headerdata.Po_Ref_No = "4510146624";
    Headerdata.Gross_Amount = 87500.00M;
    Headerdata.Header_Txt = "";
    Headerdata.Inv_Rec_Date = "20110505";
    Headerdata.Pmnttrms = "G001";
    Headerdata.Pmnt_Block = "A";
    Headerdata.Ref_Doc_No = "Inv01";
    Headerdata.Pstng_Date = "20110505";
    Headerdata.Calc_Tax_Ind = "X";
    Headerdata.Person_Ext = "extsuro";
    BAPI_INCINV_CREATE_MATERIAL Material = new BAPI_INCINV_CREATE_MATERIAL();
    Material.Invoice_Doc_Item = "0001";
    Material.Material = "W900000664";
    Material.Val_Area = "PL01"; // plant
    Material.Db_Cr_Ind = "S";
    Material.Item_Amount = 70000.00M;
    Material.Quantity = 200.00M;
    Material.Base_Uom = "EA";
    Material.Tax_Code = "I1";
    Materialdata.Add(Material);
    Item = new BAPI_INCINV_CREATE_ITEM();
    Item.Invoice_Doc_Item = "0001";
    Item.Po_Number = "4510146624";
    Item.Po_Item = "00010";
    Item.De_Cre_Ind = "X";
    Item.Freight_Ven = "0000010149";
    Item.Tax_Code = "I1";
    Item.Item_Amount = 70000.00M;
    Item.Quantity = 200.00M;
    Item.Po_Unit = "EA";
    Item.Po_Unit_Iso = "EA";
    Itemdata.Add(Item);
    proxyPOInvoice.Bapi_Incominginvoice_Create(Addressdata, Headerdata, out Fiscalyear, out Invoicedocnumber,
        ref Accountingdata, ref Glaccountdata, ref Itemdata, ref Materialdata, ref Return, ref Taxdata, ref Vendoritemsplitdata, ref Withtaxdata);
    This is resulting in the below error message:
    u2022     Enter goods receipt data only when working with GR-based IV
    For the first error messages, after some good amount of googling and also searching in this forum I could reach to this conclusion that, if PO is marked with GR-based IV flag then invoice cannot be booked without GR. Also while booking such as invoice for every GR Item we need to pass:
    Ref_Doc = goods recript number,
    Ref_Doc_Year = year for good receipt number
    and Ref_Doc_It = item number in the goods receipt.
    I have created a PO which is not GR-based IV flagged, i.e. GR is not mandatory for creating invoice. Still I get the same message every time. I went through the documentation of the BAPI and also through many sites that gave sample codes to create an MM invoice but without any success.
    The same entry when I enter through SAP screens I am able to post the invoice without GR.  Please help me identify where I am going wrong.
    Thanks in Advance
    Best Regards
    Roy

    I found out the cause to this whole thing. It seems that even though if you don't need to pass a parameter you need to fill it with default value. e.g.
    my invoice was not GR-based IV invoice. Therefore, I don't actually need to pass values for:
    REF_DOC
    REF_DOC_IT &
    REF_DOC_YEAR.
    Well i was wrong here. Even then I need to pass these values as:
    REF_DOC = ""
    REF_DOC_IT = "0000"
    REF_DOC_YEAR = "0000"
    I guess this is how SAP .Net Connector works.
    Thanks to all anyway
    Roy

  • Changing an Invoice Created From MIRO

    What transaction can I use to change an invoice which was created via transaction MIRO? Is it possible to do a change on the invoice? I can display the invoice using MIR4 but couldn't find the transaction for changing it.
    Thanks,
    Beth

    Hi Liz,
    to change an invoice depends on invoice-status:
    you can change it (MIR4-edit- display/change resp.
    with TA MIR6 )
    only if invoice is'nt booked (so only stati:
    parked,incorrect,held)
    regards Andreas

  • Create draft invoice document from a sales order

    When i create an invoice document from a draft invoice document from a sales order, this invoce is linked to the order sales.
    Sorry for my english, i hope you can understand

    It would be difficult to know what question do you have.  Try to ask question.  Your English is not bad at all.
    Thanks,
    Gordon

  • Create Invoice From a Draft

    Hi everybody,
                        I'm trying to create an invoice from an existing draft by code and i can't...i use this code to do this, but it create a new draft instead an invoice.
    oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
    oCompany.XMLAsString = False
    oDrafts = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
    oFacts = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
    oDrafts.GetByKey(20)
    oDrafts.SaveXML("C:\draft.xml")
    oFacts = oCompany.GetBusinessObjectFromXML("C:\draft.xml",0)
    oFacts.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
    oFacts.Add()

    Hi Mariano Bertini,
    Can you pls share the code as i'm facing the same problem for conversion of open draft a/r invoice to invoice

  • Creating user defined pay items in a complex PO which will be created from an Approved requisition

    Hi,
    We want to create user defined pay items in a complex PO which will be created from an Approved Requisition.
    User will select the approved Req. through WebADI and update the pay Items which will be uploaded and a complex PO will be created with user defined Pay Items.
    Approach 1:
    The API po_interface_s.create_documents is running good but there is one issue with this API as below.
    When we add user defined pay items to the po_lines_locations interface table against a line they are also getting added to the complex PO correctly.
    But the issue is coming when the API is creating default shipment lines and distribution which we dont want.
    Is there any way to stop creating the default pay items and distributions?
    We only want the shipments we have entered in the po_lines_locations interface.
    We can delete the lines from the PO_line_locations and po_distributions base tables for the default lines but that will be the last option to do delete on base tables.
    Approach 2:
    We can also do the same with the open PO import interface but it is not linking the complex PO to the approved requisition from which it is created.
    Oracle mentioned that this is a future enhancement and this functionality is not available in standard PO import prog.
    We are trying for Approach 1 so any suggestions/solutions are appreciated to achieve the requirement.
    Regards,
    Sanket

    UDT cannot be created in sbo-common. You may create new db and work with table in this db (but it will be not UDT, but standard sql table), or create new company db only for this purposes and create UDT there.

  • Workflow Item not created while processing draft PO from SOCO

    Dear SAP SRM Experts,
    In SRM 7.0, I've a scenario where I create a PO draft in sourcing.
    In the 3step of the GAF, I've the option to
    1. Edit the PO and order it.
    2. Directly process the PO draft to create a PO..
    While in case one the WF item is created with status awaiting approval, in the second case (when I directly process the draft) the workflow item is not created but the status is still 'Awaiting Approval' !!.
    Use of PC workflow is done and the PO is not auto approved.
    Any pointer regarding this would be very helpful.
    The call stack is way different between the first step and second.
    My understanding is if there is some error in the follow on PO, the work item would not be created. But the SC in soco is similar and while in first case it does create the workitem in second case it doesn't.
    When does the decision to create workflow item is decided in second case?
    Thanks.
    Shushant

    Hi Guys,
    Thanks for your inputs.
    The problem has been identified. The error is because  the vendors are deleted completly from the system. And those were  earlier used in shopping cart as preffered vendor. Thats why the system is throwing the error message. 
    As we can not process this SC further we want to delete this SC (line item).  But again while deleting the SC the system is throwing the error message . "Business partner xxxxxxxxxxxxxxxxxxxxxxxx not found."  Thus its not allowing us to delete the SC.
    Do you have any ideas how we can delete the SC line items, or  SC ?  Any FM ?
    Thank you,

  • Create APG ( approval granted) status in process order through user status

    Dear Gurus,
    My business requirement is to create APG ( approval granted) sytem status in process order through user status functionality, if possible.
    This needs to be activated while creating process order itself. Any help is greatly appreciated.
    Warm Regards,
    Satish

    As of this date, we have still not implemented a fix, but I did get some information from someone else who has.
    I'll post his information here for all to see.  Hope you find it helpful.
    From: Joe
    Yes we managed to do it.
    After several false starts and CMOD/projects which suffered because only the default keys (for order number, aufpl etc) were in place and not the actual, we coded up the IN_UPDATE method in the WORKORDER_UPDATE badi. This gives us the final format after the DB save (but before the commit). The update of the STATUS using the SAP std function module was actioned successfully but the status profile was not actually passed through. We assumed that this was because of the update task - so we introduced an INSERT into JSTO instead (a bit naughty I know, but desperate needs etc). If you require anything more let me know.
    Best Regards
    Joe

  • AR invoice issued from Service module with approval procedures

    When an AR invoice is issued from Service Call tab, due to the reason that we require approval, when the invoice is approved and added, the AR invoice is not captured in service call tab as a linkage. Is this the limitation in Business one? Any ideas about how to resolve this issue?

    hi,
    It may be due to application error,
    Check this  Note 1052012 - Docs that need approval cannot be created from service call
    [https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1052012]
    Jeyakanthan

  • How can you create a playlist with music and music video and play those from same playlist through Apple TV?

    How can you create a playlist on Ipod touch with music and music video,  and play those from same playlist through Apple TV?  I can download, create a playlist with both music and music video, stream that through the Apple TV with no problem.  The sound and the information show up on the TV, but when it gets to a music video, it only shows the information and "artwork".
    I also have a video playlist - videos play fine through the Apple TV, but will not shuffle through all videos - continues to repeat the same one.  I have most definitely selected shuffle in both locations - from the playlist and on the ipod video screen while video is playing.

    I finally got it... had to sync the photos with the music in iMovie, arrange the voiceover in GarageBand then export to iTunes, and then I was able to put it all together in iMovie and burn in iDVD... had a few glitches along the way but finally finished : )
    Message was edited by: jpewald

  • A JE created from the AP Invoice does not include the project # on all trx

    A JE created from the AP Invoice does not
    include the project # for the amounts entered in the freight box. To
    duplicate, do the following:
    1. Open an AP Invoice
    2. Enter BP Code
    3. Select Service type
    4. Enter a Project Code in drop down box on Accounting tab
    5. Enter a line in the Contents; specify GL Account, amount and Tax
    Code Open Freight box
    6. Enter an amount in one of the lines
    7. Click ADD
    8. Go back to the invoice and go to the Accounting tab Click on the GL
    journal note and you can see that the line corresponding to the
    contents line has a project, but the line corresponding to the Freight
    box item does not.
    My customer users these projects when printing GL agings and the
    information is very important. Shouldn't this information be carried
    forward on all transactions on the Journal entry? Is there a way to get this information to post?

    Hi Pat,
    the project code (PC) on the marketing document may only be applied to the business partner (BP), hence the only row in the associated journal entry (JE) with this project code is that of the BP.
    You can link project codes to specific accounts (CoA -> select account -> account details -> project code) & this project code will then be assigned every time the account is found in a JE.
    If you require the project code to be applied to the freight, you may assign this project code to the account you have defined for this freight. The drawback is naturally that the project code will then  be pulled every time this freight is used, regardless of whether or not the PC is associated with the BP or not.
    It is possible to manually assign project codes to every row in a journal entry, hence this should also be possible with SDK. You might explore the possibility whether it might be possible to automatically assign the BP PC to all rows in the JE using a script.
    All the best,
    Kerstin

Maybe you are looking for