Archiving incoming invoice via BAPI

I have a scenario were we receive incoming invoice as a formatted text-file with a corresponding pdf image of the invoice. The concept is to first create an archived document reference of the PDF (via a BAPI call) and then send the archive-doc-id with the INVOIC01 Idoc and link these so that the PDF appears as an attachment in the MM invoice in transaction MIR4. The middleware used is MS BizTalk.
The problem is that the BAPI seems to require a dialog user to post the PDF, and returns the message "RFC partner does not allow to start any program" (CMS057).
Does anyone have experience with this?
The BAPI coding:
function z_bapi_archivobject_createfile .
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_ARCHIV_ID) TYPE  BAPITOAV0-ARCHIV_ID
*"     VALUE(I_DOCUMENT_TYPE) TYPE  BAPIARCPAR-DOC_TYPE
*"     VALUE(I_FILEPATH) TYPE  SAPB-SAPPFAD
*"  EXPORTING
*"     VALUE(E_ARCHIV_DOC_ID) TYPE  TOAV0-ARC_DOC_ID
*"     VALUE(E_BAPIRETURN) TYPE  BAPIRET2
  call function 'ARCHIVOBJECT_CREATE_FILE'
    exporting
      archiv_id                = i_archiv_id
      document_type            = i_document_type
      path                     = i_filepath
    importing
      archiv_doc_id            = e_archiv_doc_id
    exceptions
      error_archiv             = 1
      error_communicationtable = 2
      error_upload             = 3
      error_kernel             = 4
      others                   = 99.
  if sy-subrc <> 0.
    call function 'BALW_BAPIRETURN_GET2'
      exporting
        type   = sy-msgty
        cl     = sy-msgid
        number = sy-msgno
        par1   = sy-msgv1
        par2   = sy-msgv2
        par3   = sy-msgv3
        par4   = sy-msgv4
      importing
        return = e_bapireturn.
  endif.
endfunction.

Hi,
You can  check whether the invoice has been processed via FM. IDOC_INPUT_BBP_IV in R3 system.
If the invoice has been processed via FM IDOC_INPUT_BBP_IV, then you can check which user-exits can be used for duplicate invoice check within FG BBPI.
In standard BAPI processes system can't support the functionality for
duplicate invoice check. Thanking you

