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

Similar Messages

  • BAPI for Vendor Non-PO Invoice processed through MIR7 Transaction

    Hi All,
    I have a requirement where i will get data from flat file. Using this data Vendor Non-PO Invoice
    will be processed through MIR7 transaction with Multiple line items - Invoice Upload Parking the document for vendor non-po invoices.
    The data is in below format in flat file:
    Header fields in 1st line
    Dr. Key related fields in 2nd line
    Cr. Key related fields in 3rd line
    Header fields in 4th line
    Dr. Key related fields in 5th line
    Cr. Key related fields in 6th line
    etc .... in flat file
    In these main fields coming in from flat file are: comp.code, doc.type, vendor no,
    Debit/Credit indicatorSHKZG, G/L a/c no, inv/post dates etc..
    My issues:
    1. I am planning to use F.M BAPI_INCOMINGINVOICE_PARK is it the correct F.M!
    But Here PO number seems to be mandatory for this F.M but it is not available as per our flat file,
    if so can anybody suggest a BAPI for Vendor Non-PO Invoice parking for MIR7 transaction!
    2. What are the parameters need to be used for from above flat file data especially for 2 line itemshttp://Dr./Cr. data other than header data. So as per Header & 2 Line items http://Dr. & Cr. Data which parameters will be updated with which data in above flat file! can anybody clarify!
    3. Also in flat file WorkflowNo is available in which parameter this fields will need to be filled & also by doing this will it trigger workflow automatically!
    Can anybody clarify about above points!
    Thanks in advance.
    Thanks,
    Deep.

    Hello Deep,
    I know it might be quite late for you for this answer, nevertheless I will write that, because there are lots of question like yours. bapi_incominginvoice_park is also a suitable bapi for you. All you need to do is call it this way:
    data: headerdata like bapi_incinv_create_header value is initial,
            table_item type table of bapi_incinv_create_item,
            gl_account like bapi_incinv_create_gl_account,
            table_gl type table of bapi_incinv_create_gl_account.
    * fill headerdata and table_gl, leaving table_item empty
    CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
        EXPORTING
          HEADERDATA                = HEADERDATA
    *   ADDRESSDATA               =
        IMPORTING
          INVOICEDOCNUMBER          = lv_docnr
          FISCALYEAR                = lv_year
        TABLES
          ITEMDATA                  = table_item
    *      ACCOUNTINGDATA            = table_acc
          GLACCOUNTDATA             = table_gl
    *   MATERIALDATA              =
    *      TAXDATA                   = table_tax
    *   WITHTAXDATA               =
    *   VENDORITEMSPLITDATA       =
          RETURN                    = lt_return.
    This works perfectly for me, creating a mir7 document without refering to a PO. The trick here is to fulfill the glaccountingdata importing table while leaving itemdata empty.

  • Bapi for vendor non po invoice parking

    Hello,
    We have a requirement to Create a Non PO Invoice and also parking invoice.
    I could able to create Vendor Invoice (Non PO) using BAPI: BAPI_ACC_DOCUMENT_POST.
    But i am unable to find a BAPI for Parking the Vendor Invoice (Non PO). When i try to use BDC on FB01 transaction for creating Parking Vendor Invoice, it is throwing an error that "Parking Invoice creation is not allowed in batch input".
    Can anybody help me for creating Parking Invoice (Non PO).
    Note: There is a BAPI: BAPI_INCOMINGINVOICE_PARK, which wont support for Non PO Invoice creation. It is PO based.
    Thanks in Advance for your support.
    Thanks & Regards,
    Sreedhar.

    Hi,
    Please see the given link, hope It will help you.
    Re: BAPI to Park the Invoice Document
    Regards,
    Shamma

  • Function Module/BAPI for posting of Parked Invoice/Documnet

    Dear all,
    Please provide me.
    Function Module/BAPI for posting of Parked Invoice/Documnet
    Regards
    Ricky

    Hi Ricky,
    What about MR_POST_PP_INVOICE?
    In my current project, though, we had to develop a function module for this.
    Regards,
    Eli

  • 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

  • BAPI for J1IJ depot excise invoice required

    Hi All,
    Please let me know the BAPI to create depot excise invoice with J1IJ from a delivery.This require to automate the process.
    Please let me know the parameters also.
    Thanks'
    Mukul Kumar

    Hi Mukul,
    CIN does not support any BAPIs for goods receipts and excise updates.
    However, CIN uses MB_MIGO_BADI definition and CIN_PLUG_IN_TO_MIGO implementation. You can create multiple implementations of this BAdI. You can use the same BAdI for single step capture and post of excise invoice in MIGO.
    Regards,
    Rajasree..

  • Check for Duplication of Incoming Invoice Entry - strict rule

    Hello,
    busines people require very stricly rules for duplication check of incoming invoice (MM). Standard customizing makes it possible to check according:
    Reference document number -customized
    Invoice date -customized
    Gross invoice amount -mandatory
    Currency -mandatory
    Vendor -mandatory
    Company code -customized
    But i need to compare only company code and vendor. This is more strict rule what i cannot customized. I think i must use user-exit (badi) for that?
    Do you have any idea?
    Thank, zd.

    MBCF0002
    this can be the user exit but u can check with the abap
    and ask him to code for u to check delivery number per vendor
    But if u put this condition in miog and check MKPF and MSEG table then ur system performance will go down in long run as this table are big sap tables
    so u can think of creating a ztable so that in user exit u can code so that vendor delivery number and year will be stored after saving the migo
    and in other user exit which will triger first than this will check in this ztable
    this will increase the performance
    Reward if useful

  • BAPI for  FB60 park vendor invoice

    Hi SAP Gurus,
    Please let me know what is the BAPI for Park Vendor invoice in FB60.
    Thanks in advance
    Vinod
    Edited by: Vinod Malagi on Dec 9, 2008 7:21 AM
    Message was edited by: Jürgen L.

    Hi Preethi,
    I ahev checked this BApi this is for With PO and i need for without refernce to PO.
    only Vendor number, GL account numbers, amount, date and other details.
    Please suggest.
    Thanks in advance
    Vinod

  • BAPI for parking an FI invoice

    My dear savior,
    How shall I go about parking an FI invoice over BAPI. I've read around that there is no such BAPI. I just can't believe that.
    How shall one enter an FI invoice from an external system into the SAP R/3? Posting the invoice seems like a bad idea as it will not allow for necessary approvals/validations. Or am I mistaking here?
    There must be a way, and I can only hope some of you will find some time to give me a direction.

    You could take a look at the message type invoic and the corresponding processing code (INVF) which triggers the function module IDOC_INPUT_INVOIC_FI. From there on, you should find the desired functionality.
    Kind regards and good luck,
    D. Krijger

  • Bapi for FB60 - Park an invoice

    Hi gurus,
    Im trying to park an invoice in transaction FB60. i allready tried an batch inout but it's giving me an error, that i can't park an invoice using a batch input in transaction FB60... Don't know why, if someone can explain me why i cant park using an batch input i'll be appreciated..
    Anyway , is it any bapi that i can use to park an invoice to transaction FB60??
    Thanks in advance,
    Best Regards

    I worked with the FV60 transaction and able to park the invoice successfully by batch input method. I am pasting the sample code. Try with the below code::
    Populating the Header Details
      PERFORM bdc_dynpro   USING 'SAPMF05A'  '1100'.
      PERFORM bdc_field  USING 'BDC_OKCODE'  '/ECCDE'.
      PERFORM bdc_field   USING 'INVFO-ACCNT'  pv_vendor.
      MOVE pv_invoice_date TO lw_date.
      WRITE lw_date TO lw_fdate.
      PERFORM bdc_field  USING 'INVFO-BLDAT'  lw_fdate.
      PERFORM bdc_field  USING 'INVFO-XBLNR'  vendor_invoice.
      IF pr_posting_date IS INITIAL.
        MOVE sy-datum TO pr_posting_date.
      ENDIF.                           
      CLEAR: lw_date, lw_fdate.
      MOVE pr_posting_date TO lw_date.
      WRITE lw_date TO lw_fdate.
      PERFORM bdc_field USING 'INVFO-BUDAT'  lw_fdate.
      PERFORM bdc_field USING 'INVFO-SGTXT'   pv_text.
      PERFORM bdc_dynpro  USING 'SAPLACHD'  '1000'.
      PERFORM bdc_field  USING 'BDC_OKCODE'  '=ENTR'.
      PERFORM bdc_field  USING 'BKPF-BUKRS'  pv_bukrs.
    Populating the Item Details
      LOOP AT pr_item_details INTO fs_item_details.
        IF sy-tabix NE 1.
          PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
          PERFORM bdc_field  USING 'BDC_OKCODE'  '=0005'.
          PERFORM bdc_field  USING 'ACGL_ITEM-MARKSP(01)'  'X'.
        ENDIF.                             " If sy-tabix...
        PERFORM bdc_dynpro   USING 'SAPMF05A'   '1100'.
        PERFORM bdc_field  USING 'BDC_OKCODE'  '/00'.
        PERFORM bdc_field  USING 'ACGL_ITEM-HKONT(01)'
                                              fs_item_details-expense.
        PERFORM bdc_field  USING 'ACGL_ITEM-WRBTR(01)'   lw_amount.
          PERFORM bdc_field  USING 'ACGL_ITEM-MWSKZ(01)'   pv_tax.
        PERFORM bdc_field    USING 'ACGL_ITEM-KOSTL(01)'   pv_costcenter.
        PERFORM bdc_field    USING 'ACGL_ITEM-SGTXT(01)'
                                              fs_item_details-item_text.
        lw_totamount = lw_totamount + lw_amount.
      ENDLOOP.                          
      lw_totamount = lw_totamount + lw_taxamount.
      PERFORM bdc_dynpro USING 'SAPMF05A'  '1100'.
      PERFORM bdc_field  USING 'BDC_OKCODE'  '=PBBP'.
      PERFORM bdc_field  USING 'INVFO-WRBTR'         lw_totamount.
      PERFORM bdc_field USING 'INVFO-WMWST'         lw_taxamount.
      CALL TRANSACTION 'FV60' USING    t_bdc_data
                              MODE     lw_mode
                              UPDATE   c_update
                              MESSAGES INTO t_bdcmsgcoll.
    **ignore the variable used
    Regards,
    Kiran Bobbala

  • BAPI for attaching Parnter to a Vendor

    Hi,
      Is there a BAPI which can be used to assign a partner to a vendor ?
    what is the usual procedure followed to assign Partner to a Vendor ?
    this is an urgent requirement.... Please help me in this regard. I will certainly not forget to grant points for the appropriate answers.
    Regards,
    Vara

    Partner functions are assigned in vendor master through XK01,XK02 or MK01, MK02.
    Sai

  • UCM for attaching files against Invoices, Purchase Orders.

    I am looking at implementing Univ Content Mgment in our J2ee Ordering Application. Currently we are implementing file attachments on a particular Sales Invoice transaction by uploading a file on a separate file server, and saving the url of that file on the Invoice TABLE.
    my question about, since UCM has the Oracle DB as its repository, how can I link a specific file to my Invoice TABLE. How do i relate an Invoice to the image or images i have uploaded?
    Is it an overkill if I use UCM just for this use case?
    regards,
    Anton

    There are several add on components for relating files together including one that ships with content server, Related Content. IF your database is Oracle 11g then you might be interested in Secure Files, which allows you to store the actual file IN the database (good/bad nobody knows yet without more info on your requirements). You could store the content id in your database as a pointer to the file in stellent.

  • Avoid posting mm-incoming invoice with when special account is used

    Hi,
    during the creation of the (parked) incoming invoice we use a dummy account that needs to be changed later. For our process it is not simply done by customize the account in the way that posting is not allowed.
    Therefore I am searching a possibilty to reject the posting of an mm incoming invoice if one special account is used. For the FI-incoming invoices I solved the problem with validation rules (User exits to avoid posting of invoices)
    But how can I do this with the mm invoices? Is it extension LMR1M005 or LMR1M004? (Didn't get it with them because I don't know how a "posting" switch should look like in the coding)
    Regards, Vanessa

    Hi,
    Your PO created for real  vendor/account and Why you parked incoming invoice to a dummy account ?
    Purchase order considered as committed document by business and you are doing invoice verification( parking and posting) WRT purchase order for a vendor and respective accounting documents are created during goods receipt  and invoice verification-why you want to post to dummy account/vendor!
    Instead of development , you can try with following:
    1.Create Main Vendor (A)in t.code:XK01
    2.Go for creating a new vendor master(B) for dummy vendor in XK01 , keep alternate payee as main vendor(A) as Alternat.payee field in Payment transaction view and keep partner function as Invoicing Party(PI) only in  Partner function view.
    3. Assign this dummy vendor code(B) in Main vendor(A) in t.code:XK02  with partner function of Invoicing Party in Partner function view.
    4.Now create PO for Main vendor(A)
    5.Do invoice verification for PO, your invoice posted to dummy vendor code(B)
    6.Do payment for PO where you will pay for vendor code (A)
    Also you can think following options:
    Better create assign a blocking key in field of Payment block in Payment transaction view of your vendor master and after invoice verification, the invoice document created will be blocked for vendor.Later you can release the invoice with MRBR t.code or FB02 t.code.
    OR
    You can use tolerance limit as ZERO for tolerance keys for invoice verification for your company code. Create PO for vendor and after invoice verification for PO, the invoice document created will be blocked for vendor.Later you can release the invoice with t.codes MRBR  or FB02.
    Regards,
    Biju K

  • BAPI For Parking FI Document

    Dear All
    Is there any BAPI or Function Module available for parking the document in FI.
    regards
    Amit Hiremath

    Hi Armit,
    have a look to this thread:
    Re: BAPI for Parking non-PO Invoices?
    regards Andreas

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

Maybe you are looking for