<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pdf e-mail attachments in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082597#M432180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kevin..i was using exactly same code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what did u have on your documents_line-content_text is it more than 200 char and are you converting it to pdf?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Siva K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 20:35:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T20:35:42Z</dc:date>
    <item>
      <title>pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082593#M432176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i using &amp;lt;b&amp;gt;cl_document_bcs&amp;lt;/b&amp;gt; to send e-mail attachments as pdf.&lt;/P&gt;&lt;P&gt;eventhough &amp;lt;b&amp;gt;CONTENT_TEXT-line&amp;lt;/b&amp;gt; is 255 char length, it is splitting into two lines when have more than say 150 char. Is there a parameter or variable i need to set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appreciate your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 19:51:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082593#M432176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T19:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082594#M432177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a program I created to convert any programs output into PDF and emails it.&lt;/P&gt;&lt;P&gt;The input for the program will: Name of the report and its variant. This program will execute this report you specified and creates a spool and then convert the spool into PDF and mails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can use some parts of this report. This was developed in 46C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zss_mail_report_in_pdf.

TABLES: tsp01.

DATA: w_print_parms LIKE pri_params,
      w_valid(1) TYPE c,
      w_bytecount TYPE i,
*     w_length TYPE i,
      w_repid   LIKE sy-repid,
      w_rqident LIKE tsp01-rqident.

DATA: i_pdf  LIKE tline OCCURS 0 WITH HEADER LINE,
      i_temp LIKE bapiqcmime OCCURS 0 WITH HEADER LINE,
      w_filename LIKE rlgrap-filename.

DATA: objpack       LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE,
      objhead       LIKE solisti1 OCCURS 1 WITH HEADER LINE,
      objbin        LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      objtxt        LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      objtxt2       LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      reclist       LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
      recipient_int LIKE sadrud,
      recipient_rml LIKE sadr7d,
      tab_lines     LIKE sy-tabix,
      doc_chng      LIKE sodocchgi1,
      sent_to_all   LIKE sonv-flag.

PARAMETERS: p_repid LIKE sy-repid,
            p_varnt LIKE rsvar-variant,
            p_linsz LIKE sy-linsz,
            p_paart LIKE sy-paart.

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_mail   AS CHECKBOX,
            p_clist  RADIOBUTTON GROUP ml1,
            p_addr   RADIOBUTTON GROUP ml1 DEFAULT 'X',
            p_mailid LIKE sza5_d0700-smtp_addr.

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_down   AS CHECKBOX,
            p_name   LIKE rlgrap-filename.


START-OF-SELECTION.

  IF NOT p_mail   IS INITIAL
     AND p_mailid IS INITIAL.
    WRITE: / 'Need mail id for mailing the document.'.
    STOP.
  ENDIF.

  CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
            authority              = space
            copies                 = '1'
            cover_page             = space
            data_set               = space
            department             = space
            destination            = space
            expiration             = '0'
            immediately            = space
            in_archive_parameters  = space
            in_parameters          = space
            layout                 = space
            mode                   = ' '
*           new_list_id            = 'X'
            no_dialog              = 'X'
            user                   = sy-uname
       IMPORTING
            out_parameters         = w_print_parms
            valid                  = w_valid
       EXCEPTIONS
            archive_info_not_found = 1
            invalid_print_params   = 2
            invalid_archive_params = 3
            OTHERS                 = 4.
  IF w_print_parms-pdest = space.
    w_print_parms-pdest = 'LPT1'.
  ENDIF.
  w_print_parms-linsz = p_linsz.
  w_print_parms-paart = p_paart.

*** Create a Spool entry for the report
  SUBMIT (p_repid) TO SAP-SPOOL
                   WITHOUT SPOOL DYNPRO
                   SPOOL PARAMETERS w_print_parms
                   USING SELECTION-SET p_varnt
                   AND RETURN.

*** Retrive the Spool Request number
  w_repid = sy-repid.
  PERFORM get_spool_number USING w_repid
                                 sy-uname
                           CHANGING w_rqident.

