Fax Email or Print customer statements (F.27)

Hi. I am new to the forums. I have a user requirement to setup SAP to be able to send customer statements via email if email address is populated. If not, send via fax if fax number is populated. Otherwiese print. I have read a few threads that address this issue but I would need a description of how to do this from scratch. Does anyone have such documentation and is this request even possible? I am not a programmer so every detail would be very helpful. Thanks in advance for any information.

Srini,
Email id won't be populated automatically. You need to populate the email id as well in the BTE from KNB1 or LFB1. In customer master or vendor master correspondence data, maintain the email id in ‘Clrk’s internet’ field and KNB1 & LFB1 are available in this BTE. Sample code should be something like this.
* Check whether email id is maintained.
        IF NOT i_knb1-kunnr IS INITIAL AND
           NOT i_knb1-intad IS INITIAL.
*Pass email address of clerk in company code view of customer
          c_finaa-intad = i_knb1-intad.
          c_finaa-nacha = 'I'.
          c_finaa-textf = 'PDF'.
        ELSEIF NOT i_lfb1-lifnr IS INITIAL AND
               NOT i_lfb1-intad IS INITIAL.
*Pass email address of clerk in company code view of vendor
          c_finaa-intad = i_lfb1-intad.
          c_finaa-nacha = 'I'.
          c_finaa-textf = 'PDF'.
        ELSE.
*Do nothing. Since email id is not maintained, spool will be created.
        ENDIF.
Regards,
Gokul

