Sales to Billing Invoice Creation with Split that Shouldn't Occur

Good Morning,
First of all, let me tell you i've started doing some ABAP development last week, so i have a lot of things to yet understand.
I received a request to implement a change in the creation of a billing document.
Context:
I have a order - Order 132098723 - with the following header data:
    VBAK-VBELN = 0132098723
    VBAK-VBTYP = C
    VBAK-AUART = ZCV
    VBAK-VKORG = 0100
    VBAK-VTWEG = T1
    VBAK-SPART = 00
    VBAK-KNUMV = 0000223615
    VBAK-FKARA = ZF3
    VBAK-KUNNR = 0010135306
    VBAK-TAXK1 = <empty>
    VBAK-TAXK2 = <empty>
    VBAK-TAXK3 = <empty>
    VBAK-TAXK4 = <empty>
    VBAK-TAXK5 = <empty>
    VBAK-STCEG_L = <empty>
    VBAK-LANDTX = <empty>
The items for this Order - Order 132098723  are:
Item
Material
Order Quantity
Un
Description
ItCa
10
0,000
ZATX
20
1400008183
1
UN
<Description>
ZTAS
I have a delivery - Delivery 811128713 - with the following header data:
    LIKP-VBELN = 0811128713
    LIKP-VBTYP = J
    LIKP-KUNNR = 0000223615
    LIKP-FKARV = ZF3
The items for this Delivery - Delivery 811128713 are:
Item
Material
Delivery. Qty
Un
Description
ItCa
10
1400008183
1
UN
<Description>
ZTAS
A copy control was created in transaction VTFA - Sales to Billing Document:
Header
    Tgt    Billing Type    Source        SalesDoc Type
    ZF3  Invoice          ZCV            Standard Order
    Copy Requirements    001    Header/order-related
    Determ.export data    <empty>
    Assignment Number    E
    Reference number      A
    Copy item number checked
Item
    Target Billing Type    ZF3    Invoice
    From SalesDoc    Type    ZCV    Standard Order
    ItmCt        Description
    TAD          Invoice
    ZATX        Text Item
    ZSCV      <Description>
    ZTAD        <Description>
Step by Step of the process:
I call transaction VF01 and i input two docs to be processed:
    132098723 - Order
    811128713 - Delivery
Before i Execute i will do a Billing Document Overview (F5) and in the Billing Document Overview two invoices are generated:
    Invoice - <Name> - <Net_Value>
    Invoice - <Name> -<Net_Value>
THE PROBLEM:
INSTEAD OF TWO INVOICES, ONLY ONE INVOICE SHOULD BE GENERATED. When i do a split analysis the system informs me that the reason for the split is happening because of different header data:
Fld  Name
$000000001
$000000002
Tax classification 1 for customer (TAXK1)
1
Tax classification 2 for customer (TAXK2)
1
Tax classification 3 for customer (TAXK3)
1
Tax Classification 4 Customer (TAXK4)
1
Tax classification 5 for customer (TAXK5)
0
Tax departure country
PT
I've spoken with my colleague who requested the correction of this and he told me that what he wants is that, in this case, only one invoice should be created.
He also told me that in this case only happens when a item with category ZATX exists in the Order (in this case item category ZATX exists in the first item of Order 132098723).
Debugging, i've found out that the reason for the split is that in program SAPLV60A, in include LV60AA95, form VBRK_VBRP_DATENTRANSPORT, the VBRK-TAXK* values are populated with values from KURGV-TAXK* and VBRK-STCEG_L is populated with values from KURGV-LAND1 or KURGV-STCEG_L (conditional). The problem is that the program goes through the section of code where KURGV is changed twice (as far as i've understood it's related with the fact that there are two items in the Order 1320987239 and on the first pass the KURGV-TAXK* and KURGV-LAND1 are empty, and in the second they have values and i think that's why the split occurs.
I'm also attaching a document with screenshots of the debug which i think they can help.
Please let me know if you need specific information.
Can you please help me in finding how can i prevent this split to occur?
All help is welcome
Best Regards,
Pedro Gaspar

Hola Pedro
First of all, see SAP Note 11162 - Invoice split criteria in billing document as a checklist.
Second, look for posts in this site with the string or keyword ZUKRI or ZUK. The question is populate the field ZUKRI and force the split according this field. It could be made with a custom VOFM subruoutine, taking any standard as a template.
f you are using values from SO and delivery for populating values in VBRK and VBRP, populate them in SO, doing them mandatories (incomplete schemes,...) or populating data in master data (material, partners,...).
I hope this helps you
Regards
Eduardo

