Ordered Quantity does not get copied to Invoice by  DIAPI

Hi All,
I am stuck with an issue in Invoice creation using  DI API by code.The field Ordered Qty (DB Filed INV1.OrderedQty) does not gets copied to Invoice line from delivery lines. But while we add invoice from delivery >Copy To> AR Invoice , it gets copied to Invoice lines. This OrderedQty field is not exposed through DI API, so we cant set that field throgh code. What I do in Invoice creation code is as follows.
SAPbobsCOM.Documents oINV;
                    oINV = (SAPbobsCOM.Documents)
                        modups.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
                    oINV.CardCode = oDLN.CardCode;
                    for (int i = 0; i < oDLN.Lines.Count; i++)
                        oDLN.Lines.SetCurrentLine(i);
                        string str = oDLN.Lines.ItemCode;
                        if (i != 0)
                            oINV.Lines.Add();
                        //oINV.Lines.ItemCode = oDLN.Lines.ItemCode;
                        //oINV.Lines.Quantity = oDLN.Lines.Quantity;
                        oINV.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);
                        oINV.Lines.BaseEntry = oDLN.DocEntry;
                        oINV.Lines.BaseLine = oDLN.Lines.LineNum;
                        taxcode = oDLN.Lines.TaxCode;
if (DeliveryExpenseCount > 0)
                            for (int i = 0; i < DeliveryExpenseCount; i++)
                                oDLN.Expenses.SetCurrentLine(i);
                                if (i != 0)
                                    oINV.Expenses.Add();
                                //oINV.Expenses.ExpenseCode=i;
                                oINV.Expenses.ExpenseCode = oDLN.Expenses.ExpenseCode;
                                oINV.Expenses.LineTotal = oDLN.Expenses.LineTotal;
                                oINV.Expenses.TaxCode = oDLN.Expenses.TaxCode;
                                oINV.Expenses.BaseDocEntry = oDLN.DocEntry;
                                oINV.Expenses.BaseDocLine = oDLN.Expenses.LineNum;
                                oINV.Expenses.BaseDocType = 15;
int retVal = oINV.Add();
                    if (retVal != 0)
                        int lErrCode; string sErrCode;
                        modups.oCompany.GetLastError(out lErrCode, out sErrCode);
Any help will be appreciated..
Deepesh

Hi Gordon,
Thank you for your reply.But it didnt fix the problem.The only change of previous code with this one was oINV.Lines.Add() method is called in the last of the loop.But it wont fix issue. 
Updated on 20/10/2011
I have found the issue.The issue is causing if we update the resulting invoice's expense lines.
If we copy the expense lines from delivery and update any line with an amount it works fine and resulting invoice has "Ordered Qty" in its lines. Code is
for (int i = 0; i < DeliveryExpenseCount; i++)
                    oDoc.Expenses.SetCurrentLine(i);
                    if (i != 0)
                        oINV.Expenses.Add();
                    string s = oDoc.Expenses.TaxCode;
                    oINV.Expenses.TaxCode = oDoc.Expenses.TaxCode;
                    oINV.Expenses.BaseDocEntry = oDoc.DocEntry;
                    oINV.Expenses.BaseDocLine = oDoc.Expenses.LineNum;
                    oINV.Expenses.BaseDocType = 15;
                    oINV.Expenses.LineTotal = oDoc.Expenses.LineTotal;
                    if (radioButton2.Checked == true && i == 0)
                        oINV.Expenses.LineTotal = oDoc.Expenses.LineTotal + Convert.ToDouble(txtExp.Text);
But if the delivery has no expense lines or we are adding a new expense line to the invoice while invoice creation from delivery , the resulting invoice does not have "Ordered Qty " in its lines..
Code is
if (DeliveryExpenseCount > 0)
                        oINV.Expenses.Add();
                    oINV.Expenses.ExpenseCode = 1;
                    oINV.Expenses.TaxCode = taxcode;
                    oINV.Expenses.LineTotal = Convert.ToDouble(txtExp.Text);
If I try to add lines
oINV.Expenses.BaseDocEntry = oDoc.DocEntry;
  oINV.Expenses.BaseDocType = 15;
