Function for Adding  Attachment to invoice post.

I have a report to read txt files, and post vendor or customer invoice documents with BAPI_ACC_DOCUMENT_POST.
now with the txt file i have a pdf file to attach .
how can i do that? 
thanks ,
pd.: sorry my english.

Hi,
Don´t know if this is what you want..but i had put some attachments using this code...
data: d_file type RLGRAP-FILENAME,
      d_objkey type borident-objkey.
select single URL from /cockpit/tmime into d_file
  where invoice_guid = E_STR_HEADER-invoice_guid.
CONCATENATE
E_STR_HEADER-SAP_DOC_NO
E_STR_HEADER-FISCAL_YEAR
into d_objkey.
CONDENSE d_objkey.
submit ZSEND_IMAGE
with f_filena = d_file
with d_objkey = d_objkey
and RETURN.
and
    IF wa_thdr-fi_mm_flg EQ 'FI'.
      ls_object-objtype = 'BKPF'.
      CONCATENATE wa_thdr-comp_code  wa_thdr-sap_doc_no INTO ls_object-objkey SEPARATED BY space.
    ELSEIF wa_thdr-fi_mm_flg EQ 'MM'.
      ls_object-objtype = 'BUS2081'.
      ls_object-objkey  = wa_thdr-sap_doc_no.
    ENDIF.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename            = f_filename
        filetype            = 'BIN'
      TABLES
        data_tab            = it_content
      EXCEPTIONS
        conversion_error    = 1
        file_open_error     = 2
        file_read_error     = 3
        invalid_table_width = 4
        invalid_type        = 5
        no_batch            = 6
        unknown_error       = 7
        OTHERS              = 8.
    CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
      EXPORTING
        it_contents_bin = it_content[]
      IMPORTING
        et_contents_bin = it_content[].
    CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
      EXPORTING
        region    = 'B'"'Q'
      IMPORTING
        folder_id = ls_fol_id
      EXCEPTIONS
        OTHERS    = 1.
    ls_obj_data-objsns = 'O'.
    ls_obj_data-objla = sy-langu.
    CONCATENATE 'Anexo - ' space
                wa_thdr-zeic_data_dig+6(2) '.'
                wa_thdr-zeic_data_dig+4(2) '.'
                wa_thdr-zeic_data_dig(4)
                INTO ls_obj_data-objdes.
    lv_offset = STRLEN( f_filename ) - 3.
    ls_obj_data-file_ext = f_filename+lv_offset(3).
    ls_obj_data-objlen = LINES( it_content ) * 255.
*ALI          X   X Documento de lista ABAP
*ARC          X     Objeto de arquivo (Image)
*BCS              X Arquivo documento externo
*BIN          X     Documento binário
*DLI          X     Lista de distribuição
*EXT          X X   Documento PC
*FOL          X     Pasta
*GRA          X   X Gráfico SAP
*OBJ          X     Business object
*OFO              X Pasta de objeto
*OTF              X Documento OTF
*R3I              X IDoc
*RAW  X       X     Documento editor SAP
*SCR          X     Documento SAPscript
*URL                Link para Inter/Intranet
*WIM              X Work item
*XXL          X   X Documento para Listviewer
    CALL FUNCTION 'SO_OBJECT_INSERT'
      EXPORTING
        folder_id             = ls_fol_id
        object_type           = 'EXT'
        object_hd_change      = ls_obj_data
      IMPORTING
        object_id             = ls_obj_id
      TABLES
        objhead               = it_objhead
        objcont               = it_content
      EXCEPTIONS
        active_user_not_exist = 35
        folder_not_exist      = 6
        object_type_not_exist = 17
        owner_not_exist       = 22
        parameter_error       = 23
        OTHERS                = 1000.
    IF sy-subrc = 0 AND ls_object-objkey IS NOT INITIAL.
      ls_folmem_k-foltp = ls_fol_id-objtp.
      ls_folmem_k-folyr = ls_fol_id-objyr.
      ls_folmem_k-folno = ls_fol_id-objno.
      ls_folmem_k-doctp = ls_obj_id-objtp.
      ls_folmem_k-docyr = ls_obj_id-objyr.
      ls_folmem_k-docno = ls_obj_id-objno.
      lv_ep_note = ls_folmem_k.
      ls_note-objtype = 'MESSAGE'.
      ls_note-objkey = lv_ep_note.
      CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
        EXPORTING
          obj_rolea    = ls_object
          obj_roleb    = ls_note
          relationtype = 'ATTA'
        EXCEPTIONS
          OTHERS       = 1.
      DELETE FROM  zeic_enviar_wf WHERE invoice_guid = wa_wk-invoice_guid.
    ELSE.
      wa_wk-erro_img_doc = 'X'.
      MODIFY it_wk FROM wa_wk INDEX d_tabix.
    ENDIF.