Similar Messages

  • ERS Invoices via BAPI

    When a Purchase Order is marked as ERS relevant (self billing or self invoice), is it possible to post the incoming invoice using BAPI_INCOMINGINVOICE_CREATE? If so, how.
    I notice when I post an invoice with the BAPI on such a PO document, an invoice is created but the ERS relevant table EKRS is not updated. This means the system stil thinks the purchase order was not invoiced, because when I run tcode MRRL, another invoice is posted by the standard application on the PO document.

    Thank you.
    But I could not understand the note fully.
    It says PLN_PCKG and PLN_LINE of ENTRYSHEET SERVICES should correspond exactly to ESLL-PACKNO and ESLL-INTROW
    But ESLL-PACKNOand ESLL-INTROW will be created after service entry creation.
    1.Which number I should put in PLN_PCKG and PLN_LINe of ENTRYSHEET SERVICES?
    2. Also suppose XI got 10 for creating different service entries in one file.
    Now for each entry if PCKG_NO in ENTRYSHEETSERVICES is 1and SUBPCKG_NO is 2 ,then wil it create any problem?
    Means for 10 entries should I need to give PCKG_NO 1, 2,3 etc
    Please advice.

  • Enter / Park Incoming Invoice before GR

    Gurus,
    The requirement is to be able to enter line items and park the incoming invoice (via EDI / MIRO / MIR7) before GR is done.
    The PO has the GR based IV tick checked and removing it is not an option.
    Please suggest possible options to enter the invoice lines so that the invoice can be parked.
    Regards
    Saurabh

    Hi,
    Try converting message 088 to warning in MM>LIV>Attribute of sys messages
    Please check i could not check it
    Thanks
    Diwakar

  • BAPI for attachment to incoming invoice

    Hello,
    I am creating documents for incoming invoices with an RFC that uses BAPI_INCOMINGINVOICE_CREATE. I also want to attach an external file to the document created. Is it possible to achieve this with a BAPI or an fm?
    Thanks in advance,
    Ali

    Hi,
    I am giving a brief about the flow you should follow.
    PERFORM file_upload USING p_file.  (This is the perform in which you will upload your file with the business object of the document, document key, archiv type, the local path of attachment etc...)
      PERFORM validate_file.   ( This is to validate your entries from the file)
      PERFORM bo_existence_check. (This is to check the the existence check of the business object and document key in the system)
    LOOP AT gt_upload_file INTO gs_upload_file.  (This is looping through the file for each entry i.e. each document)
          PERFORM upload_attachment. ( This is to upload scanned attachment to optical archiv drive)
    Use FM SCMS_AO_FILE_PUT_FE for uploading the file
           PERFORM link_archiv.  (This is to link the uploaded document in archiv drive with the document in SAP system)
    USE FM ARCHIV_CONNECTIONTABLE_INSERT  for linking the document and attachment.
    ENDLOOP.
    Let me know if you find it useful.
    Thanks and Regards,
    Kiran Mohan

  • Error in BAPI while creating incoming invoice

    Hi Experts,
    Im creating incoming invoice by using the BAPI,  'BAPI_INCOMINGINVOICE_CREATE'.
    when im going to posting my invoice it is showing the error like 'EDI: Error in customizing for differential invoicing'.it is a urgent requirement and need to solve this ASAP.Pls help me out with this error
    Im passing following parameters to BAPI:
    wa_header-invoice_ind = 'X'.
    wa_header-doc_date   =  sy-datum.   "Enter the document date
    wa_header-pstng_date = sy-datum .   "Enter the posting date
    * wa_header-ref_doc_no = '5000008590'.
    wa_header-comp_code = '1000'.
    *wa_header-gross_amount = '50.11'.  "Enter the gross amount(aft. tax) for the invoice
    *wa_header-calc_tax_ind = 'X'.
      wa_header-currency = 'INR'.
      wa_header-INV_TRAN = 'X'.
      wa_header-SIMULATION = 'X'.
    wa_item-invoice_doc_item = '000001'.
    wa_item-po_number = '3700000557'.    "Enter the PO number
    wa_item-po_item = '00010'.           "Enter the PO item number
    * wa_item-ref_doc = '5000008590'.      "Enter the GR number
    * wa_item-ref_doc_year = '2014'.       "Enter the GR fiscal year
    * wa_item-ref_doc_it = '0001'.         "Enter the GR item number
    * wa_item-tax_code = 'V0'.             "Enter the tax code applicable
    wa_item-item_amount = '50.60'.     "Enter the item amount
    * wa_item-quantity = '2380'.           "Enter the invoice quantity
    * wa_item-po_unit = 'EA'.              "Enter the UoM
    APPEND wa_item TO it_item.
    CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
       EXPORTING
         headerdata                = wa_header
    * *   ADDRESSDATA               =
      IMPORTING
        invoicedocnumber          = g_invno
        fiscalyear                = g_fyear
       TABLES
         itemdata                  = it_item
    * *   ACCOUNTINGDATA            =
    * *   GLACCOUNTDATA             =
    * *   MATERIALDATA              =
    * *   TAXDATA                   =
    * *   WITHTAXDATA               =
    * *   VENDORITEMSPLITDATA       =
         return                    = it_ret
    * *   EXTENSIONIN               =
    IF g_invno IS NOT INITIAL.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          = 'X'
    * *   IMPORTING
    * *     RETURN        =

    Thanks every one for your valuable solutions.
    Issue is Solved by unchecking the flag.
    wa_header-INV_TRAN = 'X'.
    Thanks & Regards,
    Ramjee.

  • BAPI for MIRO Incoming Invoice

    Hi All,
    I want BAPI for MIRO Posting ie for Incoming Invoice.
    .here MIRO is being done with Delivery Note number
    Following are the necessary entries for MIRO Posting
    Invoice date
    Reference
    Amount
    Calculate Tax
    Tax amount
    Delivery Note
    Vednor
    Business Area
    Please suggest me suitable BAPI for MIRO Incoming Invoice Posting with sample code.
    immediately.Please give some sample code for my reference.
    Rewards will be given.
    Regards.
    Ulhas

    Hi,
    BAPI for Invoice Verification: Post Invoice
    BAPI_INCOMINGINVOICE_CREATE
    The method can only carry out your function if no error messages were
    generated in the Return table. This is the case if the header data and
    all the items were processed successfully.
    Transaction control is not implemented. The calling program therefore
    has to execute the Commit Work itself after this method has been
    successfully called (in other words, if no errors were reported in the
    Return parameter).

  • Bapi to save as completed an incoming invoice

    Hi,
    is there a bapi allowing to create an incoming invoice an saving it as completed?.
    i don´t  need to park it.
    i´d like to save the document as completed.
    (i did try with BAPI_INCOMINGINVOICE_PARK but what i got was a parked document and what i need is a document saved as completed).
    it is as if you cliked "Saved as completed" button of transaction MIR7.
    Best regards.

    To all people interested this is how i solved the question:
    CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
      EXPORTING
        headerdata       = x_in_header
      IMPORTING
        invoicedocnumber = lc_belnr
        fiscalyear       = lc_gjahr
      TABLES
        itemdata         = i_in_item
        return           = i_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
      CALL FUNCTION 'MRM_INVOICE_READ'
        EXPORTING
          i_belnr = lc_belnr
          i_gjahr = lc_gjahr
        IMPORTING
          e_rbkpv = s_rbkpv
        TABLES
          t_drseg = tab_drseg
          t_rbselbest = l_t_selbest
          t_rbsellifs = l_t_sellifs
          t_rbselfrbr = l_t_selfrbr
          t_rbselwerk = l_t_selwerk
          t_rbselerfb = l_t_selerfb.
    PERFORM drseg_complete(SAPLMR1M) USING     s_rbkpv
                                                'V'
                                                space
                                      CHANGING  tab_drseg[].
    * As the next routine checks ok-code not initial i have to
    * pass a value to the ok-code
    DATA: c_okqu(17)   TYPE c VALUE '(SAPLMR1M)OK-CODE'.
    FIELD-SYMBOLS: <fs_okqu> TYPE ANY.
    ASSIGN (c_okqu) TO <fs_okqu>.
    <fs_okqu> = 'COMP'.
    DATA: ok-code(20).
    DATA:      l_trtyp     LIKE t169-trtyp value 'V'.
    CONSTANTS: l_okcode    LIKE  ok-code VALUE 'COMP'.
    PERFORM document_park(SAPLMR1M) USING s_rbkpv
                                 tab_drseg[]
                                 l_t_selbest[]
                                 l_t_selfrbr[]
                                 l_t_sellifs[]
                                 l_t_selwerk[]
                                 l_t_selerfb[]
                                 l_trtyp          "akt_typ
                                 l_okcode.       "fcocomp.
    Note that the key here was the two routines drseg_complete and document_park
    Best regards.
    Edited by: pablo casamayor on Apr 24, 2008 8:27 AM
    Edited by: pablo casamayor on Apr 24, 2008 8:29 AM

  • Can We enter Sales Invoice and Incoming Payment VIA SDK

    Dear Experts
    We have to develop an integration bridge with retrieve data from excel sheet and upload in SAP , i want to clear is it possible to enter sales invoices and incoming payment via SDK?. If it is possible please guide me about objects name and any reading material for SDK development.
    Thanks

    Hello,
    Yes it is possible with 2 steps:
    1. you post the invoice
    2. you post the payment
    I have already posted into the forum several examples, you may check them:
    For invoice + payment
    for payment only:
    Regards
    János

  • Incoming invoice post via INVOIC01 (IDOC_INPUT_INVOIC_MRM)

    Dear all,
    We are trying to post an incoming supplier invoice against a PO via IDOC INVOIC01 (IDOC_INPUT_INVOIC_MRM).
    We were able to identify all technically required fields to post the invoice.
    However, we have some difficulties:
    1). How can we enrich the text field which is in the header of the MM invoice ? (transaction MIR4, tab Basic data, field "text")
    2). In the FI document (BSEG/BKPF table; FI document that can be viewed through transaction FB03), there are fields like XREF1, XREF2 and XREF3, is there any possibility to have these fields filled through the IDOC?
    Many thanks in advance!
    Best regards

    Option #1 is to use INVOIC01.  The configuration for INVOIC01 is present in the standard system for MM invoices through ECC 6.0. 
    Option #2 is to add the ALE config to allow use of INVOIC02 with IDOC_INPUT_INVOIC_MRM.  We have just done this ourselves because we want to use the same IDoc for both our FI and MM invoices, and it seems to be working OK thus far.  The configuration to use INVOIC02 for MM invoices is not in the default system up through ECC 6.0.
    To do option #2, call transaction WE57 - "IDoc: Assigment of Function Module to Logical Message and IDoc Type"
    You will need authorizations to assign a package to this -- it is transportable config.
    Function module: IDOC_INPUT_INVOIC_MRM
    Function type: Function module
    Basic type: INVOIC02
    Message Type: INVOIC
    Message Variant: MM
    Object Type: BUS2081
    Direction: Inbound
    Description: Invoice/Billing Document
    Name: Incoming Invoice
    (This is a copy of the default config for INVOIC01, changing the IDoc type to INVOIC02.)
    Save, assign to the appropriate package for transport.  This configuration is cross-client, so do it once in your development client and it's active in all clients on that instance.
    And that's it!  Do everything else the same as you would with INVOIC01.  (Just keep in mind that not all of the segments you use for FI invoices work exactly the same way in MM invoices -- some of the segment qualifiers are different despite trying to define the same business fields...)
    --Dan King
    SAP NetWeaver Integration Architect
    Capgemini

  • Bapi incoming invoice

    Hi,
    Invoice verification bapi BAPI_INCOMINGINVOICE_CREATE is not checking duplicates,Also MRM_DUPLICATE_INVOICE_CHECK fm
    throws the error message straight away.As i am calling this bapi to upload a batch of invoices and i want duplicate error message to be collected.Also what is the best place to call duplicate check ??
    Regards,
    Tess

    Hi,
    You can  check whether the invoice has been processed via FM. IDOC_INPUT_BBP_IV in R3 system.
    If the invoice has been processed via FM IDOC_INPUT_BBP_IV, then you can check which user-exits can be used for duplicate invoice check within FG BBPI.
    In standard BAPI processes system can't support the functionality for
    duplicate invoice check. Thanking you

  • DMS document attachment with Incoming Invoice

    Hi All,
    We are creating one DMS document and want to attach it to an Incoming Invoice (MIRO).
    We are using the bapi BAPI_DOCUMENT_CREATE.  What are the fields to pass in Objectlink.
    Please help us to achieving it.
    Thanks

    We have created an Incoming Invoice already using 'BAPI_INCOMINGINVOICE_CREATE'. We are now creating a DMS document using 'BAPI_DOCUMENT_CREATE' and want it to be linked to the existing Invoice. For this we are trying to use the 'OBJECTLINKS' table.
    The linked document should be visible in T-Code FBL1N. Can you please throw some light on how to do this?
    Edited by: Himansu.P on Jun 14, 2011 3:06 PM

  • Incoming invoice from third party system

    Hi All,
    Could you please help in choosing functional module or bapi or badi's for incoming invoices that are receiving from third party system. I have no ideal about that but the SAP has to be loaded using idocs. what is the reason to choose the above ones
    Thanks in advance for response.

    Why not starting with docu?
    The general process  is explained well in help.sap.com
    As a service, put this into your Google: vendor invoice edi site:help.sap.com

  • How to import Incoming Payments via DTW

    Hello all,
    I am importing opening balances for Customers via DTW.  My client wants to import all the open Invoices at their original amount, and then import the incoming payments against them to have them net out to the correct remaining balance.  I already know how to import the invoices.  I'm looking at using the PaymentDrafts template in DTW for the Incoming payments but I could use some guidance.  Can anyone provide and example of the data required to both import the incoming payments and apply them to the appropriate AR Invoice?
    Thanks,
    don shields

    hi donald,
    Check this link to resolve ur doubts.
    Import Incoming Payments with DTW
    Import Incoming Payments with DTW
    also check this SAP Note
    Note 1162513 - How to link an Incoming Payment to an Invoice via the DTW
    Jeyakanthan
    Edited by: Jeyakanthan A on Apr 30, 2009 10:31 PM

  • Tax Jurisdiction code for EDI Incoming invoice

    Hi,
    We have implemented EDI incoming invoice using INVOIC02. The process code is INVL.The invoice is to be posted against a Purchase Order line item. It is noticed that the EDI invoice is not getting the Tax Jurisdiction code from the Purchase Order line . Instead the Tax Juridiction code is copied from the company code. However when we post the invoice manually using MIRO , then the Tax Juridiction code is copied from the Purchase Order. We understand that the system should take the Tax Jurisdiction code from the Purchase Order even for EDI invoices. Is it compulsory that we have to use the user exit EXIT_SAPLMRMH_014 in order to populate the Tax Jurisdiction code field TXJCD from the Purchase Order line? or is there any config required to enable the transfer of Tax Juridication code from the Purchase Order? In transaction OBCE there is a config to transfer the tax jurisdiction code supplied by the external vendor. If we do not check that box , then system is supposed to get the tax jurisdiction code from the Purchase Order.
    Thanks
    Sukumar

    The issue is resolved through OSS Note 506343. In the standard R/3 system, the tax jurisdiction code can't be written to invoice via EDI and only the Ship To Plant's Tax Jurisdiction Code is written to the invoice.
    Regards
    Sukumar

  • Posting a previously parked incoming invoice

    Hi all,
    Can anybody help me with the following scenario:
    I am parking incoming invoice document using BAPI_INCOMINGINVOICE_PARK. It gives me a document no.
    Later I want to post this document. I don't know which BAPI or fm to use for this. Is it possible to post parked documents with BAPI_INCOMINGINVOICE_CREATE?
    Thanks
    Ali
    Edited by: Ali Abbasgil on Aug 4, 2010 12:59 PM

    Hi ,
    invoice_change facilitates your requirement...
    But there are certain constriants as of the following points:
    pls see if these points help.
    1.It is not possible to change invoice documents flagged for invoice verification in the background using this method.
    2.Furthermore, no invoice documents saved within the framework of the EDI process can be changed with this method.
    regards,
    umakanth..