*** Convert the spool request to PDF format
  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
       EXPORTING
            src_spoolid   = w_rqident
            no_dialog     = 'X'
            dst_device    = w_print_parms-pdest
       IMPORTING
            pdf_bytecount = w_bytecount
       TABLES
            pdf           = i_pdf
       EXCEPTIONS
            OTHERS        = 12.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    WRITE: / 'Error converting Spool request to PDF.'.
    STOP.
  ENDIF.

*** Download the PDF document on to desktop
  IF NOT p_down IS INITIAL.
    IF p_name IS INITIAL.
      CONCATENATE 'C:' p_repid '.pdf' INTO w_filename.
    ELSE.
      MOVE p_name TO w_filename.
    ENDIF.
    CALL FUNCTION 'DOWNLOAD'
         EXPORTING
              bin_filesize = w_bytecount
              filename     = w_filename
              filetype     = 'BIN'
         IMPORTING
              act_filename = w_filename
         TABLES
              data_tab     = i_pdf
         EXCEPTIONS
              OTHERS       = 8.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      WRITE: / 'Error downloading the PDF file.'.
      STOP.
    ENDIF.
  ENDIF.

*** Mail the PDF document
  IF NOT p_mail IS INITIAL.
*   Reformat the line to 255 characters wide (--code from SAP--)
* Data for converting PDF data from text table to MIME table
    DATA:    l_lines       TYPE i,
             l_temp(500)   TYPE c,
             l_offset      TYPE p,
             l_lineslen(2) TYPE p,
             l_mimelen(2)  TYPE p,
             l_tabix       LIKE sy-tabix.
    CLEAR: l_temp, l_offset, i_temp.
    DESCRIBE TABLE i_pdf   LINES  l_lines.
    DESCRIBE FIELD i_pdf   LENGTH l_lineslen.
    DESCRIBE FIELD i_temp  LENGTH l_mimelen.
    LOOP AT i_pdf.
      l_tabix = sy-tabix.
      MOVE i_pdf TO l_temp+l_offset.
      IF l_tabix = l_lines.
        l_lineslen = strlen( i_pdf ).
      ENDIF.
      l_offset = l_offset + l_lineslen.
      IF l_offset GE l_mimelen.
        CLEAR i_temp.
        i_temp = l_temp(l_mimelen).
        APPEND i_temp.
        SHIFT l_temp BY l_mimelen PLACES.
        l_offset = l_offset - l_mimelen.
      ENDIF.
      IF l_tabix = l_lines.
        IF l_offset GT 0.
          CLEAR i_temp.
          i_temp = l_temp(l_offset).
          APPEND i_temp.
        ENDIF.
      ENDIF.
    ENDLOOP.
*   Mail message body or main document
    objtxt = text-t01.
    APPEND objtxt.
    objtxt = ' '.
    APPEND objtxt.
    objtxt = text-t02.
    APPEND objtxt.
    objtxt = ' '.
    APPEND objtxt.
    objtxt = text-t05.
    REPLACE '&amp;amp;' WITH p_repid INTO objtxt.
    APPEND objtxt.
    objtxt = text-t06.
    REPLACE '&amp;amp;' WITH p_varnt INTO objtxt.
    APPEND objtxt.
    objtxt = ' '.
    APPEND objtxt.
    objtxt = text-t03.
    APPEND objtxt.
    objtxt = ' '.
    APPEND objtxt.
    objtxt = text-t04.
    APPEND objtxt.
    SELECT SINGLE name1 FROM  usr03
                        INTO  objtxt
                        WHERE bname = sy-uname.
    APPEND objtxt.
    objpack-transf_bin = ' '.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    DESCRIBE TABLE objtxt LINES objpack-body_num.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
*   Create the document which is to be sent
    doc_chng-obj_name  = 'Report data in PDF format'.
    doc_chng-obj_descr = text-t07.
    REPLACE '&amp;amp;' WITH p_repid INTO doc_chng-obj_descr.
    REPLACE '&amp;amp;' WITH p_varnt INTO doc_chng-obj_descr.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
