Populate body of the mail when smartform is triggered.

Hi Guru's,
i have configured the smartform, and when i execute the transaction the smartform is being triggered and i am getting the smartform as pdf in a mail.
i want to populate the body of the mail. i am not using the function modules like to convert smartform to pdf then triggering mail. it is triggering from output options.
how to poulate the body of the mail
Best regards,
Chetan.

Hello all,
I recently did an object which sends an email with the body.
Step 1.
Do not send the email directly by SAP functionality using smartform function module.
Set the parameter control_parameters-getotf    = 'X' of the smartform function module.
step 2.
Use function module CONVERT_OTF
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                      = 'PDF'
    IMPORTING
      bin_filesize                = lf_bin_filesize
     BIN_FILE                    =
    TABLES
      otf                         = gs_job_output_info-otfdata
      lines                       = gt_lines
    EXCEPTIONS
      err_max_linewidth           = 1
      err_format                  = 2
      err_conv_not_possible       = 3
      err_bad_otf                 = 4
      OTHERS                      = 5.
Step 3
Use function module QCE1_CONVERT
  CALL FUNCTION 'QCE1_CONVERT'
    TABLES
      t_source_tab = gt_lines
      t_target_tab = outbin.
Step 3.
Fill up the details for Email Body + Attachment for the function module SO_NEW_DOCUMENT_ATT_SEND_API1
internal table objtxt will have body of email (txt format)
  DESCRIBE TABLE objtxt LINES tab_lines.
  READ TABLE objtxt INDEX tab_lines.
  docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
  CLEAR objpack-transf_bin.
  objpack-head_start = 1.
  objpack-head_num = 0.
  objpack-body_start = 1.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'HTM'.       
APPEND objpack.
Packing Info Attachment
  att_type = 'PDF'
  DESCRIBE TABLE objbin LINES tab_lines.
  READ TABLE outbin INDEX tab_lines.
  objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
  objpack-transf_bin = 'X'.
  objpack-head_start = 1.
  objpack-head_num = 0.
  objpack-body_start = 1.
  objpack-body_num = tab_lines.
  objpack-doc_type = att_type.
  objpack-obj_name = 'ATTACHMENT'.
  objpack-obj_descr = 'description'.
  APPEND objpack.
  docdata-obj_name  = name.
  docdata-obj_descr = description.
step 4 :- use function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data = docdata
      put_in_outbox = '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
      document_type_not_exist = 3
      operation_no_authorization = 4
      parameter_error = 5
      x_error = 6
      enqueue_error = 7
      OTHERS = 8.
Hope this helps. Let me know if you have any questions

