Problem adding Sales Invoices with batches

Hi,
I am trying to create an invoice with a batch component which is returning "Cannot add row without complete  selection of batch/serial numbers".
I can add these lines manually using teh UI but not via the DI Server.  The relevant <BOM> section is shown below.  The only mandatory element seems to be <BatchNumber> and I have tried it with just that element and with combintaions of them all.  I have also tried adding a <LineNum> to the main <Document_Lines> section in case it needed this to tie up with teh <BaseLineNumber> (which I have als tried leaving out).
I have extarcted a GetByKey for a manually entered one and I cannot see the problem.  Any help would be appreciated.
Nick
<BOM>
<BO>
<AdmInfo>
   <Object>oInvoices</Object>
</AdmInfo>
<Documents>
   <row>
      <CardCode>C000002</CardCode>
      <NumAtCard>Order #12979</NumAtCard>
      <Confirmed>tYES</Confirmed>
      <DiscountPercent>0.000000</DiscountPercent>
      <PayToCode>Aidann Bowley</PayToCode>
      <ShipToCode>Aidann Bowley</ShipToCode>
      <ContactPersonCode>34</ContactPersonCode>
   </row>
</Documents>
<Document_Lines>
   <row>
      <ItemCode>BM25-15</ItemCode>
      <Quantity>1.000000</Quantity>
      <PriceAfterVAT>6.000000</PriceAfterVAT>
   </row>
</Document_Lines>
<BatchNumbers>
   <row>
      <BatchNumber>WEBTEST</BatchNumber>
      <ManufacturerSerialNumber/>
      <InternalSerialNumber/>
      <ExpiryDate nil="true"/>
      <ManufacturingDate nil="true"/>
      <AddmisionDate>20140428</AddmisionDate>
      <Location/>
      <Notes/>
      <Quantity>1.000000</Quantity>
      <BaseLineNumber>0</BaseLineNumber>
   </row>
</BatchNumbers>
</BO>
</BOM>

Hi
Please enter your thread in SDK Forum
SAP Business One SDK
Thanks
Mohammad Imran