*   Fill the mail recipient list
    recipient_int-address = p_mailid.
    reclist-receiver = recipient_int.
    IF p_clist IS INITIAL.
      reclist-rec_type = 'U'.
    ELSE.
      reclist-rec_type = 'C'.
    ENDIF.
    APPEND reclist.
*   Create the Attachement
    objbin[] = i_temp[].
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    DESCRIBE TABLE objbin LINES objpack-body_num.
    objpack-doc_size = objpack-body_num * 255.
    objpack-doc_type = 'PDF'.
    CONCATENATE p_repid '_' p_varnt '.PDF' INTO objpack-obj_descr.
    APPEND objpack.
*   Call the API to send mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = doc_chng
              put_in_outbox              = 'X'
         IMPORTING
              sent_to_all                = sent_to_all
         TABLES
              packing_list               = objpack  "filed with Att.list
              object_header              = objhead  "
              contents_bin               = objbin  "filed with bin.data
              contents_txt               = objtxt  "
              receivers                  = reclist  "filed with mail ids
         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 &amp;lt;&amp;gt; 0.
      RAISE mail_send_error.
    ELSE.
      SUBMIT rsconn01 AND RETURN.
    ENDIF.
  ENDIF.

END-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  get_spool_number
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_SY_REPID  text
*      --&amp;gt;P_SY_UNAME  text
*      &amp;lt;--P_w_rqident  text
*----------------------------------------------------------------------*
FORM get_spool_number USING    f_repid
                               f_uname
                      CHANGING f_rqident.
  DATA: lc_rq2name LIKE tsp01-rq2name.
  CONCATENATE sy-repid+0(9)
              sy-uname+0(3)
              INTO lc_rq2name.

  SELECT * FROM tsp01
           WHERE rq2name = lc_rq2name
           ORDER BY rqcretime DESCENDING.
    w_rqident = tsp01-rqident.
    EXIT.
  ENDSELECT.
  IF sy-subrc NE 0.
    CLEAR w_rqident.
  ENDIF.
ENDFORM.                    " get_spool_number
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sumant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 20:01:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082594#M432177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T20:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082595#M432178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Siva K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 20:11:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082595#M432178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T20:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082596#M432179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is an example I found here on the forum. Worked fine for me. Don't think I ran into the splitting issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*----------------------------------------------------------------------*
* CLASS-DEFINITIONS                                                    *
*----------------------------------------------------------------------*
  DATA: send_request       TYPE REF TO cl_bcs.
  DATA: document           TYPE REF TO cl_document_bcs.
  DATA: sender             TYPE REF TO cl_sapuser_bcs.
  DATA: recipient          TYPE REF TO if_recipient_bcs.
  DATA: exception_info     TYPE REF TO if_os_exception_info,
        bcs_exception      TYPE REF TO cx_bcs.

*----------------------------------------------------------------------*
* INTERNAL TABLES                                                      *
*----------------------------------------------------------------------*
  DATA: l_mailtext TYPE soli_tab.
  DATA: l_mailhex  TYPE solix_tab.
  DATA: iaddsmtp   TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE.
  DATA: ireturn    TYPE bapiret2 OCCURS 0 WITH HEADER LINE.

*----------------------------------------------------------------------*
* VARIABLES                                                            *
*----------------------------------------------------------------------*
  DATA: mail_line  LIKE LINE OF l_mailtext.
  DATA: mailx_line LIKE LINE OF l_mailhex.
  DATA: bapiadsmtp         TYPE bapiadsmtp.

*----------------------------------------------------------------------*
* CONSTANTS                                                            *
*----------------------------------------------------------------------*
  CONSTANTS:
    kimball_domain(12) TYPE c VALUE '@kimball.com'.

  CLASS cl_cam_address_bcs DEFINITION LOAD.
  CLASS cl_abap_char_utilities DEFINITION LOAD.

  TRY.
* Create persistent send request
      send_request = cl_bcs=&amp;gt;create_persistent( ).

      DATA: first(1) TYPE c.
      CLEAR first.
      DATA: documents_line LIKE LINE OF documents.

      LOOP AT documents INTO documents_line.
        IF first IS INITIAL.
          MOVE 'X' TO first.
