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 ?

Similar Messages

  • 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

  • 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.

  • 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

  • Posting Header Freight to separate account with idoc INVOIC02

    Hi,
    I am using idoc type INVOIC02 to post a cross-company code invoice.  There is freight at the header level in the invoice and I want the freight amount to hit a different G/L account than the rest of the document. From the help documentation, it looks like I should be able to set the flag in T076S-KOKSEPA, and this should then take the amount in segment E1EDK05 and place it in a separate line item segment in the Idoc.  Once it's in its in a separate segment then I should be able to use settings in table T076I to direct it to a separate G/L account.  However, when I set this flag inT076S-KOKSEPA the system is not doing anything with the amount in the header segment..
    Does anyone have experience with this?  If I set the flag in T076S-KOKSEPA what should I expect to see at the item segment level? Should I get an additional E1EDP01 segment?  If not, what's the best way to get header freight to post to a separate account?
    Thanks,

    Hi,
    You need to add a record in T076I using OBCB transaction, fill EWLNR with the folllowing concatenated values from E1EDK05 :
    - E1EDK05-ALCKZ (the value is - or +)
    - E1EDK05-KSCHL
    In my case T076S-KOKSEPA doesn't work, I got an accounting item corresponding to header condition but no more accounting lines corresponding to invoice items...
    But it works fine using T076S-KOPSEPA to post conditions at item level.
    Your questions :
    - Does anyone have experience with this ?  > We are still waiting ...
    - If I set the flag in T076S-KOKSEPA what should I expect to see at the item segment level ? > Nothing, this parameter works later, when the idoc is processed to create the accounting data (function IDOC_INPUT_INVOIC_FI not function IDOC_OUTPUT_INVOIC_IV_MM)
    - Should I get an additional E1EDP01 segment ?  > No
    - If not, what's the best way to get header freight to post to a separate account ? > It is the best way, but you can try at item level (T076S-KOPSEPA), in my case it works immediatly.
    My question :
    When the flag is set at header level (set the flag in T076S-KOKSEPA), an accounting item is created for the header condition, but how this value is allowed (- or +) on the other accounting items ?

  • Duplicate Invoice PROBLEM with IDOC

    Edited by: Go on Jan 23, 2008 6:28 AM
    Edited by: Sara Go on Jan 27, 2008 10:04 PM

    Hi,
    Please be informed Duplicate invoice check is a "pure online
    functionality".
    Duplicate invoice check is not intended for use with automatic
    transactions such as the use of the IDoc's or BAPI  ; it is meant to prevent a user from inadvertently keying in the same invoice twice.
    This is why it is not used by the BAPI or IDoc. There are no plans to change this functionality in the standard system.
    Please assign points if it useful.
    Regards
    Ravinagh Boni

  • 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

  • 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

  • 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

  • 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*********

  • 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

  • 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

  • BAPI or RFC to simulate an FI invoice creation

    Hi,
    I need to develop an RFC or BAPI that acts as the SIMULATE function of the transaction FB01 (invoice creation).
    Could you recommend any tips (es. standard BAPI, Function Modules, etc.) ?
    Thank you very much in advance.
    Best Regards.
    Mauro

    I thank you very much for your tips.
    Unfortunately, recommended standard BAPIs are not suitable for me.
    I need something to be called from remote/RFC that returns the "structure" displayed on the screen when you select the SIMULATE option of the FB01 transaction.
    I tried with a Batch Recording, but I do not find in which data structure the system put the data (it seems that the Module Pool displays the data on the screen and then delete the data structure, without returning it to the batch recording).
    I thank you very much.
    Mauro

  • Vendor Invoice creation through EDI (Transaction MIRO)

    Dear All,
    We want to implement Vendor Invoice creation thro EDI .(Transaction
    MIRO)
    We are not finding any suitable EDI Function Module in SAP which
    would take care of more than 20 items and run a MIRO or any
    equivalent transaction .
    Can any one please advise if any Function module exists ? We need it for
    Invoice creation with GR reference as well as without GR reference .
    Thanks
    Sanjay.

    Thanks Naren,
    I will come back after checking the fn module.
    - Sanjay

  • 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

  • Error in MSS: Area MSS_HCM_AREA_RELATEDACTIVITY does not exist

    Hello Experts, We are currently looking at implementing simple MSS functionality to display PA data. We are interested in using the "General Information" iView with enabled "Related Activities." Currently we have basic ESS functionality implemented,

  • SSL Port closed ?

    Hi guys... do you know why the port 993 is stil closed after changing the configuration to listening IMAPs on my messaging server ? i did the following changes /opt/sun/comms/messaging/lib/configutil -o service.imap.enablesslport -v yes /opt/sun/comm

  • How to use my warranty without purchase receipt?

    Hi, I know this was a really dumb thing to let happen, but I don't have my purchase receipt for my 17" MBP. Nothing bad's happened to it yet, but I've read that I can't use my warranty without it. I've registered the laptop with Apple, and checking t

  • Image Breakup when using crop tool

    At recent events, operating aperture on a 17" MacBookPro with an extra 23" Apple display, I have image break up after using the crop tool. The image breaks up into quarters, with variable green colours, the image itself disappearing altogether. This

  • HT4972 my phone went frozen mode after trying to upgrade for iOS

    My iphone went wird when i was trying to upgrade for iOS. It doesn't turn on or off and it doesn't do anything else besides flashing the apple logo on and off continuaslly. What can I do to fix this?