Maybe you are looking for

  • Where are the docking headers in Premiere Elements 13?

    I've just purchased Adobe Premiere Elements 13.  I'm using a dual monitor arrangement on my three-year old iMac. In earlier versions of Premiere Elements it was possible, using docking headers, to arrange screen components and windows to my own prefe

  • Spry is undefined, sp2 is null or not an object error in IE

    Hi everyone, I have a problem working with Spry Sliding panels. It is working fine in chrome, safari. But it is not working in IE and FF I am on IE8 and FF3 I also upgraded to the latest version of Spry i.e Spry 1.6.1 The website is in development. H

  • Mac Mini with Major Problems

    I'll try to make this short, but it is a looonngg problem. About one month ago my Mac Mini began having problems when I boot up.  The computer would freeze on the opening page where I put in my password.  My wireless keyboard and trackpad would not w

  • Trouble reading 2 files on server

    I have the code written to upload a file to the server. I want to be able to upload 2 files to the server with the same socket connection. Any ideas how to do this? Also when i upload the file it doesn't always send the whole file. Any ideas why this

  • Dimension out of synch with relational table

    Hi Gurus, We have an issue of Dimension Loading in OWB10grel2. My Dimension DPROD Details are as below.. Storage :star SCD type:1 Levels : Lev1,2,3...15 with each level having ID,CD,DESCR as level attributes. Hierarchy: prodlev1,prodlev2....prodkey A