to the above code it may show either "Internal error" or " No matching records found".
Is this a bug in DI API?

Similar Messages

  • The pricing procedure in Sales order is not getting copied into invoice

    The pricing procedure in Sales order is not getting copied into invoice.
    I have created a document type (pricing procedure),based on the document type ,pricing procedure determination is done.
    So while creating sales order the pricing procedure is determined but when invoice is created the pricing doesnt refelect in the invoice.How to over come this problem

    Hi
    Please check the in OVKK, weather you have maintained correctly or not.Also check in the Billing document type details what is the Document pricing procedure that has been maintained.
    Regards
    Srinath

  • New datasource does not get copied to oc4j-config directory

    Today I created a new data source (jdbc/BLUETEST) in my projects data-sources.xml file and assigned it to all of my beans (that used to be assigned another datasource). After rebuilding the project and starting up the application, I got an error that said that there was no datasource jdbc/BLUETEST. Apparently, the new datasource had not been copied to the jdev/system9.0.5.0.0.1375/oc4j-config/data-sources.xml file. I copied the info manually and the app server is booting ok now.
    Is this a bug?
    Rudi.

    Thanks Richard for the note.  Can you please provide details on the rfc?  We were wondering of creating a BADI and calling the same using a process chain through BPC DM.  How is this different from rfc?

  • Configuration of product not getting copied in follow up transaction

    Hello all,
    we are implementing CRM 5.0 . IPC is configured for pricing. After entering products in quotation, I go to configuration tab at item level and configure my product by selecting characteristics. Problem arises when I create a follow up document from quotation. Configuration of individual items that I had done earlier does not get copied in follow up transaction and has to be done again. Is there some setting in IPC/ CRM that will let me copy entire configuration of quotation item?

    Hi Sumedh,
    there is note 899894 with a detailed description how to customize it the correct way! hope it's helpful!
    Regards, Gerhard

  • VAT /CST% manually in the sales order,not getting copied to the Invoice

    Dear Friends,
    If I change the VAT /CST% manually in the sales order,its not getting copied to the Invoice
    Thanks
    Ivy

    Dear Friends,
    Thanks for your valuable inputs....
    I have maintained the condition record for the combination of delivery plant region and the customer  region.......assigned dummy tax code against the Tax condition...therefore I think there wont be any problem in posting billing doc to accounting doc.
    There are different combinations,where sometimes the user is liable for 2% CST ....sometimes 4%CST... but I am able to pick one tax value say 12.5% CST across and maintained the tax condition types - manual entry has priority, as allowed the user to change the value manullay as per the user requirement ....
    Now if i change the Tax condition value in the sales order ,the same is not reflecting in the Invoice....this also is applying from contract to a sales order...
    Please advice me accordingly...
    Thanks
    Ivy

  • Sub items are not getting copied into excise invoice

    Hi Guru's
    I am using Sales BOM in my sale order, pricing and inventory are controlled at sub-item level.
    I am creating the outbound delivery with reference to sale order and billing document (Commercial Invoice) with reference to outbound delivery.
    When I create an excise invoice in J1IIN, subitems are not getting copied from billing document, instead only main item is getting copied along with sum of all the excise duties of subitems. Ex: A is main item (Not relevant for pricing). B and C are subitems with excise duty 10 and 20 respectively. Here A is getting copied with excise duty 30 (10 +30).
    When I download the excise register, register is showing all A, B and C items with quantity but it is not showing the corresponding excise duties of subitems. We would like to avail cenvat at sub items.
    Kindly suggest me how can I copy subitems into excise invoice from billing document.
    Thanks & Regards.
    Swamy H P

    Hi Lakshmipathi,
    Thank you so much for the response.
    Yes, I am able to save the outgoing excise invoice(J1IIN) without any errors. It's working fine for normal materials(With out BOM), but for BOM materials even though main item is not relevant for pricing as pricing is controlled at sub items all the excise duties (BED, ECS and S&H cess) of sub items are getting copied to main item while creating the outgoing excise invoice.
    I mean excise invoice is showing only main item with all the sub items excise duties. same is getting posted also.
    But when I extract and download RG1 register, RG1 report is showing both main item and sub items with quantity but excise duties are not shown.
    I debugged and found that excise duties are not flowing to table J_1irg1 from J_1iexcdtl.
    Thanks & Regards,
    Swamy H P

  • In a purchase order for 3 GR's Quantity does not equal the value

    Hi,
    I have found the difference in one purchase order, there have been 3 GRs where the Qty does not equal the Value.  How has this happened?
    Any guesses why the difference has come.
    Thanks&regards,
    Veena

    Hi Vishal,
    In po history for agt 3 Gr's  Quantity does not equal the values. I hope the difference is Movement types. But exactly where to check this movements i am not getting.
    Can you tell me this which T.code.
    Tx,

  • Quantity is not getting conformed in sales order

    HI SD Gurus,
    i have one issue we are not able to solve i need your help, it is very urgent,
    My issue:we created sales order but quantity was not getting conformed is sales order even though we have enough stock
    but it was consumed the stock in MD04,
    we ran the SDRQCR21 program but issue is still exist,
    1. we checked all the ATP configuration  every thing is fine,
    2.we replicated the scenario in  quality it is working fine
    3.we try simulated in production but not conformed the stock
    4. total stock is in unrestricted only
    5. no block in sales order
    6. same material working fine with different plant
    7. in same plant different materials working fine
    available stock level in MMBE and MD04 is 330 qty unrestricted
    sales order created for 165
    then stock reduced in MD04 to 165,and sales order displayed in MD04 with quantity 165
    but it was not conforming the schedules in sales order(with any dates)
    I am requesting you to reply ASAP if any one faced the same scenario
    BR,
    CS

    Hi CS,
    Please check the stock availability in CO09. If CO09 shows available quantity as zero then the sales order quantity cannot be confirmed.
    Please review SAP Note Number 89362 - No confirmation despite available quantity/stock for further information on this transaction.
    You will also find further information in this document:
    http://scn.sap.com/docs/DOC-58040
    I hope this helps.
    Kind regards,
    Catherine

  • G/L Account mentioned on line level does not get hit in Journal entry on GRPO and AP Invoice in SAP B1 9.0 PL - 11

    Hi,
    G/L Account mentioned on line level does not get hit in Journal entry on GRPO and AP Invoice in SAP B1 9.0 PL - 11
    I am creating an independent AP Invoice, there are two issues:
    1. On line level G/L Account field is not open for selection
    2. I have then selected and updated the account on Form Settings. Same account gets updated on line level.
         In Journal Entry selected G/L account on line level shall be hitted. But it does not put any effect on JE. Accounting is set by Warehouse. It picks up accounts from warehouse only.
    Need help its urgent.
    Thanks in advance.

    Invoice is Item Type.
    G/L Accounts are set by Warehouse. But if explicitly we are want to change the account on line level in that case, it is not getting reflected in Journal entry. On AR Invoice same scenario works perfectly. On line level I can change the accounts explicitly and have the effect on Journal entries.
    Issue seems to be on AP side only.
    As required please find attached the screen shots.
    JEwith mapped GL Account on Warehouse
    JEwith different GL Account on line Level via Form Settings
    Thanks & Regards
    Sonil

  • Right item category not getting copied while copying sales order

    Hi,
    We have a scenario where we are coping an existing order document and maintaining a new order document.
    The problem is that when we are copying the existing order, we ll not get the same item categories in the copied order as available in the original order.
    The Free of Cost item categories of the materials got changed to the normal item categories, which should not happen.
    Let me know if any configuration changes made in system can fix this issue.
    Cheers!!!
    Ajay

    Hi,
    This may be due to copycontrol between these two sales order. In copy controls, you are retriggering the item category determination.
    When you define the copy control from SO to SO, select the item category and keep the source and target item category as same. (Same for schedule line category also). Once this is done, your problem will be solved.

  • Payment method not getting copied automatically during posting invoice

    Dear Gurus,
    The payment method maintained in the vendor master " T" / "C" is not getting copied while posting the invoice document in MIRO or FB60 .
    The terms of payment is being defaulted from the master data, but not the payment method.
    Please help in this regard.
    Regards,
    Raghu

    Hi Raghu,
    You should check that the invoicing party on the details tab is the
    same vendor that has the payment method supplement filled in the
    vendor master record under the payment transactions accounting screen.
    Best regards,
    Adam.

  • Storage location not getting copied in process order for components

    Dear PP Gurus,
    While making a production /process order the storage location of component materials is not getting copied from material master into the process order, it is showing any default storage location.
    What couls be the reason for it..
    For all components it is defaulting the same storage location.
    Please throw some light on the issue what could be the reasoon for it..

    Dear,
    System determine issue storage location from the material master, the value of the storage location of the BOM item, or the storage location from the supply area.
    Check in BOM component details storage location you have defined.
    Check production storage location from the plant segment of the component is taken into account for the use of MRP areas also. When planned order is being created for the superior assembly in a MRP area?
    Also check the Material requirements planning (PP-MRP)
    --> planning process
      --> BOM explosion and dependent requirements determination
        --> storage location determination for BOM explosion
    Regards,
    R.Brahmankar

  • Item Number not getting copied from Delivery to Invoice

    Dear Experts
    I am having a problem where Item Number in Delivery is 10 and in Invoice it is 11. The item number is  not getting copied from Delivery to Invoice. I have checked the copy control option and copy item number is checked.
    Please advise

    Hi,
    In VOFA Item no. increment has already been maintained as "0" but the problem is still there.
    Regs

  • Manual discounts are not getting copied from Quote to Sales order

    Hello All,
    If I assign a manual discount to any item in Quotation document, this condition type with its discount amount is not getting
    copied over to Sales order document, I have selected the drop down "D Copy all conditions" in the copy control for item categories,
    and both quote & Sales order use the same pricing procedure, i am i missing something here?
    I appreciate your help
    thanks
    Chandu

    Hi Chandu,
    Please try to adopt the standard pricing type in the copy control between QT and OR which is "A - Copy Pricing components Unchanged and redetermine Scales".
    Please share the outcome.
    Regards

  • Task list not getting copied in Order

    Hi All,
    I have created a Maintenance plan where my call object is notification. I have scheduled the plan & i got the Notification after releasing the call.
    I am getting the Task list reference in Maintenance plan tab in notification.
    Now my issue is, the task list is not getting copied to order when i create order against the notification.
    Kindly help me resolve the issue.
    Thanks & regards,
    Basavaraj

    Basavaraj,
       When a order is created from the worklist (IW28) of notification , the task list associated to the notification will be exploded and added as operations.
    Have a look at [Sap Help|http://help.sap.com/saphelp_erp60_sp/helpdata/en/fc/f26c3c17c8c67ee10000000a11402f/frameset.htm]
    for detailed steps.
    Regards
    Narasimhan

Maybe you are looking for

  • How do I have a picture printed from my iphone

    How do I  get pictures prints taken with my iphone 4? Would like to have them developped at the Drug Store. Do I need a USB key?

  • Calling a Web Service in a SSRS Report - Error Converting String to Generic List of Strings

    Hello, I am using SSRS version 2005 and am trying to call a web service to retrieve data for a SSRS report.  I've looked on Google and MSDN for the past 2 days and have exhausted all options.  Here are the details... The web service method I am calli

  • Ipod nano 4 with i mac G3 400

    I'm Italian, i have buy e new i pod nano and i have a problem to connecting the i pod with my i mac g3 400 mhz with mac os x 10.2.8 and i have itunes 6, i want to connect my i Pod for to transfer the mp3 file that i have in my imac; when i connect th

  • Black thumbnails in iPhoto 6.0.5

    I never had any problems with iPhoto (v. 6.0.5), but last week any photo or file imported showed as a black thumbnail. Clicking on the thumbnail brought up the picture just fine. I tried rebuilding the thumbnails and the library database, and this ma

  • Voucher payment posting

    Hi I have a voucher, payment is done payment reference number is also generated. Payment entry is showing in PS_PAYMENT_TBL for that payment reference number. However there corresponding entry is not showing in PS_PYMNT_VCHR_XREF table. PS_VCHR_ACCTG