Similar Messages

  • Single invoice creation with reference two sales document type

    Hi,
    I have created Sales contract & Sales Order.I want to create single Invoice with reference to both sales contract & sales order.
    Please give me the solution how to do that???????????
    Thanks,
    Miku.

    Hello Dear,
    Invoice normally is not created directly Contract but from Sales order. And Sales order is created wrt to contract then delivery & billing.
    If u have Service & Maintenance contract then u do billing from it and there is no Sales order.
    Hope this clarify.
    Thanks,
    Dilip Sadh

  • Invoice creation with reference to Sales Order no in IDoc

    Hi Guys,
    Is it possible to create a Invoice with reference to the  sales order no in IDOC
    Regards
    Sathis.

    Hi,
    Use FM rv_invoice_create.
    BR,
    Lokeswari.

  • BAPI for billing doc. creation with ref to outbound delivery

    Hi,
    I'm looking for BAPI to create pro forma invoice billing doc with red. to outbound delivery.
    I have tried using BAPI_BILLINGDOC_CREATEMULTIPLE entering the outbound delivery as ref. document and all other required data. Pro forma is create but pricing is not copied since the bapi considers the delivery number as external doc.
    It seems that BAPI_BILLINGDOC_CREATEMULTIPLE is designated to billing doc. with ref to sales orders
    Would appreciate any suggestions,
    Assaf

    Hi,
    In Function Module initial screen, there is no input parameter. Directly choose execute.
    system will give the create billing document screen enter delivery document number and execute.
    Why are using BAPI  to create billing document with reference to delivery document.
    you can create background job for billing through VF06.
    Regards,
    Chandrasekhar.S

  • Sale order Billing invoice history.

    Hi,
    I am an ABAPer. I have to create a report that displays the invoice billing history of a sales order for a particular period of time.
    My final table should contain the following fields.
    Invoice Date
    Document Type
    Currency
    Invoice Amount (in DC)
    Invoice Amount (in LC)
    Invoice Amount (in USD)
    Invoice Period
    Post.Date
    Doc.Date
    SOW No
    SOW Description
    PO No
    Account Manager
    Project Manger
    Project Code
    WBS Element
    City
    Business Area
    G/L Account
    Special G/L ind.
    Spl. GL Text
    I need to the know the tables i need to fetch these information.
    Please help!

    Did you already find tables VBAP/VBAK, VBFA, VBRP/VBRK, BSEG/BKPF during your search or anlyzing FM SD_DOCUMENT_FLOW_GET ?
    Nevertheless I suggest you read first note 185530 - Performance: Customer developments in SD, then post where you get a problem.
    Regards,
    Raymond

  • Invoice creation with reference to quotation

    Hi,
    I have a specific requirement where my client want invoice can be created with reference to quotation.
    What kind of configuration is required in copy control?
    Please guide.
    Regards,
    Balaji

    Hii
    First of all make copy control in VTFA with ur Quotation type to Invoice type
    and set the Item category AGX at item level
    Then go to VOV8 t-code and double click on your quotaton type, Go to billing section and make entry in Order relevant billing with your billing type
    Regards
    Shambhu Sarkar

  • BAPI for invoice creation with reference SalesOrder

    hi Mr Anjireddy,
    i am able to create invoice with the bapi BAPI_BILLING_CREATEMULTIPLE, here i'm giving the RefDocNo of the SalesOrder, the invoice is generated but i'm not gettting the NetValue, TaxValue.
    plz give the information for that prob,
    eswar

    Hi Vinod,
    This is just idea.
    Get Purchase Requisition details using
    <b>BAPI_REQUISITION_GETDETAIL</b> and then use <b>BAPI_PO_CREATE1</b>. I think there is no Direct BAPI.
    *******Poorna*********

  • FB01 invoice creation with IDOC INVOIC02 - Profitability Analyses

    Hello All
    I currently use INVOIC02 Idoc to create invoices (FB01).
    FM : IDOC_INPUT_INVOIC_FI
    I use the E1EDP30 segment with QUALF = 046 to fill CO-PA Object.
    I don't manage to fill imputation fields of this object like sales order number or customer number.
    Must I use an exit ? fill other fields of INVOIC02 idoc ? duplicate and arrange IDOC_INPUT_INVOIC_FI function ?
    Can you help me ?
    Thanks
    Message was edited by: Jean-Charles

    Hi I've progressed :
    I've used exit EXIT_SAPLIEDI_101 :
    * Process 1 time only
      CHECK idoc_data_index = 1.
      DATA :
    *   Segments IDOC
        s_e1edk02 LIKE e1edk02,
        s_e1edka1 like e1edka1,
        s_e1edk14 LIKE e1edk14,
        s_e1edp01 LIKE e1edp01,
        s_e1edpa1 LIKE e1edpa1,
        s_e1edp30 LIKE e1edp30,
    *   Variables
        w_kunwe TYPE kunwe,     " Client livré
        w_kunag type kunnr,     " Donneur d'ordre
        w_bukrs TYPE bukrs,     " Société
        w_ekorg TYPE ekorg,     " Organisation commerciale
        w_posnr TYPE posnr_va,  " Poste Commande
        w_belnr TYPE vbeln_va,  " N° Commande
        i(6)    TYPE n.
    * Récupération des informations souhaitées
    * Le premier poste à renseigner est le poste 2 car
    * le 1er est réservé au créditeur
      i = 1.
      LOOP AT idoc_data.
        CASE idoc_data-segnam.
          WHEN 'E1EDKA1'.
            MOVE idoc_data-sdata TO s_e1edka1.
    *       Récupération Donneur d'ordre
            IF s_e1edka1-parvw = 'AG'.
              w_kunag = s_e1edka1-partn.
            ENDIF.
          WHEN 'E1EDK02'.
            MOVE idoc_data-sdata TO s_e1edk02.
    *       Récupération N° Commande
            IF s_e1edk02-qualf = '002'.
              w_belnr = s_e1edk02-belnr.
            ENDIF.
          WHEN 'E1EDK14'.
            MOVE idoc_data-sdata TO s_e1edk14.
    *       Récupération N° Société
            IF s_e1edk14-qualf = '003'.
              w_bukrs = s_e1edk14-orgid.
            ENDIF.
    *       Récupération N° Org Commerciale
            IF s_e1edk14-qualf = '008'.
              w_ekorg = s_e1edk14-orgid.
            ENDIF.
          WHEN 'E1EDP01'.
            i = i + 1.
            MOVE idoc_data-sdata TO s_e1edp01.
    *       Récupération poste de commande
            w_posnr = s_e1edp01-posex.
          WHEN 'E1EDPA1'.
            MOVE idoc_data-sdata TO s_e1edpa1.
    *       Récupération Client livré
            IF s_e1edpa1-parvw = 'WE'.
              w_kunwe = s_e1edpa1-partn.
            ENDIF.
          WHEN 'E1EDP30'.
            MOVE idoc_data-sdata TO s_e1edp30.
    *       Remplissage uniquement pour imputation CO-PA
            IF s_e1edp30-qualf = '046'.
              CLEAR document_data.
              document_data-stype = 'P'.
              document_data-count = i.
              document_data-fnam = 'COBL-PAOBJNR'.
              document_data-fval = s_e1edp30-ivkon.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_BUKRS'.
              document_data-fval = w_bukrs.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_VKORG'.
              document_data-fval = w_ekorg.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_KNDNR'.
              document_data-fval = w_kunag.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_KUNWE'.
              document_data-fval = w_kunwe.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_KAUFN'.
              document_data-fval = w_belnr.
              APPEND document_data.
              document_data-fnam = 'BSEG-RKE_KDPOS'.
              document_data-fval = w_posnr.
              APPEND document_data.
            ENDIF.
          WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    In WE19 when I process my IDOC :
    - in background mode : IDOC has status 51 'Field COBL-PAOBJNR doesn't exist in dynpro SAPLKACB 0002'
    - at screen : status 53 => OK
    Have you an idee of my problem ?

  • Invoice creation with out PO and Item using BAPI_INCOMINGINVOICE_CREATE

    Hello,
    I have a requirement to create the invoce with out PO number. Is there any chance to create the invoice through BAPI_INCOMINGINVOICE_CREATE with out using PO number and item ( ITEMDATA table ).
    Thanks for your support.
    Regards
    Nags

    Hello Burak, 
    Now i am able to post the docuemnt through BAPI_ACC_DOCUMENT_POST, unable to post the parking docuemnt.
    WIth this Function module PRELIMINARY_POSTING_FB01  it very big process to map the fields, because SAP it self
    filling lot of fields.  
    Mean while i have tried the BDC to park the document, but i am getting an error that 'Parking is not possible through batch input'.
    RECENTLY ADDED
    Now i am getting an issue when we post with the function moduel :PRELIMINARY_POSTING_FB01 , after executing the function module it is giving the document number, but if it fails there is no return table or exeptions to catch the errors . is there any way to over come the problem.
    I need to post the document and park the docuemnt.
    please suggest.
    Thanks & Regards
    Nags

  • MIRO invoice creation with the Personnel Number in account assignment

    I am using BAPI_INCOMINGINVOICE_CREATE for creating an Invoice using MIRO transaction.
    In MIRO transaction-> PO reference-> Multiple account assignment-> we have the personnel number: In BAPI table-parameter ACCOUNTINGDATA and ITEMDATA is used to populate the account assignmet data but this structure doesn't have the Personnel Number field (PERSON_NO).
    How can i create an Invoice with the Personnel Number in Account assignment, Is there any Userexit or BADI is available ?
    Thanks,
    Fract
    Edited by: fract_get on May 23, 2011 6:49 PM

    You can use EXTENSIONIN parameter from tables. There are BADI's related to this but don't know the name of badi. Please search forum for or use transaction code SE84 to search the BADI's/
    you can check the badi: INVOICE_UPDATE and method 'before_save or something similar to map to db table fields.
    See this thread to understand how extension parameters works.
    bapi_salesorder_simulate extension bape_vbap standard field
    Edited by: Sampath Kumar on May 23, 2011 11:28 AM

  • AR Invoice creation with BP Consolidation

    Hi,
    I have a number of deliveries.The customers for these deliveries have a consolidating BP.Now I want to create an AR Invoice from these deliveries to that consolidating BP.How this can be done by code?Can anybody give me a sample code?
    Deepesh

    Hi Deepesh,
    I haven't done this, but I guess you just have to create the invoice based on the delivery, using the fields BaseEntry, BaseType, BaseLine in the Documents_Lines object.
    Hope this helps,
    Ian

  • Form template with lines that shouldn't print are printing

    I have Windows 8.1 and Adobe Reader 11.0.09. I have had a template from my employer that we use to create address labels. There are lines for name, address, etc that are supposed to be invisible when printed, but that has not been the case the past few times I have printed.

    Ask the author of the file to double-check their work. There's nothing you can do about it yourself if you only have Adobe Reader.

  • Sales /Outgoing Excise Invoice number Range for J1IIN

    Dear Gurus,
    We are doing STO from excisable plant 1000 to plant 1100. We created a PO with document type UB ( STO) and created delivery with reference to PO and created billing document ( delivery challan). Against billing document number we created sales excise invoice in J1IIN for financial year starting from  1st April 2010. In J1I9 we have maintained number range for 2010 financial year in object J_1IEXCLOC for respective series group s1.Still when the outgoing excise created, the system continued last financial years number range. In entire flow from PO till MIGO and billing document and creation of excise invoice the input date is 6th of April i.e. current financial year. This is our first sales outgoing excise invoice creation in new financial year for which number range is maintained properly.
    My question is why system took last financial years number range even though the date in all the documents is falling in new financial year.
    Will appreciate the answer.
    Thanx in advance
    Regards
    Nilesh

    RESOLVED

  • Automatic excise invoice creation in STO scenario

    Hi All,
    This is related to stock transfer from Depot to manufacturing plant.
    I have done the replenishment delivery at Depot. Now my requirement is automatic excise invoice creation. For that i have done the required settings like excise and series group. I have checked the Creation EI option in exciser group also.
    PO(ME21n) --> VL10B --> VL02N --> VF01 (JEX) --> Automatic excise invoice once save the billing.
    Once  i sqve the billing, it has to create excise invoice at Depot. It is not happining.
    Please let me know if i have to do any more settings.
    Regards
    Lakshmikanth

    Dear Lakki,
    Please check, whether for Defined Excise Group:
    Path: SPRO --> IMG --> Logistics General --> Tax on Goods Movement --> India --> Basic Settings --> Maintain Excise Group
    Select your Excise Group and Mark the Boxes: Create EI, and Box: Depot EIs.
    Have you maintained relevant setings, like:
    --> Had you checked the Box: Excise Inv during Billing, under Tab: Outgoing Excise Invoice
    --> Relevant checks for Depot Settings, under Tab: Depot Settings
    Best Regards,
    Amit

  • Func module/bapi  for invoice creation

    Any function module for invoice creation WITH REFERENCE TO A SALEORDER. ??

    Hi,
    check this FM:GN_INVOICE_CREATE or BAPI: BAPI_BILLINGDOC_CREATEMULTIPLE
    check this link also.
    BAPI for creating sales invoice
    Regards
    Appana

Maybe you are looking for