Similar Messages

  • Sending the mail through Smartform

    Hello All,
    This is the function module used to send a mail from the smartform----
    "SSFCONVERT_OTF_AND_MAIL" .
    Can you please tell me the values for the required parameters from this function module.
    Importing parameters for MAIL_SENDER
    OBJTYPE
    OBJKEY
    DESCRIBE
    What are the values to be passed for these parameters.
    We have only option for printing the smartform. I have to send this even to mail. How can i send this.
    <REMOVED BY MODERATOR>
    Thanks,
    Karan
    Edited by: Alvaro Tejada Galindo on Jun 5, 2008 10:37 AM

    Hi,
    Please check this link
    https://www.sdn.sap.com/irj/sdn/wiki
    *& Report ZTEST_PDF_MAIL
    REPORT ZTEST_NREDDY_PDF_MAIL.
    * Internal Table declarations
    DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
    I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
    I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
    I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    * Objects to send mail.
    I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    * Work Area declarations
    WA_OBJHEAD TYPE SOLI_TAB,
    W_CTRLOP TYPE SSFCTRLOP,
    W_COMPOP TYPE SSFCOMPOP,
    W_RETURN TYPE SSFCRESCL,
    WA_DOC_CHNG TYPE SODOCCHGI1,
    W_DATA TYPE SODOCCHGI1,
    WA_BUFFER TYPE STRING, "To convert from 132 to 255
    * Variables declarations
    V_FORM_NAME TYPE RS38L_FNAM,
    V_LEN_IN LIKE SOOD-OBJLEN,
    V_LEN_OUT LIKE SOOD-OBJLEN,
    V_LEN_OUTN TYPE I,
    V_LINES_TXT TYPE I,
    V_LINES_BIN TYPE I.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZTEST'
    IMPORTING
    FM_NAME = V_FORM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    W_CTRLOP-GETOTF = 'X'.
    W_CTRLOP-NO_DIALOG = 'X'.
    W_COMPOP-TDNOPREV = 'X'.
    CALL FUNCTION V_FORM_NAME
    EXPORTING
    CONTROL_PARAMETERS = W_CTRLOP
    OUTPUT_OPTIONS = W_COMPOP
    USER_SETTINGS = 'X'
    IMPORTING
    JOB_OUTPUT_INFO = W_RETURN
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I_OTF[] = W_RETURN-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    IMPORTING
    BIN_FILESIZE = V_LEN_IN
    TABLES
    OTF = I_OTF
    LINES = I_TLINE
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
    LOOP AT I_TLINE.
    TRANSLATE I_TLINE USING '~'.
    CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
    ENDLOOP.
    TRANSLATE WA_BUFFER USING '~'.
    DO.
    I_RECORD = WA_BUFFER.
    APPEND I_RECORD.
    SHIFT WA_BUFFER LEFT BY 255 PLACES.
    IF WA_BUFFER IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    * Attachment
    REFRESH: I_RECLIST,
    I_OBJTXT,
    I_OBJBIN,
    I_OBJPACK.
    CLEAR WA_OBJHEAD.
    I_OBJBIN[] = I_RECORD[].
    * Create Message Body Title and Description
    I_OBJTXT = 'test with pdf-Attachment!'.
    APPEND I_OBJTXT.
    DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
    READ TABLE I_OBJTXT INDEX V_LINES_TXT.
    WA_DOC_CHNG-OBJ_NAME = 'smartform'.
    WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
    WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
    WA_DOC_CHNG-SENSITIVTY = 'F'.
    WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    * Main Text
    CLEAR I_OBJPACK-TRANSF_BIN.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    I_OBJPACK-BODY_NUM = V_LINES_TXT.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    APPEND I_OBJPACK.
    * Attachment (pdf-Attachment)
    I_OBJPACK-TRANSF_BIN = 'X'.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
    READ TABLE I_OBJBIN INDEX V_LINES_BIN.
    I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
    I_OBJPACK-BODY_NUM = V_LINES_BIN.
    I_OBJPACK-DOC_TYPE = 'PDF'.
    I_OBJPACK-OBJ_NAME = 'smart'.
    I_OBJPACK-OBJ_DESCR = 'test'.
    APPEND I_OBJPACK.
    CLEAR I_RECLIST.
    I_RECLIST-RECEIVER = 'reddy at gmail'.
    I_RECLIST-REC_TYPE = 'U'.
    APPEND I_RECLIST.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    COMMIT_WORK = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    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.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
      If you want to send some text as Body of the Mail then follow this once
    when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
    1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
    2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
    I_OBJPACK-TRANSF_BIN = ' '.
    I_OBJPACK-HEAD_START = 000000000000001.
    I_OBJPACK-HEAD_NUM = 000000000000001.
    I_OBJPACK-BODY_START = 000000000000002
    I_OBJPACK-BODY_NUM = 000000000000010.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    append I_OBJPACK-.
    by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    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.
    Best regards,
    raam

  • How do I send a page via email in the body of the mail and not as an attachment?

    I wish to send a page via email in the body of the mail. The only option to send a page appears to be to save it first and then attatch to the mail.

    When you are in the Plan View, right click on the icon for the page that you want to omit from the menu. Near the bottom, you'll see Menu Options, click on that and you'll have the choice to Exclude Page from Menus.

  • No content in body of Yahoo Mail when using FF 8.0

    I have No content in body of Yahoo Mail when using FF 8.0 but is OK when using IE. Have cleared cache, disabled extension and add ons and Java is enabled. Even went to FF 7, but no content in email?

    Update your filter subscriptions if you have "Adblock Plus".
    # click on ABP toolbar or add-ons button click on "Preferences" then on "Filters, and then on
    "Update all subscriptions".
    *https://support.mozilla.com/questions/845691

  • When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    That's probably because the message is in HTML format. Send the reply as plain text.

  • Is there any way to schedule the webi report as body of the mail

    Hi All,
             I have a bit different requirement. I need to schedule the webi reports to BlackBerry Mobile .
    The report should be displayed not as an attachment or URL but should be the body of the mail.
    Is there any Trick or Tip to do that.
    Thanks in Advance

    You could schedule the reports to run as an Excel or PDF document and the destination as a folder on a server.  Then after the reports are sent to the destination, you could use the Program Job Server to run a script which parses the files line-by-line and creates an email.  It's not the most elegant solution but in theory it should work.

  • How to get payload as body iin the Mail receiver

    Hi,
    i am using M2M scenario and getting the output data as am email attahment.
    But i need that data as the body of the mail in the receiver.
    please help me.
    Regards,
    Sree.

    Hi Sreenivas,
    Use message protocol as XI payload and make sure that you uncheck the "KeepAttachemts" option. Please refer the below links it may help you.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    The specified item was not found.
    Regards,
    Priyanka

  • Is there any limit of character that can be sent as body of the mail ?

    Hi,
    we are in exchange 2010 server environment. Is there any limit of character that can be sent as body of the mail ?
    Sankar M http://messagingdevelopment.blogspot.in/

    Hi Munirathinam,
    We can use transport rule and content filtering to implement this function, for example "SubjectOrBodyContains" or "
    FromAddressContains". More details about it, please refer to:
    Transport Rule Predicates:
    http://technet.microsoft.com/en-us/library/dd638183(v=exchg.141).aspx
    Understanding Content Filtering:
    http://technet.microsoft.com/en-us/library/bb124739(v=exchg.141).aspx
    Best Regards,
    Allen Wang

  • HT201320 when i send an email using my hotmail address through outlook my contacts do not receive the mail. when i send the same mail through my iPad or iPhone no problem my contacts receive the mail. this only problem happens when i send mail with my mac

    I have a hotmail email address. I compose my mail useing MS outlook. when i send the mail to my contacts useing my macbook air,my contacts tell me there have not received the mail.
    when i send the same message with my ipad or iphone no problem my contacts receive the mail.
    what is the problem?

    Blair84 wrote:
    Double check your contacts email, and if its incorrect, go to their contact and change it and save it or you can delete the email you put in, and manually type it in.
    Hope this helps.
    How would that help the original poster?

  • Sending Smartform output as a body of the mail not as the attachement

    Hi All,
      my requirement is like this...
      I need to send a smartform output as the body of a mail. and not as the attachment.
      Hope you got my question
    Regards
      Raghu

    Hi,
           I hope the following links might help you,
    Smartform output as Email.
    Smartform to PDF and e_mail? Urgent
    Regards,
    Hema.
    Reward points if it is useful.

  • I am unable to send a PDF attachment using mac mail so that it appears in the body of the email when arrives in the recipient's inbox.

    I attach the pdf file as a view in place instead of view as icon, but it arrives in the recipient's inbox as a pdf icon attachment.  I have heard that there are programs that can make the attachment be viewed in the body of the email, but i have been unable to find them.  Does anyone have any suggestions??  I have called apple care, and been to the genius bar, but nothing.  it seems that if the email is sent from mac mail to mac mail it works, but to any other mail program they only receive the icons.

    new account are created without a password, so asking for it is normal.
    see http://thunderbirdtweaks.blogspot.com.au/2011/07/pssswords.html
    Compare the passwords Thunderbird has for the other accounts and see if using the same one is what you need to do.

  • How to include body of the mail along with attachment using the below FM

    Hi All,
    I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to generate an e-mail with excel file as attachment. Can you please  let me know how to include body of the e-mail along with this attachment.
    Thanks & Regards
    Gowthami

    hi,
    see this code
    TABLES: apqi.                         "Queue info definition
    TYPES DECLARATION
    *& Global Types
    TYPE-POOLS: slis,                     "Type for alv list
                sx.                       "SAP connect
    TYPE-POOLS: list.
    *& Types
    TYPES: BEGIN OF s_itab_apqi.
            INCLUDE STRUCTURE apqi.
    TYPES: END OF s_itab_apqi.
               INTERNAL TABLE / WORK AREA DECLARATION             *
    *&  For email  attachment
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE  0
                    WITH HEADER LINE.
    DATA:   it_packing_list  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            it_contents      LIKE solisti1 OCCURS 0 WITH HEADER LINE  ,
            it_receivers     LIKE somlreci1 OCCURS 0 WITH HEADER LINE ,
            it_attachment    LIKE solisti1 OCCURS 0 WITH HEADER LINE  ,
            it_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE  .
    DATA:   v_cnt            TYPE i                                   ,
            v_sent_all(1)    TYPE c                                   ,
            v_doc_data       LIKE sodocchgi1                          ,
            gd_error         TYPE sy-subrc                            ,
            gd_reciever      TYPE sy-subrc                            .
    DATA: p_email   TYPE somlreci1-receiver
                                 VALUE 'mail id here of the reciever'.
    *&   Variable for attachment name
    DATA: v_attach(12).
    *&   Internal table to get data from apqi table
    table here
    DATA: ws_line TYPE slis_listheader.
    DATA: it_list_top_of_page TYPE slis_t_listheader.
    CONSTANTS : v_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    VARIABLE DECLARATION
    DATA: v_colpos        TYPE i.
    DATA: v_transcnt(10)  TYPE c,
          v_transcnte(10) TYPE c,
          v_transcntf(10) TYPE c,
          v_msgcnt(10)    TYPE c,
          v_qid(20)       TYPE c.
    DATA  v_tot_rec(3)    TYPE n.
    DATA :v_date(10) TYPE c,
          v_time(8) TYPE c .
    DATA: v_fromdate(10) .
    DATA: v_todate(10) .
    SELCTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-015.
    PARAMETERS:
    SELECTION-SCREEN END OF BLOCK blk1.
    AT SELCTION SCREEN
    AT SELECTION-SCREEN.
      IF p_dfrom IS INITIAL AND
         NOT p_dato IS INITIAL.
        MESSAGE e000(zp) WITH text-020.
      ENDIF.
    START OF SELECTION
    START-OF-SELECTION.
    *&  To get data from APQI table into internal table
      PERFORM populate_itab.
    **To Populate table with details to be entered into .xls file
      PERFORM build_xls_data_table.
    END OF SELECTION
    END-OF-SELECTION.
    *& To display ALV list when IT_APQI is not initial
      IF NOT it_apqi[] IS INITIAL.
    *&-- Send an Notification email
        PERFORM send_email .
    *&--To populate fields for ALV
        PERFORM build_fieldcat   .
        PERFORM build_eventcat   .
        PERFORM e04_comment_build  USING it_list_top_of_page[].
        PERFORM build_layout     .
        PERFORM build_sortcat    .
        PERFORM start_list_viewer.
      ELSE.
    *&-- If no record exists in IT_APQI internal table then message is displayed
        MESSAGE s000(zp) WITH text-021.
      ENDIF.
    FORMS **********************************
    populate itab here -
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat .
    ENDFORM.                    " BUILD_FIELDCAT
    *&      Form  BUILD_EVENTCAT
    FORM build_eventcat .
      DATA: v_header(25) .
      CONCATENATE 'ZPIPY016' p_dfrom p_dato INTO v_header.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_eventcat[]
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      READ TABLE it_eventcat WITH KEY name = slis_ev_top_of_page
                                 INTO wa_eventcat.
      IF sy-subrc = 0.
        MOVE v_formname_top_of_page TO wa_eventcat-form.
        APPEND wa_eventcat TO it_eventcat.
      ENDIF.
    ENDFORM.                    " BUILD_EVENTCAT
    *&      Form  BUILD_LAYOUT
    FORM build_layout .
      ws_layout-no_keyfix           = 'X'.
      ws_layout-group_buttons       = 'X'.
      ws_layout-colwidth_optimize   = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  BUILD_SORTCAT
    FORM build_sortcat .
      CLEAR wa_sortcat.
      CLEAR v_colpos.
    ENDFORM.                    " BUILD_SORTCAT
    *&      Form  START_LIST_VIEWER
    FORM start_list_viewer .
      DATA: ws_pgm  LIKE sy-repid.
    *& To Display ALV list
      ws_pgm = sy-repid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = ws_pgm
          is_layout          = ws_layout
          it_fieldcat        = it_fieldcat
          it_sort            = it_sortcat
          i_save             = 'A'
          it_events          = it_eventcat
        TABLES
          t_outtab           = it_apqi
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    " START_LIST_VIEWER
    *&      Form  BUILD_XLS_DATA_TABLE
    FORM build_xls_data_table .
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      CONSTANTS: con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
                 con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
    *& To populate it_attach table to be send as email.
      CONCATENATE 'Error of transaction SM35' ' '
         INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
    *& To gettotal number of error records
      DESCRIBE TABLE it_apqi LINES v_tot_rec .
      CONCATENATE  'Number of Errors  = '  v_tot_rec
                INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      CONCATENATE text-001
                  text-002
                  text-003
                  text-004
                  text-005
                  text-006
                  text-007
                  text-008
                  text-009
                  text-010
                  text-011
                  text-012
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
    *& To populate it_attach from it_apqi
      LOOP AT it_apqi INTO wa_apqi.
    *& To get the date format in DD/MM/YYYY
        WRITE wa_apqi-credate TO v_date  DD/MM/YYYY.
    *& To get time format in hh:mm:ss.
        v_time = wa_apqi-cretime.
        CONCATENATE  v_time(2) ':' v_time2(2) ':' v_time4(2) INTO v_time.
        v_transcnt  = wa_apqi-transcnt.
        v_transcnte = wa_apqi-transcnte.
        v_transcntf = wa_apqi-transcntf.
        v_msgcnt    = wa_apqi-msgcnt.
        v_qid       = wa_apqi-qid.
        CONCATENATE wa_apqi-groupid wa_apqi-creator
                         wa_apqi-qstate v_date
                         v_time wa_apqi-progid
                         wa_apqi-userid  v_transcnt
                         v_transcnte v_transcntf
                         v_msgcnt v_qid
                   INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach  .
        CLEAR   it_attach  .
        CLEAR:  v_transcnt ,
                v_transcnte,
                v_transcntf,
                v_msgcnt   ,
                v_qid      ,
                v_date     ,
                v_time     .
      ENDLOOP.
    ENDFORM  .                    " BUILD_XLS_DATA_TABLE
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
    FORM populate_email_message_body .
      REFRESH it_message.
      it_message = 'message here'.
      APPEND it_message.
      CLEAR it_message.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    FORM send_file_as_email_attachment TABLES pit_message
                                              pit_attach
                                        USING p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     CHANGING p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email               = p_email         .
      ld_mtitle              = p_mtitle        .
      ld_format              = p_format        .
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename      .
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      v_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      v_doc_data-obj_langu = sy-langu.
      v_doc_data-obj_name  = 'SAPRPT'.
      v_doc_data-obj_descr = ld_mtitle .
      v_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR v_doc_data.
      READ TABLE it_attach INDEX v_cnt.
      v_doc_data-doc_size =
         ( v_cnt - 1 ) * 255 + STRLEN( it_attach ).
      v_doc_data-obj_langu  = sy-langu.
      v_doc_data-obj_name   = 'SAPRPT'.
      v_doc_data-obj_descr  = ld_mtitle.
      v_doc_data-sensitivty = 'F'.
      CLEAR it_attachment.
      REFRESH it_attachment.
      it_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR it_packing_list.
      REFRESH it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      APPEND it_packing_list.
    Create attachment notification
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num   = 1.
      it_packing_list-body_start = 1.
      DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
      it_packing_list-doc_type   =  ld_format.
      it_packing_list-obj_descr  =  ld_attdescription.
      it_packing_list-obj_name   =  ld_attfilename.
      it_packing_list-doc_size   =  it_packing_list-body_num * 255.
      APPEND it_packing_list.
    Add the recipients email address
      CLEAR it_receivers.
      REFRESH it_receivers.
      it_receivers-receiver = ld_email.
      it_receivers-rec_type = 'U'.
      it_receivers-com_type = 'INT'.
      it_receivers-notif_del = 'X'.
      it_receivers-notif_ndel = 'X'.
      APPEND it_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = v_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = v_sent_all
        TABLES
          packing_list               = it_packing_list
          contents_bin               = it_attachment
          contents_txt               = it_message
          receivers                  = it_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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT it_receivers.
        ld_receiver = it_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  SEND_EMAIL
    FORM send_email .
    Populate message body text
      PERFORM populate_email_message_body.
      PERFORM send_file_as_email_attachment
                                   TABLES it_message
                                          it_attach
                                    USING p_email
                                          'Error Sessions from SM35'
                                          'XLS'
                                          'filename'
                                          v_attach
                                 CHANGING gd_error
                                          gd_reciever.
    ENDFORM.                    " SEND_EMAIL
    *&      Form  E04_COMMENT_BUILD
          text
         -->E04_LT_TOP_OF_PAGE  text
    FORM e04_comment_build USING lt_top_of_page TYPE slis_t_listheader.
      CLEAR: v_fromdate,
             v_todate.
      WRITE p_dfrom TO v_fromdate  DD/MM/YYYY.
      WRITE p_dato TO  v_todate    DD/MM/YYYY.
    *& To write header in ALV list
    *& Program name
      CLEAR ws_line.
      ws_line-typ  = 'H'.
      ws_line-info = text-016.
      APPEND ws_line TO lt_top_of_page.
      CLEAR ws_line.
      ws_line-typ  = 'S'.
      ws_line-key = text-018.
      ws_line-info = v_tot_rec.
      APPEND ws_line TO lt_top_of_page.
    *& Date from
      CLEAR ws_line.
      ws_line-typ  = 'S'.
      ws_line-key  = text-050.
      ws_line-info = v_fromdate.
      APPEND ws_line TO lt_top_of_page.
    *& Date to
      CLEAR ws_line.
      ws_line-typ  = 'S'.
      ws_line-key  = text-051.
      ws_line-info = v_todate.
      APPEND ws_line TO lt_top_of_page.
    ENDFORM.                    "E04_COMMENT_BUILD
          FORM TOP_OF_PAGE                                              *
    FORM top_of_page.
    *& To write Heading in Top of page
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    thanks

  • Chinese Characters in Body of the Email when sending attachments.

    I have google and exchange accounts connected to mac mail. Whenever I send an attachments through the exchange account via mac mail, the recipient receives the attachment however is filled with Chinese characters in the body of the email that look like this (⁥敧敮慲整⁤祢䔠捸慬浩牥吠浥汰瑡⁥摅瑩牯漠㘰ㄺ㨶㈳䘠楲慤ⱹ㤠䨠湡慵祲㈠㄰‵ⴭാ㰊呓䱙⁅祴数琽硥⽴獣㹳⹐慥捥㌱㙥〭㉢ⵤ㐴㜳㠭㐸ⴴ散㜸挴㌳㌳㑢笠਍䴉剁䥇㩎〠浣〠浣 〠瑰਍ൽ䰊⹉慥捥㌱㙥〭㉢ⵤ㐴㜳㠭㐸ⴴ散㜸) and goes on for 10-15 lines even when there is no content in the email.
    The OSX that I am running is Yosemite Version 10.10. Does anyone have a resolution to this problem? Thanks

    It looks like bogus chinese created when a message encoded as utf-8 is read as if it were encoded as utf-16.
    See if the people who run the exchange server can help, if that is the only account where this happens.  Such systems often botch encodings.  I don't know of anything you could do at your end beyond playing with the Windows Friendly attachment setting in Mail.

  • TS3274 Email display problem: My email only display the list of emails and a preview (first two lines of the body of the mail). If one click on the message it only shows the heading on the right hand side of the screen, but not the content.

    My email only display the list of mails in my in box with a preview of the first two lines of the body of the message. When one clicks on the message to open it, only the header is displayed in the right hand side of the screen - the actual message is missing. This happens on older mail previously downloaded that use to work properly as well. Any idea how to fix this?

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Mail from RVADOR01 need to add body of the mail

    Hi Experts,
    How to add mail body for the below case?please look
    I am using output tupe Zmail attached to Program ZRVADOR01 and script form ZRVORDER01.
    The Program ZRVADOR01 and the script ZRVORDER01are copied from standard prog RVADOR01  and standard script RVORDER01.
    And this output type is attached to VA02.
    In the Zprogram i could able to give mail subject in OPEN_FORM function module in OPTIONS parameter.
    And i am sending to the exterid which is outlook.
    For giving the email id i have added some code from the note .357137 before calling the OPEN_FORM function module in the program..
    mail is coming with subject line and attachment of script document .
    But the only thing needed is , add body text for the mail.
    How can i do this?
    Regards
    Ramakrishna

    Hi Rama, I am trying to do the same and noticed that your comments/question appears as "ANSWERED" at the top of the thread.
    Were you able to accomplish this?
    Jacob