Similar Messages

  • Problem adding sales order with freight since 8.8 pl 20 (and 8.81 pl 0)

    Dear All,
    Since the upgrade to 8.8 patch 20 I have a problem with adding a sales orders with freight (expensecode 1 does exist!) through the XML import of (the same problem with 8.81 pl 0).
    This is the XML:
    <BOM>
         <BO>
              <Documents>
                   <row>
                        <DocType>dDocument_Items</DocType>
                        <DocDate>20110328</DocDate>
                        <DocDueDate>20110328</DocDueDate>
                        <CardCode>INT_C_PenS</CardCode>
                   </row>
              </Documents>
              <Document_Lines>
                   <row>
                        <ItemCode>10000024</ItemCode>
                        <ItemDescription>Afvalbak CONSTRUCTO 50</ItemDescription>
                        <Quantity>4.00</Quantity>
                        <ShipDate>20110328</ShipDate>
                        <DiscountPercent>20.00</DiscountPercent>
                        <UnitPrice>528.00</UnitPrice>
                        <LineStatus>bost_Open</LineStatus>
                        <LineType>dlt_Regular</LineType>
                   </row>
              </Document_Lines>
              <DocumentsAdditionalExpenses>
                   <row>
                        <ExpenseCode>1</ExpenseCode>
                        <LineTotal>64.00</LineTotal>
                   </row>
              </DocumentsAdditionalExpenses>
         </BO>
    </BOM>
    When the DocumentsAdditionalExpeses part is deleted then there is no problem.
    The error with the DocumentsAdditionalExpeses is 'Internal error accured'.
    Can anyone confirm that this not is working through XML import (DTW works) or is there a solution?
    Thanks and best regards,
    Wim Kleinsman

    Hi,
    Try this one.
    <BOM>
    <BO>
    <Documents>
    <row>
    <DocType>dDocument_Items</DocType>
    <DocDate>20110328</DocDate>
    <DocDueDate>20110328</DocDueDate>
    <CardCode>INT_C_PenS</CardCode>
    </row>
    </Documents>
    <Document_Lines>
    <row>
    <ItemCode>10000024</ItemCode>
    <ItemDescription>Afvalbak CONSTRUCTO 50</ItemDescription>
    <Quantity>4.00</Quantity>
    <ShipDate>20110328</ShipDate>
    <DiscountPercent>20.00</DiscountPercent>
    <UnitPrice>528.00</UnitPrice>
    <LineStatus>bost_Open</LineStatus>
    <LineType>dlt_Regular</LineType>
    <ExpenseCode>1</ExpenseCode>
    <LineTotal>64.00</LineTotal>
    </row>
    </BO>
    </BOM>
    Regards,
    Siva

  • Sales Returns with batch split.

    12.10.10
    Hi friends,
    I have created a sales return against invoice with multiple batches for a BOM item.  During returns the returns have created individual lines for each of the batch and the components are also available as per sales bom. The components are dependent on the main item and since the main items are in multiple lines when changes are done the components are not adjusted accordingly. Please advise how to solve this problem.
    Regards,
    Udaynath.

    12.10.2010
    Reazuddin thanks for the reply. Yes this is a complex scenario.
    Its the main matierial which is physically moved out from stock.
    The billing and pricing is done at the component level, the main material as well as the components are available in the billing document.
    The problem is with the returns against invoice. When the return order is maed it has the  main material say with line 10 without batches and quantity.
    The batches are copied with the quantity as line number 11,12 ...
    So when the quantity is changed in the lines containing batches,  the changes are not carried out in the components as the components are referring to line 10.
    The issue is when there are multiple batches. Can you please advise on the scenario.
    Regards,
    Udaynath.

  • Problem in Sales Order with specific condition type.

    Hello Experts,
    I'm facing a problem in sales order creation for a specific condition type.
    the actual scenario is as below,
    We have created a new condition type for special discount.This condtion type is applicable only for specific sales channels.Also the discount percentage has to fetched from a custom table.
    To achieve this I've written a user exit "RV64A999"
    In the FM, i've calculated the subtotal and fetched the discount percentage and calculated the discount amount. After implementing this, the SO were been created properly. for all the line items the discount amount was getting calculated properly.
    But then I added a condition at the top of code in exit that the calculation for the new condition type should happen only for selected sales channels.
    But after adding this condition in code, i'm facing problem. Now when I create/ change any SO, the discount amounts are getting calculated incorrectly. I'm getting discount amount even if the line item subtotal amount is zero (0).
    Any help or pointers reagrding this issue will be very helpful and highly appreciated.

    Hi ..
    Check your config. again or debug the routine code with your ABAPer and find the problem area.
    -Maharshi

  • Closing sales line with batch item

    Hi all,
    I´m going to closing a sales line by DIAPI. If the item isn´t managed with batch item, the line closed well. But in other case i have this error:
    "Document rows cannot be closed concurrently with the other document modifications you have made  RDR1.LineStatus[line: 0]"
    I try to quit all formatched search that i have in sales line level. I read all the posts about this (i think), and i can´t solve this problem. I think that´s a bug because if i try to close manually, all is correct.
    My code is this:
    if (oPedido.GetByKey(4617))
                    oPedido.Lines.SetCurrentLine(0);
                    //oPedido.Lines.Quantity = 11;
                    oPedido.Lines.LineStatus = BoStatus.bost_Close;
                    if (oPedido.Update() != 0)
                        SBO_Application.StatusBar.SetText(
                            "Error message",
                            BoMessageTime.bmt_Medium, BoStatusBarMessageType.smt_Error);
    I try to put this code in first lines of the addon , i don´t touch any other data, only close line,  i try with garbage collector.....
    Regards.

    Hello Kate,
    A precaution is always needed when you cancel any items.  You need run a simple query such as:
    SELECT * FROM RDR1 T0 WHERE T0.ItemCode = '[%0\]' to check any Sales Orders contain this code.
    Thanks,
    Gordon

  • Problems in queueing invoices in batch process

    Hello everyone,
    Iu2019m having problems in queueing invoices before their extraction to B.I (delta queue).
    When an invoice is generated through transaction VF01, queueing occurs without a problem. We also have a Z transaction that generates -in mass- invoices having the order or delivery as input parameter but when this transaction is used, not all invoices are queued. We have this problem for just one Company.
    This Company as the others in the Corporation use a Batch process (inside the Z transaction) to trigger VF01 transaction with the difference that when this happens no invoices are queued. (tx. LBWQ) consequently showing misinformation in our daily reports.
    We ran the batch process directly in tx. SHDB (to simulate tx VF01) for two companies. Both generate all the invoices but only one queues the records.
    Seems that a configuration on this batch process is needed for each different Company but I havenu2019t found an answer yet.
    Thank you very much for your help.

    You can find a very good SAP doc on this topic at
    www.service.sap.com/bi
    BW Infoindex - Extraction(SAP systems) -New update methods in Logistics extraction with PI 2003.1
    Kumar Gudiseva.

  • Accounting document creation for sales invoice with IDOC INVOIC02 ?

    Hi All,
    Our sales invoice are managed in a external system and those Invoice are going to be send in FI with IDOC interface.
    is it possible to use the IDOC INVOIC02 to do this operation ?
    if yes, what are the customizing points I have to implement ?
    if not, what kind of IDOC can I use ?
    Thank you in advance for your help
    Franck

    Hi Thenna
    The accounting document status in the document flow is determined dynamically when you display the document flow,
    it's not saved in a specific table.
    Here is the relevant logic:
    LV05CF01 -> form BUCHHALTUNGSBELEG
    IF vbrk-vbeln <> vbfa_tab-vbeln.
       PERFORM vbrk_ermitteln USING vbfa_tab-vbeln.
       REFRESH xbkpf.
       CALL FUNCTION 'FI_DOCUMENT_READ'
        LOOP AT xbseg WHERE bukrs EQ xbkpf-bukrs
                      AND   belnr EQ xbkpf-belnr
                      AND   gjahr EQ xbkpf-gjahr
                      AND   ( koart EQ 'D' OR koart EQ 'K' ).
        ENDLOOP.
                IF NOT sy-subrc IS INITIAL.
      SET STATUS TO 'No items are cleared'
                  l_xdoc_num-status = 'A'. <<<
                ELSE.
                  LOOP AT xbseg WHERE augbl IS initial
                                AND   umskz NE 'A'
                                AND   vorgn NE 'AZUM'
                                AND   ( koart EQ 'D' OR koart EQ 'K' ).
                  ENDLOOP.
                  IF NOT sy-subrc IS INITIAL.
      Set status to 'All items are cleared'
                    l_xdoc_num-status = 'C'. <<<
                  ENDIF.
                ENDIF.
    Regards,
    Alex

  • Sales return against invoices with batches.

    01.11.2010
    Hi friends,
    We are using BOM for materials. During delivery batches are determined and in the invoice i have the main material with zero quantity and zero value,  followed by the lines with the batches determined and the components.
    In case of returns i want to copy each of the batch line followed by the corresponding BOM quantity.  For eg. if the delivery quantity was 50 and 3 batches were determined of 10,15,25 then in the sales return i want the line with the batch quantity 10 and the components, followed by the batch line with quantity 15 with their components and finally the quantity 25 followed by the components for 25 nos. How can this be achieved.   Please suggest.
    Regards,
    Uday

    Hi
    You have to create your own data transfer routine for this. This routine is to be used in the copy control from invoice to order.
    Regards,
    Torben

  • Stock allocation for sales orders with batch job

    Hi Friends
    We have  a batch job to allocate stock for sales orders which runs every week , currently this batch job is meant for plant 1000 with availability check procedure Z1 .
    I need to incorporate for same batch job plant 1000 with availability check procedure Z2
    Just I need to know that there is any  potential impact and it  causes any problem ?
    Thanks In Advance
    Rusheek

    Hi,
    Check what difference is between procedure Z1 and procedure Z2.  As we cant see this, you will  have to analyze what Z1 was doing and what Z2 is expected to do.  Broadly speaking this is preety subjective to your project.
    You analyze and try to find out the impacts.  If needed take help of abaper.
    Rgds,
    SB

  • Report with customer info for an Sales Order with batch details

    Hi
    Can any one please tell me the SAP REPORT with contains data of customers were shipped a specific product (material number) by batch number.  report with the name and address of the customer, the sales order number and the number of products that were shipped.
    Thanks
    Nick

    Hi nick,
    See if anybody has worked on SIS (sales information system) in your team.
    He can help you out to create one info structure , by selecting desired characteristics, key figure with respective update rules. though its require lot of configuration but you can make it without abap development.
    (I couldn"t make it in time to provide you detailed configuration but below given path will take you to the configuration area )
    IMG - LG -Logistick information system -logistick data werhouse- data basis- field catalogue.
    IMG - LG -Logistick information system -logistick data werhouse- data basis -
    infostructure.
    IMG - LG -Logistick information system -logistick data werhouse- data basis - updating - update defination & update rules.
    ( MC18, MC21, MC24,& MC30)this transaction help to create field catelogue, info system, update rule & generation log respectively.
    karnesh

  • Sales invoice with 100% discount

    Hi,
    Can you tell me if there is a way in SAP where the system allows a ZERO value to reflect in the customer account and the reconciliation account.
    The scenario is,  material A is sold at a price of $100 to customer. A 100% Discount is given and the journal entry that gets generated is
    Discount A/C Dr  $100
    Sales A/C     Cr   $100.
    The requirement is to reflect the Zero value(i.e after 100% discount) in the customer A/C and the recon A/C so that the accounting Document entry is
    Discount A/C  Dr  $100
    Customer A/C Dr $0.00
    Sales A/C      Cr   $100.
    When a discount of 99.99% is given, the customer a/c gets displayed with $0.01 value, but the aim is not to bill the customer, but to reflect the invoice in the customer A/C and the subsidiary ledger.
    Can you please advise if this is even achievable in the system.
    Thanks and Regards,
    Shilpa.

    Hello,
    In SD we have free goods scenario. Please check with your SD consultant if it would be possible to configure your scenario there.
    Normally it is not possible to configure term of payment with 100% cash discount.
    Best Regards,
    Raju

  • Restrict Adding Sales Order with ProjectCode

    Hi Experts,
    i try restrict Sales ORder from Adding without ProjectCode (from itemlevel - RDR1.Project). Below is my script on TransactionNotification, but still it doesnt work..please help my with my script...
    IF @transaction_type IN ('A', 'U') AND @object_type = '17'
    BEGIN
    IF EXISTS (SELECT t0.DocNum FROM ORDR t0 inner join RDR1 t1 on t0.docentry
    = t1.docentry WHERE t1.Project ='' AND t0.Docentry = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @Error = 1, @error_message = 'Please enter the field "Project Code" first ! by: IT Dept.'
    END
    END
    Thanks,
    jonathan

    Try with this modification:
    IF @transaction_type IN ('A', 'U') AND @object_type = '17'
    BEGIN
    IF EXISTS (SELECT t0.DocNum FROM ORDR t0 inner join RDR1 t1 on t0.docentry
    = t1.docentry WHERE isnull( t1.Project,'') ='' AND t0.Docentry = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @Error = 1, @error_message = 'Please enter the field "Project Code" first ! by: IT Dept.'
    END
    END

  • Problem to make invoice with reference URGENT!!! (reward points)

    Dear ABAP expert ,
    We need to enhance our program to post accounting document (simulate tcode MIRO). The existing logic is posting document via BAPI function BAPI_INCOMINGINVOICE_CREATE. The different between new requirement and current logicis that the current program will post MIRO with PO reference but the new logic will posting with Delivery Note.
    As check with SAP, there is no field for the Delivery Note in BAPI_INCOMINGINVOICE_CREATE but the Delivery Note is available in BAPI_INCOMINGINVOICE_SAVE which only create the invoice document not the accounting document.
    Could you help suggest if we have another option to fulfill the requirement ?
    Cheers!!!

    Hi,
    Have got any solution on this issue, I am also having the same problem I have to create invoice through BAPI reference of Delivery note, if you have done kindly share with me how you didi this.
    Regards,
    Sathish J

  • Adding Sales Order with multiple lines

    Hi all,
    I have a C# program whereby I am trying to get Sales Orders from one database (source) and create them in another database (destination). I can't get the code to work properly as lRetCode is never equal to 0 but is -5002.
    How can I fix it so that it adds the sales orders properly?
    Here is the code snippet:
                unaddedSOs = sList.Except(dList).ToList(); // contains the header information
                // Add the Sales Orders that are missing to destination database
                SAPbobsCOM.Documents sboSO =   (SAPbobsCOM.Documents)oCompanyDestination.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);  // Destination
                // Loop through unadded Sales Orders
                foreach (var item in unaddedSOs)
                    // Set properties of the Sales Order object
                    sboSO.CardCode = item.cardCode;
                    sboSO.CardName = item.cardName;
                    sboSO.DocDate = item.docDate;
                    sboSO.DocDueDate = item.docDueDate;
                    // Add Sales Order Document Lines
                    SAPbobsCOM.Recordset rsLines = oCompanySource.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); // Source of lines
                    // Get Sales Orders from source database
                    rsLines.DoQuery("SELECT ItemCode, Quantity, Price FROM RDR1 WHERE DocEntry = '" + item.docNum + "'");
                    rsLines.MoveFirst();
                    if (rsLines.RecordCount > 0)
                        while (!rsLines.EoF)
                            sboSO.Lines.ItemCode = rsLines.Fields.Item("ItemCode").Value;
                            sboSO.Lines.Quantity = rsLines.Fields.Item("Quantity").Value;
                            sboSO.Lines.Price = rsLines.Fields.Item("Price").Value;
                            sboSO.Lines.Add();
                            rsLines.MoveNext();
                    // Try to add the Sales Order to the database
                    int lErrCode = 0;
                    string sErrMsg = "";
                    int lRetCode = sboSO.Add();
                    if (lRetCode != 0)
                        int temp_int = lErrCode;
                        string temp_string = sErrMsg;
                        oCompanyDestination.GetLastError(out temp_int, out temp_string);
                        // Incase adding a Sales Order failed
                        if (lErrCode != -4006)
                            // Display error message
                            MessageBox.Show(lErrCode + " " + sErrMsg);
                MessageBox.Show("Done!!!");
    Kind Regards,
    Kinyanjui.

    Hi Kinyanjui,
    I think you're always writing to the same line:
    int row = 0;
    while (!rsLines.EoF)
        sboSO.Lines.SetCurrentLine(row);
        sboSO.Lines.ItemCode = rsLines.Fields.Item("ItemCode").Value;
        sboSO.Lines.Quantity = rsLines.Fields.Item("Quantity").Value;
        sboSO.Lines.Price = rsLines.Fields.Item("Price").Value;
        sboSO.Lines.Add();
        rsLines.MoveNext();
        row++;
    Best regards,
    Pedro Magueija

  • Sales report with Batch number & expiry dates

    Hello friends,
    would any one please help me to frame this query to achieve the above ..
    my query is as bellow, but I want to add the batch number & expiry dates along with the other information.....
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode] >=[%0] AND  T1.[ItemCode] <=[%1] AND  T0.[DocDate] >=[%2] AND  T0.[DocDate] <=[%3]
    So which table to join to get the batch & expiry...
    Rgds
    Suman

    HI
    Batch table is OIBT, IBT1,OBTN
    SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T4.[ExpDate] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry inner join
    IBT1 T2 on T1.ItemCode = t2.ItemCode and T0.objtype=T2.basetype and T2.baseentry=T1.Docentry inner join
    oitm T3 on T1.Itemcode=T3.Itemcode inner join OIBT T4 on T1.Itemcode=T4.Itemcode  WHERE T1.[ItemCode] >=[%0] AND  T1.[ItemCode] <=[%1] AND  T0.[DocDate] >=[%2] AND  T0.[DocDate] <=[%3]
    group by T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity],T4.[ExpDate]
    Thanks
    Mohammad Imran

Maybe you are looking for