Similar Messages

  • Printing Customer Statements

    Hello,
    I am trying to print customer statements but the system send them to the spool first. I can print them from there but I would rather the print directly from transaction F.61. is there a checkbox or something somewhere I have overlooked to enable this?
    Thanks,
    Justin

    If anyone else has this problem I have found the solution. In the Print programs which usually befin with RFKORD the variant (in this case SAP13) assigned also needs to be configured with a printer and check the print immediately button

  • F.27 - Fax or Print Customer Statements

    Hello Gurus-
    I have searched high and low in the forum and could not find a solution.  How do you email Customer Statements?  I know how to email Invoices by maintaining email address via Customer Master Data but I thought the same would be true for Customer Statement.  I could not get it to work.
    Thank you!!

    HI
    Develop business transaction event (BTE). ABAPERS will do this.
    Regards,
    Azeem.

  • Printing customer statement after creation

    Hello expert
    When a new customer is created we want to print a statement of this new customer to be sent to him (customer name, address, pricing condition, payment terms....)
    Is it possible to have a print lay out defined from the customer data screen and that is enable to print a document (Like creating a sales document) ?

    You can create a crystal report that you can print from the BP reports menu

  • BP reference not printing on customer statements

    Hi,
    We are facing this issue on one of our customer installation. When we print Customer statement for multiple customers, it does not print "BP reference no." however if you run the statement one customer at a time it prints the "BP reference no". They are using SAP 2007A PL 42.
    Any help on this would be much appreciated.
    Regards
    Dave

    Hi,
    Please check Note No.  [1248669|https://websmp130.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1248669] regarding the issue mentioned by you.
    Hope it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Customer Statement with Consolidating BP

    If Invoice is posted to Customer who is attached to a Consolidating BP, posting of Invoice is posted to Consolidating BP only and Customer Statement does not show this Invoice for the specific Customer BP except appear in the name of Consolidating BP even if the link to Consolidating BP is removed subsequently.  New posting of Invoice to Customer after removing Consolidating BP will be posted to specific Customer but not reflected in Consolidating BP.  This has been acknowledged by SAP as a limitation as most payments received is usually payable to Consolidating BP for all related Customers.
    Kedalene Chong

    Hi Peter
    I think there is some misunderstanding as this message is different from the one about Currency.
    We need to be able to print Customer Statement by both Consolidate BP and specific Customers related to the same Consolidate BP.  Please refer to SAP Message 690264/2007
    Kedalene Chong

  • Balance Brought Forward Customer Statement

    Hi there, everyone
    Our company would like to print customer statements in a balance brought forward format. By "Balance Brought Forward" I mean that the statement starts with an Opening Balance (being the previous month's closing balance), then reflects all receipts (not applications), invoices, credit memos, debit memos, adjustments and discounts and then totals to a closing balance. It would also be ideal if a payment schedule could be printed detailing what portion of the final balance is due on what dates.
    We are still on 10.7NCA, so if this functionality is available in 11 or 11i, please will someone let me know. Otherwise, if there is anyone out there who has done this, please can you send me some pointers.
    Regards
    Mark

    Hello,
    This issue should be solved in 2007 A / 2007 B version. Please clarify to which version you are referring.
    Thanks for the input.

  • Customer Statement in Balance Forward Format

    Have Oracle introduced a customer statement in a Balance Brought Forward format as yet? We need the ability to print customer statements comprising:
    (a) An opening balance (being the previous period's closing balance)
    (b) Details of all credit memos, debit memos, invoices, adjustments, etc for the current period
    (c) Receipts (as opposed to individual applications) i.e. if a customer pays $1000 in respect of 2 invoices of $500 each, a single entry displaying a credit of $1000 should appear on the statement
    (d) A closing balance for the period
    Additionally, it would be ideal if a payment schedule (indicating what potion of the balance is due when) could also be displayed on the statement (e.g. if the customer's balance is $1500; $700 may be due on 31-AUG, $500 may be due on 30-SEP and the balance may be due on 31-OCT.
    We are still on 10.7NCA and I was wondering whether anyone knows whether this has since been implemented and, if not, whether there are plans to implement this. We have become so frustrated with not been able to do this that we are considering re-implementing a system that will provide this functionality.
    null

    Just to add to my question and be more specific -
    On the customer recieveable ageing - I would like to add the rest of the address field as it only pull out the first line. Is there any way I can refresh the tables with the addtional field?
    I found the PLD convertor is useful as I was able to add the field in for the address and then convert into the converted PLD2CR However the SAP format in crystal looks much neater and visually better looking than the PLD version.
    I would like to add the address fields into the Crystal Report Version so It shows the complete address.
    I have checked all the versions from SAP 8.8 PL 13 up to 8.81 PL09 and all only show the first line of the address for the customer.
    Any suggestions would be greatly appreciate as to how I could get them in.
    thanks
    Paul

  • Customer statement issue - reg.

    Dear All,
                When the user executes f.27 to print customer statements in a batch,  the statement with negative balance is picking up positive balance from the previous invoice with positive balance.  When i tried the same for different customers I didnt get any error.  Kindly advice me in this regard.
    Regards,
    P.Krishna Chaitanya.

    Dear P.Krishna Chait...      
    please check your corespondence under control tab .(what you given is it relevant to your requirement. mostly we use SAP06 account statement
    Regards
    shankar

  • Correspondance for customer statements F.27

    Dear all
    I am trying to select a standard form to print customer statements but it is not working. I think it is something not correct in customising. Can anyone send me the steps to do this please.
    Also when using F.27 I cannot print all the selected customers together but promts me to select a printer for each customer statement with the wrong form being desplayed in the spool.
    Thanks
    PRG

    Try to execute RFKORD11 for customer statement to see how it turns out.
    Go through the steps in this menu path:  IMG u2013 Fin.Acctu2019g u2013 Fin. Acctu2019g Global Settings u2013 Correspondence
    Correspondence SAP06 is used in standard program but you may need to define your own form.

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

  • Customer Statement using SAP Script and Standard print program RFKORD10

    Using sap script and standard print program RFKORD10 I need to create a customer statement where the main window will be as follows
    Invoice #     InvoiceDate  CustomerPO  Debit Amt  Credit Amt  Total
        6        7           8               9               10               11
        6        7           8               9               10               11
                                     Totals               12             13              14
    Where company code BKORM-KUKRS
                Invoice              BSID-BELNR
                Invoice date      BSID-BLDAT
                Customer PO    VBKD-BSTKD
    For each document number selected there will be one to many records in VBRP.  For each invoice item in VBRP:
    u2022     Select BSTKD from VBKD where
    o     VBELN = VBRP-VGBEL and
    o     POSNR = VBRP-VGPOS
    u2022     If no hits then select BSTKD from VBKD where
    o     VBELN = VBRP-VGBEL
    If there is more than one PO per invoice then list them in the Customer PO field without repeating the other fields.PO shouldnu2019t come more than once per invoice.
                 Debit Amt         if BSEG-SHKZG = S then WRBTR ELSE 0
                 Credit Amt        if BSEG-SHKZG = H then WRBTR ELSE 0
                 Total                  Debit Amt u2013 Credit Amt
                  Totals                Subtotals
    It will be of great help if some one can help me with the script and the alterations required in standard print program RFKORD10
    Points will b rewarded for sure.
    Thanks.

    Hi Suganya,
    The custom form is getting displayed properly. But the requirement is to have it as an editable PDF. So the functional team is working on configuring the settings of PDF forms with customers email address.
    But for right now, i customized the standard form F140_ACC_STAT_01 and standard print program RFKORD10_PDF and did the configuration. It is getting displayed (I tested only with the transaction FBL5N - customer open line items..)
    Please let me know any further details on this.
    Poornima

  • 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 Statement email determination

    I need to flag/identify from the customer master record if a cucstomer statement will be printed or emailed.  I have a customized print process based on F.27 program.  I will have a set of customers that have the SAPScript form printed via the spool (already in place), and want to run a second set of customers that have the statements emailed via a PDF document (which customized process builds).   Can you help me identify a place to set and read a "master flag" on the customer to differentiate  the print type (email vs. print)?

    You can use 'Additional data' in customer master which SAP provided for customers to use for their own.
    Go to XD02 - under general data - Extras - Additional data. You can rename these fields using field exits and use them.

Maybe you are looking for

  • How do I add a field into an existing form in SharePoint Designer 2010 and...?

    I'm trying to add an existing field to an existing form in SharePoint Designer 2010. It's a URL to the employee's photo. But each time I try to "Insert as picture" the url to the photo has a trailing comma. Why and more importantly, how do I get rid

  • I just ordered a macbook mc207ll/a  online that is running Sow leopard, will I be able to upgrade to yosemite?

    I just ordered a macbook mc207ll/a  online that is running Sow leopard, will I be able to upgrade to yosemite?

  • "Script Alert" cannot upload files

    I am using Photoshop CC 64bit. I used the program yesterday and worked like normal. Tried to use the Scripts image processor and it gave me this warning. I keep trying it and sometimes some files work but I still can't open them up. What can I do?

  • Firefox hello is not available im the Mobile version

    I am not able to find Firefox hello icon in the mobile version of Firefox browser. Is Firefox hello available for android? If so where to find the icon?

  • Illustrator CS/intel mac 異常終了

    こんにちは.使用環境 Illustrator CS / mac pro quad2.66 / mac OS 10.4.10 なのですが. 使用中のツールから.パスファインダーや.整列などのツールへパレットをから選択して使用した場合に Illustrator CS が異常終了してしまいます.たちの悪い事にどのタイミングで発生するのかいまいち」はっきりしないのです! 再インストールや.環境設定の削除なども試みましたがだめでした. 出力機の関係でCSをまだしばらくは使いたいのですが改善の余地はあるので