Sending AR Customer Statements & Invoices by Email

We currently upgrading to R12 and have a requirement to find out if its possible to email customer Statements and invoices via email. We need the email to work for batch printing and individual printing. Is there any option avaliable in R12 that can be used to enable this functionality? Any suggestion are welcome and are appreciated.
Thanks in advance.

Thanks a lot Gareth.
So will have to do some customizations. We were wondering if we can do it without making any code changes, seems not.
This certainly is a good solution and it will give us the functionality even though we have to added some code changes I think its better then buying third party extensions. I also went through your blog and you have some very good technical information on Oracle Apps. Thank you for doing this good work.

Similar Messages

  • How to send multiple customer statements by email using RFKORD11 program.

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program. Is it possible?
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    thanks in advance.
    Regards,
    Mahesh

    Try execute the program in the background to see if that helps.

  • How to send multiple customer statements by email using RFKORD11

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program.
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if  i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    Regards,
    Mahesh

    Hi .
    You first need to copy that program to Z and make the changes in it. Can you convert sapscript to smartform?
    then you can write a logic to send mail in the loop.
    to send the pdf file
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/mailsendthroughoutputcontrols
    Regards,
    Madhuri
    Edited by: madhuri sonawane on Jun 10, 2009 4:20 PM

  • Sending one Customer Statement to 4 Sales Rep Email ID

    Hi All,
    i need to send one customer statement to 4 sales rep Email ID. these sales rep are assigned to different sales area. please give me your possible solutions.
    thanks in advance

    I am not sure of what you mean by Customer statement.
    What I can think of is that we can set up a background job for that T.Code and give the email ids in the spool recepient of the job. Once the job is complete emails would be sent.
    Hope this helps.

  • Send Correspondence Customer Statement Via Email

    Hi SAP Gurus,
    Currently, I already succeed with user exit EXIT_RFKORIEX_001 to send customer statement (F.27) via email. The program can attached PDF Files in the email that sent by SAP.
    However, the email that sent is blank without body text. Does anyone know how to put text in the email body text, e.g "please find attached customer statement" ..
    Thanks
    Hertoto

    Hi SAP Gurus,
    Currently, I already succeed with user exit EXIT_RFKORIEX_001 to send customer statement (F.27) via email. The program can attached PDF Files in the email that sent by SAP.
    However, the email that sent is blank without body text. Does anyone know how to put text in the email body text, e.g "please find attached customer statement" ..
    Thanks
    Hertoto

  • EBS Bursting and routing AR Statements/Invoices to email/print

    Hi
    I've just read Gareth Roberts' really cool blog on a simple method to process AR statements (or any other Concurrent Request report) in XML.
    http://garethroberts.blogspot.com/2008/01/beautiful-statements-in-1-easy-step.html
    I'm looking for direction on how to burst the XMLP output and route the individual customer documents to email and / or printers.
    Bursting is quite well descriped in the stand-alone BIP with the control file but I see no documentation of doing this with Concurrent Manager - (Nor any of the other XDOxxxxx concurrent programmes!!)
    I've started looking at the XDOBURSTRPT concurrent programme but without documentation have not yet had any success.
    Should XDOBURSTRPT be called with a fnd_request.submit_request directly after the request_submit for XDOREPPB?
    How do these things hang together?
    Thanks for any help.
    Mike Mac

    Hi Gareth
    With your and Tim's help - just revisited his blog on bursting at
    http://blogs.oracle.com/xmlpublisher/2007/04/05#a189 - I'm now getting close.
    The fundamental change that has happened since Tim's blog is that XMLP now allows for the accessing of the RTF template file from the XMLP Responsibility Data Definintion upload (of the control file onto the Data definition).
    But there's absolutely no documentation, that I can find, for the updated syntax of the control file itself where reference is made to the RTF Template also being managed by Concurrent Manager / Template Manager - instead of having to place the RTF on the server file system, and directly reference it in a hard-coded path.
    A secondary question is how to access alternate ".rtf" formatting templates within one Bursting Control File (different templates for different conditions).
    Tim also mentions the referencing of CUPS defined printers by name, and the ability to issue a regular unix lp command - its this documented anywhere?
    Is there a new comprehensive reference for the 5.6.3 Bursting Control File and its use with Concurent Manager?
    Thanks in anticipation
    Mike

  • Customer Statement send by email

    Hi,
        I have a problem in sending multiple customer statement seperatly to each customer by email .Here  i can able to send email to all the customers but the attachment contains all the customer statements.but i want to send the particular statement to a particular customer as per the email id.so how to solve this pls help me to solve it.
    Thanks,
    Rajendra.

    Hi Rajendra,
    Did ur query got solved, i have similar query with me.. I need to send sms and email after delivery for ship to party for multiple recipents individually. the particular details has to go to the paritcular company not to others. Please do reply.... if possible give me ur contact number and email id for further clarifications.
    thanks and regards.
    Abdur Rafique

  • F.27(Statement should be emailed if customer master contains email address)

    Hi All,
    I am working for the tcode f.27. A standard form F140_ACC_STAT_01 is assigned to tcode. Here my requirement is i need to do some changes in the form and output should be in pdf format and statement should be emailed if customer master contains email address.
    Can any body please help me how to send the email if the customer master contains email address.
    Please reply.
    Thanks,
    Nagendra

    Hi Nagendra
    change the customer email address on home and bussiness email field first and then make following changes to function module 'Z_CORR_PROCESS_00002310' or whatever name you  have got , this is working for us, let me know if y ou have any problem, You might have to tweak a code a bit , here we are decide whether to send customer statements to two email or not based on customer group selection
    data: w_output_type(10).  "Output type
       data: w_kunnr like i_kna1-kunnr.
       data: w_ktokd like i_kna1-ktokd.
       data: l_addressdtls type zaddressdtls.
       data: l_atype(1).  " Address type
    DATA: w_mailtxt TYPE finaa-namep VALUE 'ZCITY_STATEMENT_MAIL_BODY'.
    * Variables are imported - set in ZFKORD10_STUD
    * Import variable w_output_type from memory
       clear: w_output_type.
       IMPORT w_output_type FROM MEMORY ID 'ZOUTPUT_TYPE'.
       move 'B' to  l_atype.      "Business e-mail
       if w_output_type = 'EMAIL'. "Email option chosen
         c_finaa-nacha = 'I'.
         c_finaa-tdfaxuser = sy-uname.
          c_finaa-namep = w_mailtxt.
    * Get the Relevant e-mail address
         move I_KNA1-KUNNR to w_kunnr.
         clear: l_addressdtls, c_finaa-intad.
         call function 'Z_GET_CUSTOMER_ADDRESS'
              EXPORTING
                   kunnr                   = w_kunnr
                   atype                   = l_atype  "B Business H Home
              IMPORTING
                   addressdtls             = l_addressdtls
              EXCEPTIONS
                   invalid_customer_number = 1
                   no_customer_partner     = 2
                   invalid_address_type    = 3
                   others                  = 4.
         if sy-subrc eq 0.
           if l_atype = 'H'.  "Home e-mail address
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-home_email.
           else.
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-business_email.
           endif.
         endif.
         concatenate i_kna1-kunnr
                     'Account statement from City University'
                      into c_itcpo-tdtitle separated by space.
         c_itcpo-tdfaxuser = sy-uname.
         if ( c_finaa-intad is initial            " No email address
              and c_itcpo-tdpreview is initial ). " and not print preview
           c_finaa-nacha = '1'.        "Print output type
           c_itcpo-tdgetotf = 'X'.     "Do not print
           c_itcpo-tdpreview = space.  "No print preview
           c_itcpo-tdnoprev = 'X'.     "No print preview
         endif.
       endif.
    if w_ktokd = 'stud'.
        move 'H' to  l_atype.      "Business e-mail
       if w_output_type = 'EMAIL'. "Email option chosen
         c_finaa-nacha = 'I'.
         c_finaa-tdfaxuser = sy-uname.
         c_finaa-namep = w_mailtxt.
      "Get the Relevant e-mail address
         move I_KNA1-KUNNR to w_kunnr.
         clear: l_addressdtls, c_finaa-intad.
         call function 'Z_GET_CUSTOMER_ADDRESS'
              EXPORTING
                   kunnr                   = w_kunnr
                   atype                   = l_atype  "B Business H Home
              IMPORTING
                   addressdtls             = l_addressdtls
              EXCEPTIONS
                   invalid_customer_number = 1
                   no_customer_partner     = 2
                   invalid_address_type    = 3
                   others                  = 4.
         if sy-subrc eq 0.
           if l_atype = 'H'.  "Home e-mail address
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-home_email.
           else.
             c_finaa-namep = w_mailtxt.
             c_finaa-intad = l_addressdtls-business_email.
           endif.
         endif.
         concatenate i_kna1-kunnr
                     'Account statement from City University'
                      into c_itcpo-tdtitle separated by space.
         c_itcpo-tdfaxuser = sy-uname.
         if ( c_finaa-intad is initial            " No email address
              and c_itcpo-tdpreview is initial ). " and not print preview
           c_finaa-nacha = '1'.        "Print output type
           c_itcpo-tdgetotf = 'X'.     "Do not print
           c_itcpo-tdpreview = space.  "No print preview
           c_itcpo-tdnoprev = 'X'.     "No print preview
         endif.
    endif.
    endif.

  • Customer Statement to be Send by Email

    HI,
    I have config the Customer statement by means of correnpondence & it working fine.
    But I need to send it through email maintained in customer master when i run f.27 mails should be send automatically.
    For doing this do we need  to do any config required or do we need to direaclty write it in the program code it self.
    Regards,
    Sids

    Hi Sids,
    It is possible to send via Distribution list (S023) by selecting the Recipient list. However, let me check a little bit more as to whether it is possible to send based on the email address on the customer master.
    Rgds
    NW

  • Mass emailing of customer statements and invoices

    Hi Experts
    Is there a method within SAP B1 or using an add-on whereby we can send all of our invoices for a single days business by email without needing to send each one individually?  Ideally we would like to be able to do the same thing with out statements also in each case using the E_Mail field from the BP Master Data Form (field OCRD,E_Mail) as the recipient address for the email.
    At the moment we are able to email individually using B1 Outlook Integration, but this can be time consuming when dealing with 250+ invoices per day.
    Likewise monthly statements can be as many as 3000 and it would be great if we could mass email them using SAP B1 or appropriate add-on.  Would save huge amount of time on printing, folding, stamping etc, not to mention the price of postage.  Even if we needed to purchase a 3rd party add-on it would likely pay for itself within a few months seeing as 99% of our BPs now use email addresses.
    Thanks in advance
    Jon

    Hi Johnny,
    We use a product called formscape. [http://www.bottomline.co.uk/solutions_services/formscape.html]
    All output is printed to the formscape server and the output is is tested to see if each document needs emailing, faxing (zetafax) or printing.  Formscape then outputs all documents the our document management system (Invu). 
    Works great for us.
    Thanks,
    Mike

  • Customer statements - Email & print at the same time - Is this possible?

    Hi all,
    We generate customer statements at regular intervals and send them to the customers, through mail, fax and email.
    We have a print program which generates the customer statement. For some customers we want the statements to be printed as well as sent by e-mail simultaneously.
    Can anyone please let me know which field, can we use to tell the system to look at if it has to only print / email / email & print.
    We thought of using Bank statement field in the correspondence tab (KNB1-XAUSZ).
    We created 4 values,
    A - print
    B - Email
    C - print & email
    D - Fax
    However when we use 'C' the print program only sends the email, without printing.
    Can anyone please let me know if I am using the wrong field? Is there any other field that can be used for our requirement.
    Thanks in advance.
    Krishna

    Hi,
    I know it is an old thread. Just to add to what Eduardo explained here, Answer for your question is, yes it is possible to control it through the selection- screen. No need for a new Z-program for this. Even if you check the OSS note 549119, it is only talking about controlling it through master data if you check the mentioned include LXFKOF01(whether Email id maintained or not)
    What we have done is, we have controlled the same through correspondence types. We copied the existing ones into new ones starting with E*. For example: SAP01 to EAP01 to denote that these are all for emails. And we check the correspondence type in BTE 2310 which is available in parameter I_BKORM-EVENT. Based on that, you either set FINAA-NACHA      = 'I' (Email) or FINAA-NACHA      = '1' (Print) or even you can include fax as well.(FINAA-NACHA      = '2').
    If you have some hard coded stuff in your forms, what you can do is, you can reset the correspondence type back to SAP01 from EAP01 by using field symbols , by changing '(RFKORD10_PDF)BKORM-EVENT'.  Make sure you use correct print program in place of RFKORD10_PDF.
    So when you run F.27 or F.62 with SAP01, it will mass print and when your run the same with EAP01, it will mass email.
    With regards,
    Gokul

  • Customer statement email.

    Hi All,
      I have requirement need to send customer statement as email. I am running it from f.27  and attached correspondense.
      I would like send an email of customer statement. Any user exit to do the same? Can any one did the same please let me know?
      its very urgent.. reward points for right solution..
    thx

    I am trying to run a transaction f.27 (customer statement) to be able to run a customer statement run that can be emailed to the customer (email address in the customer master).
    I used the same step as above - BTE - 2310 and attached this to the new funtional module
    The steps I have followed allready are
    1. Copied a fucntional module
    2. Assigned the functional module
    3. Got abap programmer to activate sap connect.
    It partially worked as it gave me the output on my screen which was a statement log and this was able to be emailed to the email address in the customer master.
    Do you think it is due to the report not functioning properly in the first place as it is only showing the log when I run the report itself?
    Many thanks for your help on this.
    Sanjay

  • How to send invoice through email with output type RD00?

    What are the configuration settings to send invoices through email with output type RD00?

    Hi,
    Please go through the following links:
    [E-mail|Email Configuration Settings]
    [e-mail|Re: EMAIL BILLING DOCUMENT TO CUSTOMER THROUGH SEND MAIL OPTION IN VF02]
    After triggering the output,goto T.Code SOST and process it.
    So that e-mail will be triggered immediately.
    You can use External send/EDI/simple mail for this.
    Regards,
    Krishna.

  • MLUNXSND sends customer statements as .dat or unreadable pdf

    Hello Group,
    We are turning off our old MS Exchange server as we are moving to a MS
    Exchange 2003 enviroment so the SXC connector that we have been using will no longer be supported. Our SAP system is R/3 4.6C.
    We have implemented the Internet Mail Gateway using
    MLUNXSND on the iSeries and most emails are being sent correctly except
    customer statements from transaction F.27. The statements are sent out,
    but they arrive in the recipients inbox as a ".dat" file instead of the
    ".pdf" file that they are supposed to be in.
    The Internet Mail Gateway (IMG) node is setup to support the following
    formats:
    PDF
    RAW
    TXT
    and uses device type ZPDF1 that we have setup to allow the PDF conversion.
    These customer statements are being sent out correctly in PDF format
    using the SXC connector, but they just aren't working with the IMG
    MLUNXSND program. We have also tried the MLUNXSND2 program and patched to the latest version (22).
    Any assitance with this would be greatly appreciated.
    Many thanks,
    Steven

    Just an update to this in case any of you have experienced this same issue.
    As mentioned we have been having some problems implementing the SAP Internet Mail Gateway for sending messages out of R/3 4.6c, more specifically sending larger size PDF attachments. They are getting converted correctly by SAP; however, they are getting sent out in an unreadable format. With the help of SAP and their access to previously opened customer issues, they have indicated that this problem has been solved on the iSeries in the past by increasing the message split size on the POP server.
    We increased this to NOMAX for the time being to see if it resolves the problem which it did. The command is  CHGPOPA MSGSPLIT(NOMAX)
    With regards,
    Steven

  • Customer Statement via Email

    HI,
    I have config the Customer statement by means of correnpondence & it working fine.
    But I need to send it through email maintained in customer master when i run f.27 mails should be send automatically.
    For doing this do we need to do any config required or do we need to direaclty write it in the program code it self.
    Regards
    Ravi

    I have the same requirement to email from f.27 customer statement automatically
    what logic did you put to solved, can you explain me please
    There are two problems which is controlling F.27.  IT have created Z PROGRAM to control the printing and email the customer
    ZFIO_ACCOUNT_STATEMENT_EMAIL   -> program
    ZWAG_COMMON_ROUTINE                   - > Include
    ZWAG_SAPSCRIPT_ROUTINES_EM         -> Include
    ZEMAIL_SEND                                             -> Include added for email .
    The program is running fine but I have to type email id and spool number which I don't want. The program should search customer automatically based on email address from XD02 ( Customer ) .
    *&  Include           ZEMAIL_SEND                                      *
    *ZEMAIL_SEND.
    *&      Form  setup_output_parameters
    *       text
    *&  Include
    *  Purpose:
    *  Provide generic subroutines for any ABAP programs with intention of
    *  sending email (SAPOffice or Internet) with attachments
    * This report provides an example for sending an Spool
    * request as PDF via BCS
    parameters:
    mailto  type ad_smtpadr default  '[email protected]' obligatory,
    rqident type tsp01-rqident obligatory.
    DATA:v_adrnr LIKE kna1-adrnr.
    "  Mail related declarations
    "Variables
    DATA :
        G_SENT_TO_ALL   TYPE SONV-FLAG,
        G_TAB_LINES     TYPE I.
    "Types
    TYPES:
        T_DOCUMENT_DATA  TYPE  SODOCCHGI1,
        T_PACKING_LIST   TYPE  SOPCKLSTI1,
        T_ATTACHMENT     TYPE  SOLISTI1,
        T_BODY_MSG       TYPE  SOLISTI1,
        T_RECEIVERS      TYPE  SOMLRECI1,
        T_PDF            TYPE  TLINE.
    "Workareas
    DATA :
        W_DOCUMENT_DATA  TYPE  T_DOCUMENT_DATA,
        W_PACKING_LIST   TYPE  T_PACKING_LIST,
        W_ATTACHMENT     TYPE  T_ATTACHMENT,
        W_BODY_MSG       TYPE  T_BODY_MSG,
        W_RECEIVERS      TYPE  T_RECEIVERS,
        W_PDF            TYPE  T_PDF.
    "Internal Tables
    DATA :
        I_DOCUMENT_DATA  TYPE STANDARD TABLE OF T_DOCUMENT_DATA,
        I_PACKING_LIST   TYPE STANDARD TABLE OF T_PACKING_LIST,
        I_ATTACHMENT     TYPE STANDARD TABLE OF T_ATTACHMENT,
        I_BODY_MSG       TYPE STANDARD TABLE OF T_BODY_MSG,
        I_RECEIVERS      TYPE STANDARD TABLE OF T_RECEIVERS,
        I_PDF            TYPE STANDARD TABLE OF T_PDF.
    data send_request  type ref to cl_bcs.
    data document      type ref to cl_document_bcs.
    data recipient     type ref to if_recipient_bcs.
    data bcs_exception type ref to cx_bcs.
    data sent_to_all   type os_boolean.
    data pdf_size      type so_obj_len.
    data pdf_content   type solix_tab.
    data pdf_xstring   type xstring.
    DATA: TAB_LINES LIKE SY-TABIX.
    *Variables for EMAIL functionality
    DATA: MAILDATA LIKE SODOCCHGI1.
    DATA: MAILPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: MAILHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: MAILBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILREC LIKE SOMLREC90 OCCURS 0 WITH HEADER LINE.
    DATA: SOLISTI1 LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    start-of-selection.
      perform create_pdf.
      perform send.
    *  perform  get_otf_code. " piroz
    *&      Form  send
    form send.
      try.
    *     -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
          pdf_content = cl_bcs_convert=>xstring_to_solix( pdf_xstring ).
          document = cl_document_bcs=>create_document(
                i_type    = 'PDF'
                i_hex     = pdf_content
                i_length  = pdf_size
                i_subject = 'Accounting statement' ).  "#EC NOTEXT
    *     add document object to send request
          send_request->set_document( document ).
    *     --------- add recipient (e-mail address) -----------------------
    *     create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
    *     add recipient object to send request
          send_request->add_recipient( recipient ).
    *     ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with mailto.
          else.
            message s022(so).
          endif.
    *   ------------ exception handling ----------------------------------
    *   replace this rudimentary exception handling with your own one !!!
        catch cx_bcs into bcs_exception.
          message i865(so) with bcs_exception->error_type.
      endtry.
    endform.                    "send
    *&      Form  create_pdf
    * Create PDF Content
    * 1) get attributes of spool request
    * 2) convert spool request to PDF dependent on document type
    form create_pdf.
      data rq       type tsp01.
      data bin_size type i.
      data dummy    type table of rspoattr.
    *   ------------ get attributes of spool request ---------------------
      call function 'RSPO_GET_ATTRIBUTES_SPOOLJOB'
        exporting
          rqident     = rqident
        importing
          rq          = rq
        tables
          attributes  = dummy
        exceptions
          no_such_job = 1
          others      = 2.
      if sy-subrc <> 0.
        message e126(po) with rqident.
      endif.
    * TYPE-POOLS szadr.
    *  DATA: l_addr1_complete TYPE szadr_addr1_complete,
    *        l_adsmtp_line    TYPE szadr_adsmtp_line,
    *        ld_intad type knb1-intad.
    ** default: print payment advice
    *  c_finaa-nacha = '1'.
    **  Read mail address of vendor from knb1.customer no is available in kna1 payment data     structure
    *  clear ld_intad.
    *  IF NOT i_knb1-kunnr IS INITIAL and
    *     not i_knb1-zbukrs is initial.
    *    SELECT SINGLE intad
    *      INTO ld_intad
    *      FROM knb1
    *      WHERE kunnr = i_knb1-kunnr
    *      AND bukrs = i_knb1-zbukrs.
    *          IF NOT ld_intad IS INITIAL.
    *          c_finaa-nacha = 'I'.
    *          c_finaa-intad = ld_intad.
    *          ENDIF.
    *  ENDIF.
    ** check that address number is available
    *  IF NOT i_kna1-zadnr IS INITIAL.
    **   read complete address of vendor/customer
    *      CALL FUNCTION 'ADDR_GET_COMPLETE'
    *         EXPORTING
    *              addrnumber     = i_kna1-zadnr
    *         IMPORTING
    *              addr1_complete = l_addr1_complete
    *         EXCEPTIONS
    *              OTHERS         = 4.
    *      IF sy-subrc EQ 0.
    *             READ TABLE l_addr1_complete-id_intad                               "Insert ECDK900445
    *             INTO l_adsmtp_line                                                  "Insert ECDK900445
    *             WITH KEY adsmtp-flgdefault = 'X'.                                   "Insert ECDK900445
    *           IF sy-subrc EQ 0
    *           AND NOT l_adsmtp_line-id_intad IS INITIAL.
    **     choose message type 'I'nternet and fill email address
    *           c_finaa-nacha = 'I'.
    *           c_finaa-intad = ld_intad.
    *          ENDIF.
    *    ENDIF.
    *  ENDIF.
    *ENDFUNCTION.
    *  select SINGLE adrnr from kna1 from adr6
    *  into table internal table where
    *  kna1-kunnr eq = it_kna1-kunnr.
    ** select email ids from adr6
    *  select addrnumber smtp_addr from adr6 INTO table it_adr6
    *   where addrnumber = v_adrnr.
    *   LOOP AT it_adr6 INTO wa_adr6.
    *     i_reclist-receiver = wa_adr6-smtp_addr.
    *     i_reclist-rec_type = 'U'.
    *     i_reclist-com_type = 'INT'.
    *     i_reclist-notif_del = 'X'.
    *     i_reclist-notif_ndel = 'X'.
    *     i_reclist-notif_read = 'X'.
    *     i_reclist-express = 'X'.
    *     APPEND i_reclist.
    *     CLEAR: i_reclist, wa_adr6-smtp_addr.
    *     ENDLOOP.
    *in function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' field receivers  = i_reclist.
    *CALL FUNCTION 'ZCUSTOMER_MAIL_00002310' "
    *  EXPORTING
    *    i_bkorm =                    bkorm
    *    i_koart =                    bkorm-koart
    *    i_kna1 =                     kna1
    *    i_knb1 =                     knb1
    **    i_lfa1 =                     lfa1
    **    i_lfb1 =                     lfb1
    *  TABLES
    *    t_fimsg =                    fimsg
    *  CHANGING
    *    c_finaa =                    finaa
    *    c_itcpo =                    itcpo
    **   c_archive_index = SPACE     " toa_dara
    **   c_archive_params = SPACE    " arc_params .  "  ZCUSTOMER_MAIL_00002310
    *Function module to send mail to Recipients
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOCUMENT_DATA
          PUT_IN_OUTBOX              = 'X'
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = G_SENT_TO_ALL
        TABLES
          PACKING_LIST               = I_PACKING_LIST
          CONTENTS_BIN               = I_ATTACHMENT
          CONTENTS_TXT               = I_BODY_MSG
          RECEIVERS                  = I_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
      IF SY-SUBRC = 0 .
        MESSAGE I303(ME) WITH 'Mail has been Successfully Sent.'.
      ELSE.
        WAIT UP TO 2 SECONDS.
        "This program starts the SAPconnect send process.
        SUBMIT RSCONN01 WITH MODE = 'INT'
        WITH OUTPUT = 'X'
        AND RETURN.
      ENDIF.
    *   --- convert spool request into PDF, dependent on document type ---
      if rq-rqdoctype = 'OTF' or rq-rqdoctype = 'SMART'.
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
          exporting
            src_spoolid              = rqident
            no_dialog                = 'X'
            pdf_destination          = 'X'
            no_background            = 'X'
          importing
            pdf_bytecount            = bin_size
            bin_file                 = pdf_xstring
          exceptions
            err_no_otf_spooljob      = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_dstdevice        = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            others                   = 12.
        if sy-subrc <> 0.
          message e712(po) with sy-subrc 'CONVERT_OTFSPOOLJOB_2_PDF'.
        endif.
      elseif rq-rqdoctype = 'LIST'.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
          exporting
            src_spoolid              = rqident
            no_dialog                = 'X'
            pdf_destination          = 'X'
            no_background            = 'X'
          importing
            pdf_bytecount            = bin_size
            bin_file                 = pdf_xstring
          exceptions
            err_no_abap_spooljob     = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_destdevice       = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            others                   = 12.
        if sy-subrc <> 0.
          message e712(po) with sy-subrc 'CONVERT_ABAPSPOOLJOB_2_PDF'.
        endif.
      else.
        message e789(po) with rq-rqdoctype.
      endif.
      pdf_size = bin_size.
    endform.                    "create_pdf
    *       FORM OUTPUT_OPENFI                                            *
    FORM OUTPUT_OPENFI.
      DATA: T_FIMSG LIKE FIMSG OCCURS 10 WITH HEADER LINE.
      CALL FUNCTION 'OPEN_FI_PERFORM_00002310_P'
           EXPORTING
                I_BKORM          = BKORM
                I_KOART          = C_KOART
                I_KNA1           = KNA1
                I_KNB1           = KNB1
    *            I_LFA1           = LFA1
    *            I_LFB1           = LFB1
           TABLES
                T_FIMSG          = T_FIMSG
           CHANGING
                C_FINAA          = ST_FINAA
                C_ITCPO          = ST_ITCPO.
    *            C_ARCHIVE_INDEX  = H_ARCHIVE_INDEX
    *            C_ARCHIVE_PARAMS = H_ARCHIVE_PARAMS.
      LOOP AT T_FIMSG.
        CALL FUNCTION 'FI_MESSAGE_COLLECT'
             EXPORTING
                  I_FIMSG       = T_FIMSG
                  I_XAPPN       = 'X'
             EXCEPTIONS
                  MSGID_MISSING = 1
                  MSGNO_MISSING = 2
                  MSGTY_MISSING = 3
                  OTHERS        = 4.
      ENDLOOP.
    ENDFORM.
    Form GET_OTF_CODE.
        DATA: BEGIN OF OTF OCCURS 0.
              INCLUDE STRUCTURE ITCOO .
        DATA: END OF OTF.
        DATA: ITCPO LIKE ITCPO.
        DATA: ITCPP LIKE ITCPP.
        CLEAR ITCPO.
        ITCPO-TDGETOTF = 'X'.
    *  Start writing OTF code
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          FORM     = 'Z140_ACC_STAT_01'
          LANGUAGE = SY-LANGU
          OPTIONS  = ITCPO
          DIALOG   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      CALL FUNCTION 'START_FORM'
        EXCEPTIONS
          ERROR_MESSAGE = 01
          OTHERS        = 02.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          WINDOW        = 'MAIN'
        EXCEPTIONS
          ERROR_MESSAGE = 01
          OTHERS        = 02.
    *  Close up Form and get OTF code
      CALL FUNCTION 'END_FORM'
        EXCEPTIONS
          ERROR_MESSAGE = 01
          OTHERS        = 02.
      MOVE-CORRESPONDING ITCPO TO ITCPP.
      CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT  = ITCPP
        TABLES
          OTFDATA = OTF
        EXCEPTIONS
          OTHERS  = 1.
    *  Move OTF code to structure SOLI form email
    CLEAR SOLISTI1.
      REFRESH SOLISTI1.
      LOOP AT OTF.
        SOLISTI1-LINE = OTF.
        APPEND SOLISTI1.
      ENDLOOP.
    ENDFORM.                    "GET_OTF_CODE
    SAP recommends to use BTE 2013  and added the coding for email.
    CREATED:      ZCUSTOMER_MAIL_00002310
    TABLES: KNA1,                          "Kunden A-Segment
            KNB1,                          "Kunden B-Segment
            LFA1,                          "Lieferanten A-Segment
            LFB1,                          "Lieferanten B-Segment
            BKORM, "Korrespondenzanforderungen
            FINAA.                         "Daten zum Sendemedium
    DATA: SAVE_KOART LIKE BKORM-KOART,     "Hilfsfeld Kontoart
          SAVE_LAND1 LIKE KNA1-LAND1,      "Hilfsfeld Faxanschluß
          SAVE_TELFX LIKE KNA1-TELFX,      "Hilfsfeld Faxanschluß
          SAVE_ZSABE LIKE KNB1-ZSABE,      "Hilfsfeld Faxanschluß
    SAVE_INTAD LIKE KNB1-INTAD.      "Hilfsfeld Internet
    KNA1       = I_KNA1.
    LFA1       = I_LFA1.
    KNB1       = I_KNB1.
    LFB1       = I_LFB1.
    BKORM      = I_BKORM.
    SAVE_KOART = I_KOART.
    CLEAR: SAVE_LAND1,
           SAVE_TELFX,
           SAVE_ZSABE.
    IF SAVE_KOART = 'D'.
    SAVE_LAND1 = KNA1-LAND1.
    SAVE_TELFX = KNB1-TLFXS.
    SAVE_ZSABE = KNB1-ZSABE.
    SAVE_INTAD = KNB1-INTAD.
    ELSE.
    SAVE_LAND1 = LFA1-LAND1.
    SAVE_TELFX = LFB1-TLFXS.
    SAVE_ZSABE = LFB1-ZSABE.
    SAVE_INTAD = LFB1-INTAD.
    ENDIF.
    IF SAVE_INTAD NE SPACE.
    FINAA-NACHA      = 'I'.                   "Ausgabe über Internet
    FINAA-INTAD      = SAVE_INTAD.
    FINAA-TEXTF      = 'PDF'.
    ELSEIF SAVE_TELFX NE SPACE.
    FINAA-NACHA      = '2'.                   "Ausgabe auf Fax
    FINAA-TDSCHEDULE = 'IMM'.
    FINAA-TDTELELAND = SAVE_LAND1.
    FINAA-TDTELENUM  = SAVE_TELFX.
    FINAA-TDFAXUSER  = SPACE.
    FINAA-NAMEP      = SAVE_ZSABE.
    FINAA-FORMC      = 'FI_FAX_COVER_A4'.
    FINAA-FORNR      = SPACE.
    ELSE.
    FINAA-NACHA = '1'. "Drucken
    ENDIF.
    * Daten zum Sendemedium merken für Aufrufer
    C_FINAA = FINAA.
    ENDFUNCTION.
    ______________________________________ OR _________________________________________
    To get the email id from the customer file.
      TYPE-POOLS szadr.
      DATA: l_addr1_complete TYPE szadr_addr1_complete,
            l_adsmtp_line    TYPE szadr_adsmtp_line,
            ld_smtp_addr type adr6-smtp_addr.
    * default: print payment advice
      c_finaa-nacha = '1'.
    *  Read mail address of customer from knb1-kunnr no is available 
      clear ld_smtp_addr
      IF NOT i_kna1-kunnr IS INITIAL and
                    not i_adr6-smtp_addr is initial.
        SELECT SINGLE smtp_addr
          INTO ld_smtp_addr
          FROM kna1
          where kna1-adrnr = adr6-addrnumber.
              IF NOT ld_smtp_addr IS INITIAL.
              c_finaa-nacha = 'I'.
              c_finaa-intad = ld_smtp_addr.
              ENDIF.
      ENDIF.
    *        IF sy-subrc = 0.
    **  choose message type 'I'nternet and fill email address
    *      c_finaa-nacha = 'I'.
    *    ENDIF.
    *  ENDIF.
    * check that address number is available
      IF NOT i_kna1-zadnr IS INITIAL.
    *   read complete address of vendor/customer
          CALL FUNCTION 'ADDR_GET_COMPLETE'
             EXPORTING
                  addrnumber     = i_kna1-zadnrada
             IMPORTING
                  addr1_complete = l_addr1_complete
             EXCEPTIONS
                  OTHERS         = 4.
          IF sy-subrc EQ 0.
    *     check that internet address is available
    *     READ TABLE l_addr1_complete-adsmtp_tab INTO l_adsmtp_line INDEX 1.   "Delete ECDK900445
                 READ TABLE l_addr1_complete-adsmtp_tab                                "Insert ECDK900445
                 INTO l_adsmtp_line "Insert ECDK900445
                 WITH KEY adsmtp-flgdefault = 'X'. "Insert ECDK900445
               IF sy-subrc EQ 0
               AND NOT l_adsmtp_line-adsmtp-smtp_addr IS INITIAL.
    *     choose message type 'I'nternet and fill email address
               c_finaa-nacha = 'I'.
               c_finaa-intad = ld_smtp_addr.
              ENDIF.
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    ( No output is going to the customer email address for the below steps )
    1. Generate spool requst ..
    2. Close_FORM ...will get the spool request
    3. RSPO_RETURN_SPOOLJOB will convet spool to OTF data
    4. Convet OTF data into PDF and send to mail.
    Try all sorts of programming  testing with the coding but  no result in SOST ( to send email it is asking to enter the email id , when the email is enter going the customer which is not correct  as there are bunches of account with different email address )
    Regards
    Piroz
    Message was edited by: Piroz Eslam

Maybe you are looking for