* Build the Main Document
          IF documents_line-content_hex[] IS INITIAL.
            document = cl_document_bcs=&amp;gt;create_document(
                                i_type    = documents_line-type
                                i_text    = documents_line-content_text
                                i_subject = documents_line-subject ).
          ELSE.
            document = cl_document_bcs=&amp;gt;create_document(
                                i_type    = documents_line-type
                                i_hex     = documents_line-content_hex
                                i_subject = documents_line-subject ).
          ENDIF.
        ELSE.
          IF documents_line-content_hex[] IS INITIAL.
* Add Attachment
            CALL METHOD document-&amp;gt;add_attachment
              EXPORTING
                i_attachment_type    = documents_line-type
                i_attachment_subject = documents_line-subject
                i_att_content_text   = documents_line-content_text.
          ELSE.
            CALL METHOD document-&amp;gt;add_attachment
              EXPORTING
                i_attachment_type    = documents_line-type
                i_attachment_subject = documents_line-subject
                i_att_content_hex    = documents_line-content_hex.
          ENDIF.
        ENDIF.
      ENDLOOP.


* Add document to send request
      CALL METHOD send_request-&amp;gt;set_document( document ).

* Get sender object
      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).

* Add sender
      CALL METHOD send_request-&amp;gt;set_sender
        EXPORTING
          i_sender = sender.


      DATA: recipients_line LIKE LINE OF recipients.
      LOOP AT recipients INTO recipients_line.
        IF recipients_line-c_address IS INITIAL.
* Create recipient
          CLEAR iaddsmtp.
          REFRESH iaddsmtp.
          CLEAR bapiadsmtp.
          CLEAR recipient.
* Read the E-Mail address for the user
          CALL FUNCTION 'BAPI_USER_GET_DETAIL'
            EXPORTING
              username = recipients_line-uname
            TABLES
              return   = ireturn
              addsmtp  = iaddsmtp.
          LOOP AT iaddsmtp WHERE std_no = 'X'.
            CLEAR bapiadsmtp.
            MOVE iaddsmtp TO bapiadsmtp.
          ENDLOOP.
* If no E-mail address was found, create one.
          IF bapiadsmtp-e_mail = ''.
            CONCATENATE recipients_line-uname kimball_domain
                      INTO recipients_line-c_address.
          ELSE.
            MOVE bapiadsmtp-e_mail TO recipients_line-c_address.
          ENDIF.
        ENDIF.

        recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( recipients_line-c_address ).
* Add recipient with its respective attributes to send request
        CALL METHOD send_request-&amp;gt;add_recipient
          EXPORTING
            i_recipient  = recipient
            i_express    = recipients_line-i_express
            i_copy       = recipients_line-i_copy
            i_blind_copy = recipients_line-i_blind_copy
            i_no_forward = recipients_line-i_no_foward.

      ENDLOOP.

* Set that you don't need a Return Status E-mail
      DATA: status_mail TYPE bcs_stml.
      status_mail = requested_status.
      CALL METHOD send_request-&amp;gt;set_status_attributes
        EXPORTING
          i_requested_status = requested_status
          i_status_mail      = status_mail.

* set send immediately flag
      send_request-&amp;gt;set_send_immediately( 'X' ).

