Sending Surveys in mail body

Hi gurus,
I have created  a survey format. Users can fill this surveys while they are closing the service orders. But instead of using WEB UI, I want to send them an e-mail including this survey in the mail body.
How can i do this?

This class has got following process types, which one should i use?
SET_VALUES     Transfer HTTP for Calculation of Current Survey Values
REMOVE_SECTION     Remove String Section from String
REMOVE_ENVELOPE     Remove WFF Envelope from Value XML
GET_XML     Fetching the Current Survey XML File
GET_VALUES     Fetching the Reference to a Current Value XML
GET_RATING     Calculates the Rating from the Values
GET_PRESENTATION     Fetching the Current HTML File
CALLBACK_PBO     Call Callback Routine to PBO
CALLBACK_PAI     Call Callback Routine to PAI
ASSURE_PUBLIC_VALUES     Generating the Public Values XML
ASSURE_INTERNAL_VALUES     Generating the Internal Value XML

Similar Messages

  • How to send data in mail body

    Hi experts,
    I can send all the data of internal table as attachment through mail. But requirement is to send all the data in mail body. No attachment should go with this mail. How to do this?
    Regards,
    Goutam Sahoo

    Hi Check this sample program. Clearly mentioned the body of the message .
    <pre>REPORT  zvenkat_mail_simple.
    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.
    "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.
    "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.
    "start-of-selection.
    START-OF-SELECTION.
      PERFORM send_mail.
      "Form  send_mail
      " PACKING LIST table requires information about how the data in the
      " tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to be
      " distributed to the documents and its attachments. The first row is
      " for the document, the following rows are each for one attachment.
    FORM send_mail .
      "Subject of the mail.
      w_document_data-obj_name  = 'MAIL_TO_HEAD'.
      w_document_data-obj_descr = 'Simple mail using SAP ABAP'.
      "Body of the mail
      PERFORM build_body_of_mail
        USING:space,
              'Hi,',
              'I am fine. How are you? How are you doing ? ',
              'This program has been created to send simple mail',
              'with Subject,Body with Address of the sender. ',
              'Thanks and Regards,',
              'Venkat.O,',
              'SAP HR Technical Consultant.'.
      "Write Packing List (Body)
      DESCRIBE TABLE i_body_msg LINES g_tab_lines.
      w_packing_list-head_start = 1.
      w_packing_list-head_num   = 0.
      w_packing_list-body_start = 1.
      w_packing_list-body_num   = g_tab_lines.
      w_packing_list-doc_type   = 'RAW'.
      APPEND w_packing_list TO i_packing_list.
      CLEAR  w_packing_list.
      "Fill the document data and get size of attachment
      READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
      w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
      "Receivers List.
      w_receivers-rec_type   = 'U'.  "Internet address
      w_receivers-receiver   = <give mail id here>.
      w_receivers-com_type   = 'INT'.
      w_receivers-notif_del  = 'X'.
      w_receivers-notif_ndel = 'X'.
      APPEND w_receivers TO i_receivers .
      CLEAR:w_receivers.
      "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_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.
        SUBMIT rsconn01 WITH mode = 'INT'
                     WITH output = 'X'
                     AND RETURN.
      ENDIF.
    ENDFORM.                    " send_mail
    "      Form  build_body_of_mail
    FORM build_body_of_mail  USING l_message.
      w_body_msg = l_message.
      APPEND w_body_msg TO i_body_msg.
      CLEAR  w_body_msg.
    ENDFORM.                    " build_body_of_mail</pre>
    Thanks
    Venkat.O

  • Sending Textmodule in email body text

    Hallo,
    can some body tell me how can I send a textmodule in email body with all of its fomats in a print program. I am successed to send email in print program. I read the text module in internal table but not able to import the formats of text module.
    can somebody help me
    regards
    waseem

    As a start, you can convert the ITF formatted text to HTML formatted text (using one of the available function modules) then send your e-mail body as type 'HTM'.  Otherwise, start from scratch and generate the HTML content yourself using CSS.

  • Create hyperlink for reply to in mail body while sending email.

    Hi All,
    We have a requirement where we need to create an hyperlink for reply to in the mail body.
    We have implemented entire functionality using CL_BCS classes and everything is working fine.
    Only problem we have is when we give document type as HTM instead of RAW then entire formatting of mail body gets disturbed although we get the hyperlink.
    Is there any way where we can send the mail in html format using CL_BCS,CL_DOCUMENT_BCS ?
    KR Jaideep,

    Hi ,
    Please find the code below I am using to make the hyperlink. Do I need to fill the entire mail body using HTML Tags ? If yes, then I guess it will increase the complexity of program as the mail content will vary from one mail to another depending upon whether different invoice documents have text maintained in them.
    lwa_text = '<html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '<body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = text-012.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        CONCATENATE '<a href="mailto:'
                    lv_receiver
                    '">'
                    lv_receiver
                    '</a>'
               INTO lwa_text.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        TRY.
            CALL METHOD cl_document_bcs=>create_from_text
              EXPORTING
                i_text         = li_text
                i_documenttype = 'HTM'
                i_subject      = 'Test for hyperlink'
                i_importance   = '1'
                i_sensitivity  = 'P'
              RECEIVING
                result         = lref_document_bcs.
          CATCH cx_document_bcs .
        ENDTRY.

  • How to send mail body using RE_CN_RA_INVOICE interface from RECPA520

    Hi ABAP Guru,
    I am using a standard interface RE_CN_RA_INVOICE for tcode RECPA520 for generating pdf form and send the corresponding PDF to  corresponding address maintained in Business Partner.The problem is mail is sending with attachment but there is no mail body.
    Please help

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • Hw to write txt in mail body using UTL mail when sending mail with attachme

    hi all
    i m using oracle demo mail package to send csv file as attachment to different users its successfull and i can also able to attach text file to it
    but i m unable to write any text in mail body .
    e.g.
    mail body can be--
    hi
    This is test mail.
    Regds
    Sender.
    can anyone suggest some way?

    u can try this code
    this code takes the file from database and attach with mail and also send the body with it
    it works fine.
    CREATE OR REPLACE
    procedure pdf_mail(
    p_sender varchar2, -- sender, example: 'Me '
    p_recipients varchar2, -- recipients, example: 'Someone '
    p_subject varchar2, -- subject
    p_text long, -- text
    p_case_id number,
    p_email_log_id number
    -- p_filename varchar2, -- name of pdf file
    p_blob   blob     pdf file
    ) is
    conn utl_smtp.connection;
    i number;
    len number;
    p_message_part varchar2(32767);
    cursor c1 is
    select file_name,document_pic
    from clm_case_attachments ca,email_log_detail em
    where
    case_id = p_case_id
    and ca.CASE_ATTACHMENT_ID = em.ATTACHMENT_ID
    and em.ACTIVE = 'Y'
    and em.EMAIL_LOG_ID = p_email_log_id;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE);
    demo_mail.attach_text(
    conn => conn,
    data => p_text,
    mime_type => 'text/html');
    for lp in c1 loop
    demo_mail.begin_attachment(
    conn => conn,
    mime_type => 'application/pdf',
    inline => TRUE,
    filename => lp.file_name,
    transfer_enc => 'base64');
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(lp.document_pic);
    WHILE (i < len) LOOP
    IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    end loop;
    demo_mail.end_mail( conn => conn );
    END;
    /

  • How to put mail body while sending Payment Advice Note by mail

    Hi,
    I am sending payment advice form through mail using the BTE 2040.
    Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
    I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
    E.g
    Hello,
    Please find the payment advice note as an attachment.
    Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
    Kindly help.
    Regards
    Sachin Yadav

    Hi,
    I am sending payment advice form through mail using the BTE 2040.
    Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
    I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
    E.g
    Hello,
    Please find the payment advice note as an attachment.
    Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
    Kindly help.
    Regards
    Sachin Yadav

  • Send mail using cl_bcs. need text in mail body

    Hi friends,
    please provide me some solution to send mail with out attachment and the message should only be in mail body.
    Code :
    TRY.
    *     -------- create persistent send request ------------------------
            send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create document from internal table with text
            CLEAR lv_const.
            CONCATENATE 'Dear' gs_cust-name1 ',' INTO lv_const SEPARATED BY space.
            APPEND lv_const TO text.
            CLEAR lv_const.
            CONCATENATE 'at' gs_cust-new_date 'planned delivery for you with following items:'
                        INTO lv_const SEPARATED BY space.
            APPEND lv_const TO text.
            l_space = '                                       ' .
            APPEND l_space TO text .
            CLEAR : gs_mat,
                    lv_const.
            CLEAR l_quan.
            LOOP AT gt_mat INTO gs_mat WHERE new_date = gs_cust-new_date.
              l_quan = gs_mat-zmeng.
              CONCATENATE gs_mat-matnr gs_mat-maktx l_quan INTO lv_const SEPARATED BY space.
              APPEND lv_const TO text.
              CLEAR :
                      lv_const.
            ENDLOOP.
            l_space = '                                       ' .
            APPEND l_space TO text .
            APPEND 'Please contact with us if you confirm whether above products are' TO text.
            CLEAR lv_const.
            CONCATENATE 'required on' gs_cust-new_date 'with specified quantity.'
                        INTO lv_const SEPARATED BY space .
            APPEND lv_const TO text.
            APPEND 'You can contact with us via e-mail:xxxxxx or via' TO text.
            APPEND 'phone +xxxxxxxxxxxxxx' TO text.
            l_space = '                                       ' .
            APPEND l_space TO text .
            APPEND 'Best regards' TO text.
            APPEND 'Linde Central Logistic Team' TO text.
            lo_document = cl_document_bcs=>create_document(
                            i_type    = 'RAW'
                            i_text    = text
    *                        i_length  = '12'
                            i_subject = 'test mail' ).
    *     add document to send request
            CALL METHOD send_request->set_document( lo_document ).
    *     --------- add recipient (e-mail address) -----------------------
    *     create recipient - please replace e-mail address !!!
            recipient = cl_cam_address_bcs=>create_internet_address(
                                              'address' ).
    *     add recipient with its respective attributes to send request
            CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient = recipient
                i_express   = 'X'.
    *     ---------- send document ---------------------------------------
              CALL METHOD send_request->send(
                EXPORTING
                  i_with_error_screen = 'X'
                RECEIVING
                  result              = sent_to_all ).
              COMMIT WORK.
    *  Send Immediately
              send_request->set_send_immediately( i_send_immediately = 'X' ).
          CATCH cx_bcs INTO bcs_exception.
            WRITE: text-001.
            WRITE: text-002, bcs_exception->error_type.
            EXIT.
        ENDTRY.
    Please provide me the solution if i am missing any thing.
    Thanks,
    Kat

    thank you for looking into this thread,
    i have configured the in scot.
    currently sending all RAW type as TXT. this has resolved my issues.

  • Send mail with picture in mail body

    Hi Experts,
    How to send mail with picture in mail body area? ( Note : not as an attachment. )
    Eg:
    ......Header image.....  <<------ I want to insert image here
    Dear user,
    You have received a notification.
    ..... Footer image .....   <<------ I want to insert image here 
    Note : If user opened mail then user can able to see the image.
    Thanks in advance.
    Regards,
    Harish

    Hi Harish,
    Please visit these links:
    1. Embed the picture instead of Linking in Mail forms
    2. Send HTML mail with image
    3. http://sap.ittoolbox.com/groups/technical-functional/sap-dev/html-format-email-528045
    May it helps you.
    Regards.
    Deepak Sharma

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • Send an smartform as body of a mail

    Hello,
    I would like know if there is another way of doing this: "Send an smartform as body of a mail". Now it is sending attached as pdf but the user prefers to view the smartform on the body of the message.
    This is a CS formulary and I think that (perhaps) at the options of  "output_options     TYPE ssfcompop," should be another of this.
    Thanks

    I have included our code to process/send our smartform via email. you should be able to see the solution in there.....
    form process_webform
    * activate XSF Output Mode
      ls_output_options-xsf        = c_charx.        " XSF Output active
      ls_output_options-xsfcmode   = c_charx.        " Get XSF params from program
      ls_output_options-xsfoutmode = c_application.  " Application
      ls_output_options-xsfformat  = c_charx.       " Formatting ON
      clear ls_output_options-xsfoutdev.
      ls_xsfparam_line-name  = 'GRAPHICS'.
      ls_xsfparam_line-value = 'EXTRACT'.
      append ls_xsfparam_line to ls_output_options-xsfpars.
      ls_xsfparam_line-name  = 'GRAPHICS-DIRECTORY'.            "#EC NOTEXT
      ls_xsfparam_line-value = c_gr_dir.
      append ls_xsfparam_line to ls_output_options-xsfpars.
      ls_xsfparam_line-name  = 'CONTENT-ID'.                    "#EC NOTEXT
      ls_xsfparam_line-value = 'ENABLE'.                        "#EC NOTEXT
      append ls_xsfparam_line to ls_output_options-xsfpars.
    * silent mode ON
      ls_output_options-tdimmed = space.
      ls_output_options-tdnewid = space.
      ls_control_parameters-no_dialog = c_charx.
      call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname           = pi_form
        importing
          fm_name            = l_fm_name
        exceptions
          no_form            = 1
          no_function_module = 2
          others             = 3.
      if sy-subrc <> 0.
    *   error handling
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
      call function l_fm_name
        exporting
          control_parameters = ls_control_parameters
          output_options     = ls_output_options
          user_settings      = space
        importing
          job_output_info    = ls_output_data
        exceptions
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          others             = 5.
      if sy-subrc <> 0.
    *   error handling
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      po_html       = ls_output_data-xmloutput-trfresult.
      po_t_graphics = ls_output_data-xmloutput-xsfgr.
    endform.                    "process_webform
    form send_webform
      clear l_html_xstr.
      loop at pi_s_html-content into l_html_raw.
        concatenate l_html_xstr l_html_raw into l_html_xstr in byte mode.
      endloop.
      l_html_xstr = l_html_xstr(gs_html_data-length).
      call function 'SCP_TRANSLATE_CHARS'
        exporting
          inbuff       = l_html_xstr
          incode       = '4110'                                 " utf-8
          csubst       = c_charx
          substc_space = c_charx
        importing
          outbuff      = l_html_str
          outused      = l_html_len
        exceptions
          others       = 1.
      if sy-subrc ne 0.
        "do nothing
      endif.
    * change encoding utf-8 to latin1
      replace all occurrences of 'utf-8' in l_html_str with 'latin1' ignoring case.
      replace all occurrences of 'absolute' in l_html_str with 'relative' ignoring case.
      replace all occurrences of 'overflow : auto'
                  in l_html_str with 'overflow : hidden' ignoring case.
    * The following code will replace the standard text shown in an html link
    * such as (www.sap.com) with the text passed along with the link (contained in
    * brackets [ ] ).  An example would be: "www.sap.com[Click me]" will then be
    * displayed as a link on the email with "... Click me ..." as the text.  HTML links
    * without brackets will be displayed normally (ie. www.sap.com)+
      do.
    *   Get the length for the entire HTML code for the URL and Name
        find '<a href="' in section offset l_aref_end of l_html_str match offset l_aref_start.
        if sy-subrc ne 0.
          exit.
        endif.
        find '</a>' in section offset l_aref_start of l_html_str match offset l_aref_end.
        l_aref_length = ( l_aref_end + 4 ) - l_aref_start.
    *   Find the URL/name
        l_lnk_start = l_aref_start + 9.
        find '">' in section offset l_aref_start of l_html_str match offset l_lnk_end.
        l_lnk_length = l_lnk_end - l_lnk_start.
    *   Save the URL/name
        l_link_all = l_html_str+l_lnk_start(l_lnk_length).
    *   Find where the name starts and ends
        find '[' in l_link_all match offset l_name_start.
        if sy-subrc ne 0.
          continue.
        endif.
        find ']' in l_link_all match offset l_name_end.
        if sy-subrc ne 0.
          continue.
        endif.
    *   Seperate out the URL
        l_link_url = l_link_all+0(l_name_start).
    *   Seperate out the name
        l_name_start = l_name_start + 1.
        l_name_length = l_name_end - l_name_start.
        l_link_name = l_link_all+l_name_start(l_name_length).
    *   Replace the first URL/Name occurence with just the URL
        replace first occurrence of l_link_all
                in section offset l_aref_start length l_aref_length
                of l_html_str with l_link_url.
    *   Replace the second URL/Name occurence with just the Name - first
    *   substitute special characters.
        replace all occurrences of '&' in l_link_all with '&'.
        replace all occurrences of '>' in l_link_all with '>'.
        replace all occurrences of '<' in l_link_all with '<'.
        replace first occurrence of l_link_all
                in section offset l_aref_start length l_aref_length
                of l_html_str with l_link_name.
    *   Reset ending point
        l_aref_end = l_aref_end - ( l_lnk_length + 2 ).
      enddo.
      l_html_len = strlen( l_html_str ).
      l_offset = 0.
      l_length = 255.
      while l_offset < l_html_len.
        l_diff = l_html_len - l_offset.
        if l_diff > l_length.
          ls_soli-line = l_html_str+l_offset(l_length).
        else.
          ls_soli-line = l_html_str+l_offset(l_diff).
        endif.
        append ls_soli to lt_soli.
        add l_length to l_offset.
      endwhile.
      create object lo_mime_helper.
      call method lo_mime_helper->set_main_html
        exporting
          content = lt_soli.
      loop at pi_t_graphics into gs_graphic.
        clear l_gr_xstr.
        loop at gs_graphic-content into l_gr_raw.
          concatenate l_gr_xstr l_gr_raw-line into l_gr_xstr in byte mode.
        endloop.
        l_gr_xstr = l_gr_xstr(gs_graphic-length).
        l_offset = 0.
        l_length = 255.
        clear lt_solix[].
        while l_offset < gs_graphic-length.
          l_diff = gs_graphic-length - l_offset.
          if l_diff > l_length.
            ls_solix-line = l_gr_xstr+l_offset(l_length).
          else.
            ls_solix-line = l_gr_xstr+l_offset(l_diff).
          endif.
          append ls_solix to lt_solix.
          add l_length to l_offset.
        endwhile.
        concatenate c_gr_dir gs_graphic-graphics '.bmp' into l_filename.
        concatenate c_gr_dir gs_graphic-graphics '.bmp' into l_content_id.
        l_content_type = gs_graphic-httptype.
        l_obj_len      = gs_graphic-length.
        call method lo_mime_helper->add_binary_part
          exporting
            content      = lt_solix
            filename     = l_filename
            extension    = 'BMP'
            content_type = l_content_type
            length       = l_obj_len
            content_id   = l_content_id.
      endloop.
      try.
          l_standard_txt = pi_smartform.
          call function 'READ_TEXT'
            exporting
              id       = 'ST'
              language = sy-langu
              name     = l_standard_txt
              object   = 'TEXT'
            tables
              lines    = lt_lines.
          read table lt_lines into ls_lines index 1.
          replace '&1' in ls_lines-tdline with pi_belnr.
          replace '&2' in ls_lines-tdline with pi_bukrs.
            move ls_lines-tdline to l_subject.
         lo_doc_bcs = cl_document_bcs=>create_from_multirelated(
                                        i_subject          = l_subject
                                        i_multirel_service = lo_mime_helper ).
    * Add Attachment
    *      types: begin of email_docs,
    *                   type    type so_obj_tp,
    *                   subject type so_obj_des,
    *                   content_text type soli_tab,
    *                   content_hex  type solix_tab,
    *             end of email_docs.
    *      types: email_docs_t type standard table of email_docs.
    *      data: documents type        email_docs_t,
    *      documents_line like line of documents.
    *      data: soli_tab type soli_tab,
    *            soli type soli.
    *      soli = 'This is line one'.
    *      append soli to soli_tab.
    *      soli = 'And this is line two'.
    *      append soli to soli_tab.
    *      documents_line-type = 'RAW'.
    *      documents_line-subject = 'Subject'.
    *      documents_line-content_text = soli_tab.
    *      append documents_line to documents.
    *      call method lo_doc_bcs->add_attachment
    *        EXPORTING
    *          i_attachment_type    = documents_line-type
    *          i_attachment_subject = documents_line-subject
    *          i_att_content_text   = documents_line-content_text.
        catch cx_document_bcs.
    *   error handling
          exit.
        catch cx_bcom_mime.
    *   error handling
          exit.
        catch cx_gbt_mime.
    *   error handling
          exit.
      endtry.
    * create send_request
      try.
          lo_bcs = cl_bcs=>create_persistent( ).
        catch cx_send_req_bcs.
    *   error handling
          exit.
      endtry.
      try.
          lo_bcs->set_document( i_document = lo_doc_bcs ).
        catch cx_send_req_bcs.
    *   error handling
          exit.
      endtry.
    * create recipient
      if pi_recipient ns '@'.
        l_username = pi_recipient.
        translate l_username to upper case.                     "#EC *
        try.
            lo_recipient = cl_sapuser_bcs=>create( l_username ).
          catch cx_address_bcs.
    *     error handling
            exit.
        endtry.
      else.
        l_mail_address = pi_recipient.
        try.
            lo_recipient = cl_cam_address_bcs=>create_internet_address( i_address_string = l_mail_address ).
          catch cx_address_bcs.
    *     error handling
            exit.
        endtry.
      endif.
      try.
          lo_bcs->add_recipient( i_recipient = lo_recipient ).
        catch cx_send_req_bcs.
    *   error handling
          exit.
      endtry.
    * send
      try.
    *     RECEIPTS ONLY FOR ERRORS
          call method lo_bcs->send_request->set_requested_status
            exporting
              i_requested_status = 'N'.                         "#EC NOTEXT
          lo_bcs->send( ).
          commit work.
        catch cx_send_req_bcs.
    *   error handling
          exit.
      endtry.
    endform.                    "send_webform

  • In send mail body of text all commas r displayed as Dots and all dots as co

    Hi Experts,
                      I am sending sales order details in mail but when it reaches the users outlook mail box all
    commas are displayed as dots and all dots are displayed as commas.
    Work flow body
    Sales Order No : &BUS2032.SALESDOCUMENT&
    Customer No : &BUS2032.ORDERINGPARTY.CUSTOMERNO&
    Sales Organization : &BUS2032.DISTRIBUTIONCHAIN.SALESORGANIZATION&
    Sales Division : &BUS2032.SALESANDDISTRIBAREA.DIVISION&
    Total Credit Limit  : &CREDITLIMIT&
    Available Credit Limit  : &AVL_CREDITLIMIT&
    Present Order Value : &BUS2032.NETVALUE&
    Mail body Display
    Credit Limit exceeded By  22.221.456.873,75-
    Sales Order No : 262
    Customer No : 300000
    Sales Organization : 1000
    Sales Division : 10
    Total Credit Limit  : 12.000.000,00
    Available Credit Limit  : 765.286,25
    Present Order Value : 22.222.222.160,00
    Please tell me how to resolve this issue.
    Regards,
    Hari

    Hi,
    this is the "Defaults" settings of the user.
    Go to SU3 and in the "Defaults" tab, choose your choice.
    Hope this solves your issue
    venu

  • Apply color in send mail body part

    Hi SAP Gurs,
    I am creating program for sending mail to user.. in that mail i so many header and line item are there, i want to apply color or bold, italic format in body part.... so its look like seprate in body part
    So is there any possibilty to apply color or bold words in mail body part?
    Please help me......
    Thanks zeni

    You can use the HTML text in the Message body part to get the Colors, Bold, Italics like effect in the mail.
    Please refer my answer in this post.
    formating possible in sending mail program
    Regards,
    Naimesh Patel

  • Prob in getting Mail body for the standard tcode F150(Dunning).

    Hello all,
    I am using F150 for the dunning notice print out.After seeing the display of the dunning notice once we come back it populates a popup window where it asks to send the mail to the particular mailid or not. I have used the BTE ---  SAMPLE_PROCEE_00001040 and copied it as z function module and customised according to my requirement in order to get the mail id of the customer in the pop up.My mail is going to the customers mail id properly only but my prob is that we are not able to get any mail body for that particular mail.Where can we add the mail body text to that mail in the standard tcode f150.can any one suggest is it possible or not.
    Regards,
    Pavani.
    Edited by: Pavani Rayappureddi on Aug 11, 2009 11:21 AM

    solved my self.
    added         C_ITCPO-TDTITLE  = 'Pending Receivables Statement-XXX GROUP'.
    in the bte code.

  • Can I send an E-Mail with photo (not as an attachment)?

    I would like to send an E-Mail with a small photo (not as an attachment) to someone who is reluctant to open attachments. Can I do this and how??
    Thank you
    tch

    If you insert an image into the body, it will still be 'attached', even though it won't be listed as an attachment in the usual way. Another option is to upload the photo to your personal storage space such as OneDrive or Google Drive, and then email the link to the image. The image can then be displayed in a web browser. If you don't have a storage space, there are plenty of free image-hosting services.

Maybe you are looking for

  • Incoming payment by F-28: Reason code error while posting

    Hello everyone, I want to post Incoing Payment using F-28 net of TDS. I want the separate GL account to be picked up automatically for the difference when I enter the Reason Code 003. I did the following customization for the same. 1. Financial Accou

  • Calling the smartform based on checkbox selection in ALV

    Hi i displayed the report output in ALV using 'REUSE_ALV_GRID_DISPLAY'. I maintained checkboxes as first column of data. and i also added three user defined buttons like check,uncheck,print form. Now my problem is when user selecting the records in A

  • Help. Can't download the app!

    Getting 'There seems to be a problem with the download process . . . Error Code 201. Any help please? Using windows 7.

  • Sales Order Delivery Shipment

    Hi All, Could somebody please explain the need for the above mentioned chain of documents with reference to LES in R/3. What is the essence of each one of them: Sales Order>Delivery>Shipment Where does a transfer order fit in between the three? regar

  • Stuck on headphone mode and no headphones are connected

    my phone is stuck on headphone mode there i have no sound unless i plug in head phones