Maybe you are looking for

  • RfcAdapter-Reciver error in channel GeneratedReceiverChannel_RFC

    Hi all, We had setup up ALM in XI/PI, sometime we receive alert with below content: Blank in below fields: SXMS_ERROR_CODE, SXMS_ERROR_CAT, SXMS_MSG_GUID SXMS_FROM_SERVICE, SXMS_FROM_INTERFACE, SXMS_TO_INTERFACE Have values in below fields: SXMS_TO_S

  • Protocols Monitor

    Protocols Monitor We need to develop an agent that is able to detect when a file's transfer using FTS starts and finishes to fire some events. How can we achieve this goal? null

  • JAAS, Subject and credentials

    Hi, I have to write a security framework for my J2EE application and it has to be portable between appservers. I`m thinking about using JAAS and programmatic security. I`ve written a LoginModule that does user authetication and loads all user credent

  • How Can I take this image and put it in another image? Basically Background but different

    So, I got photoshop today for a project I have to do and have never used it in my life. I am making a childrens book for school and I am trying to pug the corner pug in this photo onto the couch of the next photo. I am going to use the various expres

  • ORA-06550: line 4, column 18: PLS-00103:

    I am getting the error as below while i enter code in the conditional display of the region. Can you please help me how to fix it ORA-06550: line 4, column 18: PLS-00103: Encountered the symbol "IF" when expecting one of the following: ( - + case mod