* Send document
      CALL METHOD send_request-&amp;gt;send( ).

      COMMIT WORK.

    CATCH cx_bcs INTO bcs_exception.
      RAISE EXCEPTION bcs_exception.

  ENDTRY.
ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 20:29:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082596#M432179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T20:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082597#M432180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kevin..i was using exactly same code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what did u have on your documents_line-content_text is it more than 200 char and are you converting it to pdf?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Siva K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 20:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082597#M432180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T20:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082598#M432181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm pretty sure my 'body' of the mail has occasionally more then 200 chars without a split.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you mean with conversion? I'm sending newly generated adobe forms pdf's as attachment so no real conversion from my side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 06:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082598#M432181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-19T06:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082599#M432182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what i'm trying to do..simple..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data in my internal table&amp;gt;&amp;gt;need to send this out as pdf email attachment..&lt;/P&gt;&lt;P&gt;i have set my scot settings to pdf .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in documnets table..1 st line is header and if you have more it will become attachment right??..&lt;/P&gt;&lt;P&gt;documents_line-content_text-line this 255 char..when i fill this and send the email..then when i open my pdf file, the content is split/wrapped..&lt;/P&gt;&lt;P&gt;eg..should be like AAAAAAAAAABBBBBBBBBCCCCCC....DDDDD&lt;/P&gt;&lt;P&gt;but it's showing up as AAAAAAAAAABBBBBBBBBCCCCCC&lt;/P&gt;&lt;P&gt;                       ...DDDDD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will check my code again..otherwise will go back to old SO_....API FM.&lt;/P&gt;&lt;P&gt;Appreciate your help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Siva K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2007 06:14:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082599#M432182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-21T06:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082600#M432183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guru's &lt;/P&gt;&lt;P&gt;iam faceing a problem with sending pdf file through email.&lt;/P&gt;&lt;P&gt;in the above code &lt;/P&gt;&lt;P&gt;i have used FM CONVERT_ABAPSPOOLJOB_2_PDF to get pdf.&lt;/P&gt;&lt;P&gt;the pdf output is of type tline.&lt;/P&gt;&lt;P&gt;I need to convert tline pdf to hex  to pass to belove method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD document-&amp;gt;add_attachment&lt;/P&gt;&lt;P&gt;              EXPORTING&lt;/P&gt;&lt;P&gt;                i_attachment_type    = documents_line-type&lt;/P&gt;&lt;P&gt;                i_attachment_subject = documents_line-subject&lt;/P&gt;&lt;P&gt;                i_att_content_hex    = documents_line-content_hex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam unable to convert that , please help me in this issue , its very ugrent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 06:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082600#M432183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T06:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: pdf e-mail attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082601#M432184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it_pdf_output is the output table of CONVERT_ABAPSPOOLJOB_2_PDF then following code convert the table so you can use it with the add_attachment method of the class cl_document_bcs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIELD-SYMBOLS &amp;lt;f&amp;gt; TYPE x.
DATA: lw_pdf_output TYPE tline.
DATA: lw_slen TYPE i.
DATA: lw_tlen TYPE i.
DATA: lw_spos TYPE i.
DATA: lw_tpos TYPE i.
DATA: lw_spoolsize TYPE sood-objlen.
DATA: lw_bodyx     TYPE solix.
DATA: lt_bodyx     TYPE solix_tab.

MOVE gd_bytecount TO lw_spoolsize.

DESCRIBE FIELD lw_pdf_output LENGTH lw_slen IN BYTE MODE.
DESCRIBE FIELD lw_bodyx LENGTH lw_tlen IN BYTE MODE.

lw_tpos = 0.
LOOP AT it_pdf_output INTO lw_pdf_output.
  ASSIGN lw_pdf_output TO &amp;lt;f&amp;gt; CASTING.
  CHECK sy-subrc = 0.

  DO lw_slen TIMES.
    lw_spos = sy-index - 1.
    IF lw_tpos = lw_tlen.
      APPEND lw_bodyx TO lt_bodyx.
      FREE lw_bodyx.
      lw_tpos = 0.
    ENDIF.
  
    MOVE &amp;lt;f&amp;gt;+lw_spos(1) TO lw_bodyx-line+lw_tpos(1).
    ADD 1 TO lw_tpos.
  ENDDO.
ENDLOOP.
IF lw_tpos &amp;gt; 0.
  APPEND lw_bodyx TO lt_bodyx.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to pass pdf_bytecount from CONVERT_ABAPSPOOLJOB_2_PDF to cl_document_bcs methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2007 12:07:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-e-mail-attachments/m-p/2082601#M432184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-16T12:07:28Z</dc:date>
    </item>
  </channel>
</rss>