This is just a scratch but i think it will help..

Similar Messages

  • Mavericks mail default location option for adding attachment

    When I am writing an email and want to add an attachment, I have always used the paperclip icon to do so, and my desktop would appear as the default option as a place to select the attachment. Recently this has changed so that the default option still says 'desktop' on the side panel but instead displays my itunes library. If I go to my home then back to desktop my actual desktop is displayed, but I'm wondering why itunes is appearing as my desktop, and how I can fix this so that my default option for adding an attachment is my actual desktop.
    Thanks!

    I partially agree and disagree.
    I agree with concerns but disagree as it is causing a bottleneck for agility and effectiveness addressing user needs.
    "A picture is worth a thousand words" (and pictures come in a file).
    If we are concerned about disk space, then I feel we need to provision hard disk space and nourish the SAP Community Network to be effective and improved.
    For example:  Business Objects products often deals with reports and users often enquiry ways to cleverly use our tools.
    Imagine how unproductive users find the forum messages when everyone is trying to describe what they see in their screens.  And how much misunderstanding happened among all those involved in the discussion of the thread.
    It didnt' take me more than a few months to realize that users are all crying out for ways to add a descriptive image into their forum message.
    Some are clever and add a link to an external location, some leave their email addresses and some leave their phone numbers!
    The other challenge is for Chinese,Korean and Japanese language users.  An Asian user seeking for help is unable to describe properly in a foreign language to gain visibility for wider audience, often they are not familiar with the naming of the functionality in english because he/she may never have seen the menus in English.
    I recently observed a user describing a problem there were 14 notes back and forth for a very simple matter, it took 3 days.  I believe a screenshot with a red circle would have helped in one shot.
    I suggest files to be allowed and filters put in place distinguishing file formats to allow right content.

  • Reader rights for adding attachment

    Hi ,
    is it possible to apply reader rights for adding attachments when output pdf form in sap?
    where can i find more document on controlling reader rights?
    thanks and best regards.
    Jun

    Hi Jun,
    here is a sample code for seting usage rights:
    FORM use_rights
      CHANGING p_pdf TYPE xstring.
    DATA: l_fp           TYPE REF TO if_fp,
          l_pdfobj       TYPE REF TO if_fp_pdf_object,
          l_dest TYPE rfcdest.
    MOVE cl_fp=>get_ads_connection( ) TO l_dest.
    l_fp = cl_fp=>get_reference( ).
    l_pdfobj = l_fp->create_pdf_object( connection = l_dest ).
    l_pdfobj->set_document( pdfdata = l_pdf ).
    DATA: lt_rights TYPE TFPURIGHT.
    PERFORM my_usagerights CHANGING lt_rights.
    l_pdfobj->set_usagerights( default_rights = space  rights = lt_rights ).
    l_pdfobj->execute( ).
    l_pdfobj->get_document( IMPORTING pdfdata = l_pdf ).
    ENDFORM.
    FORM my_usagerights
        CHANGING pt_rights TYPE TFPURIGHT.
      DATA: ls_rights LIKE LINE OF pt_rights.
      REFRESH pt_rights.
      ls_rights-right = if_fp_pdf_usage_rights=>formrights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_fillin. "Ukladani
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_export. "Export XML
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_add.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_delete.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_submitstandalone.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_spawntemplate.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>formright_online.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-right = if_fp_pdf_usage_rights=>signrights.
      ls_rights-value = if_fp_pdf_usage_rights=>signright_modify.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-right = if_fp_pdf_usage_rights=>annotrights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_create.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_delete.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_modify.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_copy.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_import.
      INSERT ls_rights INTO TABLE pt_rights.
      ls_rights-value = if_fp_pdf_usage_rights=>annotright_export.
      INSERT ls_rights INTO TABLE pt_rights.
    ENDFORM.
    Michal

  • Adding attachment to the post

    How can i add a word document while posting a new thread?
    What types of attahment can be added.?
    Yogesh

    Up towards the right corner of the page you are looking at should be a link marked 'FAQ'.
    I encourage you to click on that link, search for the work 'attach' and read the official statement about attachments.
    If you can't find the link, try http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ

  • To Identify right IDOC for Non PO based Invoice posting

    Hi,
    Business requirement is to post a non PO inbound invoice which is available in the flat file to a SAP system using IDoc.
    The Idoc Should post the G/L & Cost center detail available in Flat file in to SAP system.
    No automatic assignment of cost center with G/L account is required.
    So we want to know a IDoc which SAP recommends/or should be used for the process with the matching process type.
    Any help in this regard is highly appreciated.
    Thanks & Regards
    Upender

    Hi,
    Have you considered ACLPAY01 ?
    Regards,
    Anand Mandalika.

  • Function for adding items to sales order

    Hi.
    I would like to know if there is some other more simple function (then crmxif_order_save) to add new items to sales order. And if yes, some sample code would also be appreciated.
    Thank in advance.

    I have a smilar requirement, I am supposed to add the line item to sales order in run time, I have done code changes in the user exit CHECK_VBAP of the program MV45AZB , I can see the data in the debug mode, but I dont see the same populating the screen of the VA01. Can u please help em , wht are the extra points I need to take care of . I have written a code to add data to XVBAP table and it is coming in debug mode into that tabble. but same data is not coming on the screen .How do u write the data to the screen.

  • SQL function for adding street, city and postal code.

    I would like to know how to add to my code to display the addresses.
    Any ideas?
    SELECT departments.department_name "Department Name", locations.state_province "Mailing Address"
    FROM departments, locations
    WHERE departments.location_id=locations.location_id
    AND locations.country_id='US'
    ORDER BY department_name;
    OUTPUT SO FAR:
    Department Name Mailing Address
    Accounting Washington
    Administration Washington
    Contracting Washington
    Executive Washington
    IT Texas
    Shipping California

    Hi,
    Do you want the four database columns to appear as one output column, perhaps with a space between the columns?
    If so, concatenate the strings into one big string using ||
    SELECT departments.department_name "Department Name"
    , street_address
    || ' ' || city
    || ' ' || locations.state_province
    || ' ' || postal_code AS "Mailing Address"
    FROM departments, locations
    WHERE departments.location_id=locations.location_id
    AND locations.country_id='US'
    ORDER BY department_name;
    Message was edited by:
            Frank Kulash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Which kind of IDOC for invoice posting ?

    I have a requirement where I have to look at the incoming IDOCS send by vendors through EDI. Now if the IDOC posting fails to create invoice, I have to create a custom report for all the failed invoices posting (status 03).
    My question is when the vendor will send invoices via EDI IDOCS, will that be INVOIC01 or INVOIC02. Because I will be reading segment data of these invoices to create the report.
    Also, can someone guide me through as how to create data for incoming INVOICES IDOCS for testing purpose ?
    Regards,
    Rajesh.

    Solved myself

  • Duplicate check for non inventory vendor invoices in Finance

    Hi,
    SAP provides duplicate check for non inventory vendor invoices posted through transactions F-43 and FB01 etc. The field values checked for duplicate invoice include Document date and Reference field.
    I want to know, is there any flexibility of removing Document date from checking criteria?
    This is to facilitate picking more invoices in duplicate check net.
    Regards,
    Vijay

    Dear Vijay
    Yes, you can control this via business transaction events. Please review the below explanation.
    In Rel 4.6, duplicate invoices are checked using function module
    FI_DUPLICATE_INVOICE_CHECK which is called when invoices are posted via trans FB60.  Duplicate invoice checking criteria can be customized using the open FI interface SAMPLE_PROCESS_00001110 (custom function module) starting from Rel 4.6.  Please verify if the open FI interface 00001110 is being used in your system and review duplicate invoice selection criteria via trans BERP. You may wish to omit the document date (BLDAT field from the duplicate invoice check criteria to trigger error msg F5117.  In addition, table BSIP (vendor duplicate documents) may need to be updated.  (see note 114563 for further info).
    Please also check note 537213, and note 31771 for your information.
    If this helps please reward with points.
    Best Regards
    Kesav

  • Standard IDoc Type for Inbound NonPO Vendor Invoices - FB60

    What should be the perfect standard IDoc Type for Inbound NonPO Vendor Invoice posting. Tcode FB60.
    I found IDoc Type FIDCCP02 but the Function Module 'IDOC_INPUT_FIDCC2' for FIDCCP02 is not released.
    In the same way many other standard function modules like - IDOC_INPUT_ACLPAY, IDOC_INPUT_FIDCCH, IDOC_INPUT_ACC_INVOICE_RECEIPT and few more are not released.
    My question : If at all I have to use standard IDoc Type, Message type and Function module (Released) for Inbound NonPO Vendor Invoices, then what should be the solution from SAP ?
    Thanks,
    Veeru.

    Hi,
    IDOC_INPUT_FIDCC2 for FIDCCP02 works for us in ECC6.0
    If you want Automatic tax calculation functionality using FIDCCP02.. then FIDCC2 is not correct message type for you. In that case you should probably go for :
    Msg: INVOIC
    Basic type: INVOIC02
    FM: IDOC_INPUT_INVOIC_FI
    Process code: INVF
    Thanks,
    Kumar

  • Adding attachment via File browse not working

    Hi, I'm using Apex 4.1.1 through GlassFish server 3.1.1. Recently I've imported my database application and after running my app, adding of an attachment isn't working anymore. Before I used Apex via Emb. PL/SQL Gateway(from which I've exported app sql) and everything worked just fine. My code for adding attachment is like this:
    IF (:P2_ATTACHMENT IS NOT NULL)
    THEN
    INSERT INTO ATTACHS
    (ID_ATACHMENT,NAME_ATTACH, TYPE_ATTACH, ATTACHMENT, DATE_ATTACH)
    SELECT ID,NAME, mime_type,blob_content, sysdate
    FROM wwv_flow_files
    WHERE NAME = :P2_ATTACHMENT;
    DELETE wwv_flow_files
    WHERE NAME = :P2_ATTACHMENT;
    :P2_ATTACHMENT := NULL;
    END IF;
    If I skip this piece of code, and try to submit page(where is also couple of other insert statements), then is ok.
    What is the problem of this, GlassFish, wwv_flow_files table, apex listener...?
    Thanks.

    Hi,
    >
    isn't working anymore.
    >
    Do you get an error? What diagnostic details do you have? E.g. what do see in View Debug if you run the page in Debug mode?
    Prima facie, there is nothing wrong in the code or in the infrastructure.
    Regards,
    PS: Please post code in {code} tags.
    Edited by: Prabodh on Jun 21, 2012 5:00 PM

  • Best / most popular software or scripts for adding search function to website?

    I'm trying to find a good piece of software or script for implementing a site search function into our website.  I am relatively knowledgeable in Dreamweaver and can write CSS and XHTML at the fairly intermediate to advanced level, as well as work with JavaScript and js files, but I don't really know much ASP or "by hand" Java coding.  Their are so many scripts and software out there for adding a site search that it's hard to sort through and narrow down.  I was hoping to find reviews of the popular ones or "top 10 lists" of some sort that would help me pinpoint a good one, but can't find anything like that.  These are the primary needs of the website:
    --Has under 50 searchable pages that won't change much and probably won't exceed 50. There are product part numbers and descriptions for some 250-300 part numbers, spread across only 24 of those pages.  The remaining pages are important but no part numbers-- About Us, News, Where to Buy, History, Featured Products, etc.  The product pages are very much like an online store but we don't sell directly on the site (only thru distributors/reps).
    --We are trying to keep the price under about $50, or use a free solution
    --The pages are all static XHTML+CSS pages, but our server can run ASP (we have another website for one of our other product line divisions, on the same server, with many more products beyond 1000, which was programmed completely in ASP by an outside company about 4 years ago).  We self-host both sites.
    --Our server can't run PHP
    --The search capabilities need only be rather basic-- a keyword search with a results page that uses the same design template as the rest of the site.  It would be nice, but not mandatory, to have a search filter and/or a drop down menu to enable selectively searching only certain parts of the site, or only product/part number search vs. general search, etc. (but again, not mandatory).
    --I do have a sitemap page already on it, if that matters or helps
    Some of the ones I've found so far that looked the most promising include:  Zoom Search Engine (http://www.wrensoft.com/zoom/), Site Search Pro (http://www.site-search-pro.com/), and FX Site Search which is a DW Extension I found in the exchange (http://www.felixone.it/extensions/prod/mxssen.asp)-- (that one looks possibly technically challenging or requiring more ASP skill, though)
    Forgive me if there is a better area to post this, if so let me know.

    For a static site, your options are:
    Google ~  http://www.google.com/sitesearch/
    Freefind ~ http://www.freefind.com/
    Zoom from Wrensoft ~ http://www.wrensoft.com/zoom/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • MM-Check Double Invoice functionality for Vendor Invoices

    Dear All,
    How Check Double Invoice functionality for Vendor Invoices can be implemented in SAP?
    We have implemented Check double invoice with the standara sttings for it however if i give my referenece text differently it will aloow me to post double invoices and against vendor open items are shown for payment?
    Is there any other efficient way to do it?
    Thanks and Regards
    Shrinivas

    dear SAPian friend,
    go through the below link and you will find the solution with the screenshots.
    http://sapfunctional.com/MM/Duplicate/Invoices.htm
    U can also do the setting using the SPRO t-code:-
    path is
    >>SPRO
    >>SAP Reference IMG
    >>Materials Management
    >>Logistics Invoice Verification
    >>Incoming Invoice
    >>Set check for duplicate invoices

  • Exchange Rate date for Invoice posting for Slovak Republic

    Hi,
    We have a requirement wherein for Slovak Republic, Invoice should pick up ( at the time of Invoice Posting) the exchange rate from the Delivery Note date and not the Invoice Posting Date. This is applicable for all vendors which have a Slovak Republic VAT Registration number. I suppose this is some country specific requirement for Slovak Reublic.
    Do we have to apply some Notes to achieve this functionality. Any pointers to this issue is highly appreciated.
    Regards
    Anupam

    SO VBRK-KURRF (exchange rate for FI)  is taken from "pricing date" in standard?
    Are you 100% sure? :
    FIrst of all: there is no pricing date (PRSDT) on invoice header level
    Second: I`ve got information from FI that VBRK-KURRF is taken from posting (billing date) VBRK-FKDAT
    I have found also programs, there is provided folloving calculation formula:
    LV60AA90
    Currency conversion (WAVWR is in local currency so far)
            ACTDATE = VBRK-KURRF_DAT.
            IF ACTDATE IS INITIAL.
              ACTDATE = VBRP-PRSDT.
            ENDIF.
            DA_WAVWR_HW = VBRP-WAVWR.
            DA_WAVWR_KW00 = WAVWR_KW00.
            DA_WAVWR_PCVP = WAVWR_PCVP.
    LV60A036
    Determine date
        IF vbrk-kurrf_dat IS INITIAL.
          ld_kurrf_dat = vbrk-fkdat.
        ELSE.
          ld_kurrf_dat = vbrk-kurrf_dat.
        endif.
    So what is the verdict?

  • BAPI for Non PO Invoice posting?

    Hi Experts,
       I am posting invoices using BAPI_INCOMINGINVOICE_CREATE. These invoices have POs associated with the Item Details. This is working fine for me.
       I want to post invoices that DO NOT have a PO. Can someone please point me to a BAPI that is similar to BAPI_INCOMINGINVOICE_CREATE in functionality but does not require a PO?
    Thanks,
    - Vik.

    I too was looking for a BAPI for non PO invoice posting.  I found that the above counsel did not work for me.  Instead of creating a buyside invoice, it just created a journal entry.  What DID work for me was BAPI_ACC_INVOICE_RECEIPT_POST.
    Below, I am pasteing the subroutines that I created for its calling.  In it, for my purposes, only the invoice amount is parameter driven.  My needs allowed all other BAPI parameters to stay the same.
    I hope that this helps someone.
    Donald Nigro
    FORM create_buyside_invoice USING value(invoice_amt) TYPE p.
      DATA:
        gd_documentheader  LIKE bapiache03,
        it_accountpayable  LIKE bapiacap03 OCCURS 0 WITH HEADER LINE,
        it_accountgl       LIKE bapiacgl03 OCCURS 0 WITH HEADER LINE,
        it_accounttax      LIKE bapiactx01 OCCURS 0 WITH HEADER LINE,
        it_currencyamount  LIKE bapiaccr01 OCCURS 0 WITH HEADER LINE,
        it_return          LIKE bapiret2   OCCURS 0 WITH HEADER LINE.
      DATA:
      wa_obj_key(20)  TYPE c.
    fill header
      gd_documentheader-username   =  sy-uname.
      gd_documentheader-header_txt = 'E-Payables Invoice'.
      gd_documentheader-comp_code  = 'EAUS'.
      gd_documentheader-doc_date   =  sy-datum.
      gd_documentheader-pstng_date =  sy-datum.
      gd_documentheader-doc_type   = 'KR'.
      CONCATENATE 'BOA' sy-datum sy-uzeit(4)
                   INTO gd_documentheader-ref_doc_no.
    fill AP (line 1)
      it_accountpayable-itemno_acc = 1.
      IF sy-sysid(3) = 'DEV'.
        it_accountpayable-vendor_no  = '0600013370'.
      ELSE.
        it_accountpayable-vendor_no  = '0600009022'.
      ENDIF.
      APPEND it_accountpayable.
    fill GL (line 2)
      it_accountgl-itemno_acc      =  2.
      it_accountgl-gl_account      = '0001112227'.
      it_accountgl-comp_code       = 'EAUS'.
      it_accountgl-pstng_date      =  sy-datum.
      it_accountgl-fisc_year       =  sy-datum(4).
      it_accountgl-fis_period      =  sy-datum+4(2).
      it_accountgl-bus_area        = '0100'.
      APPEND it_accountgl.
    fill currency ammounts for lines 1 & 2
      it_currencyamount-currency    = 'USD'.
      it_currencyamount-itemno_acc  = 1.
      it_currencyamount-amt_doccur  = invoice_amt * -100.
      APPEND it_currencyamount.
      it_currencyamount-itemno_acc  = 2.
      it_currencyamount-amt_doccur  = invoice_amt *  100..
      APPEND it_currencyamount.
      CALL FUNCTION 'BAPI_ACC_INVOICE_RECEIPT_CHECK'
           EXPORTING
                documentheader = gd_documentheader
           TABLES
                accountpayable = it_accountpayable
                accountgl      = it_accountgl
                accounttax     = it_accounttax
                currencyamount = it_currencyamount
                return         = it_return.
      PERFORM invoice_error_check TABLES it_return.
      CALL FUNCTION 'BAPI_ACC_INVOICE_RECEIPT_POST'
           EXPORTING
                documentheader = gd_documentheader
           IMPORTING
                obj_key        = wa_obj_key
           TABLES
                accountpayable = it_accountpayable
                accountgl      = it_accountgl
                accounttax     = it_accounttax
                currencyamount = it_currencyamount
                return         = it_return.
      PERFORM invoice_error_check TABLES it_return.
      COMMIT WORK.
      WRITE: / 'ePayables Bank of America'.
      WRITE: / '  Invoice Document Number:',
                  wa_obj_key(10).
    ENDFORM.
         Form  invoice_error_check
    FORM invoice_error_check TABLES it_return STRUCTURE bapiret2.
      DATA:
      bapi_success(5) TYPE c VALUE 'false'.
      LOOP AT it_return.
        IF it_return-type = 'S' AND bapi_success = 'false'.
          bapi_success = 'true'.
        ENDIF.
      ENDLOOP.
      IF bapi_success = 'false'.
        WRITE: / 'Unable to post a buyside invoice with',
                 'BAPI_ACC_INVOICE_RECEIPT_POST'.
        LOOP AT it_return.
          WRITE: / 'Message Type:   ', it_return-type,
                 / 'Message Class:  ', it_return-id,
                 / 'Message Number: ', it_return-number,
                 / 'Message:        ', (80) it_return-message.
        ENDLOOP.
        ROLLBACK WORK.
        STOP.
      ENDIF.
    ENDFORM.

Maybe you are looking for

  • Why can't I publish my iweb page?

    It is asking me to sign in but it shows that I am already signed in... :-)

  • I Need A MacBook Pro 13" Miracle!

    The 13" MBP has a combo audio In/Out receptacle. ONLY ONE RECEPTACLE! I'm trying to use my electric guitar with Garage band but would like to me able to monitor what I'm playing thru my sound system. I'm using the "Line-In" with my guitar so I can't

  • PA billing: project / invoice currency

    Hi, I have the following error when interface an invoice from PA to AR: "The distributions for this transaction are in the functional currency, but the entered amount does not equal the accounted amount. Please recalculate the accounted amount for th

  • Club result set from 2 different outputs

    Hi, I have request id which gives 2 records as output in one query with one condition. same request id gives 10 records as output in another query with another conditions. Now, I want to club these 2 queries to get the final output as 10 records only

  • Can't get garageband to record

    I've been trying to use garageband, and no matter what I do it won't record. I've watched the tutorials and all they do is select male/female then click record and talk, but mine won't record a thing. I have a built in mic and it's working fine becau