Email pdf smartform error!

Hi,
I manage to send pdf to email with attachment, but getting this error
"An unrecognized token BT28.35" was found"
My code:
  statics:  ls_doc     type sodocchgi1,
            lv_lines   type i,
            ls_objhead type soli_tab,
            i_objpack  type table of sopcklsti1 WITH HEADER LINE,
            i_objtxt   type table of solisti1   WITH HEADER LINE,
            i_objbin   type table of solisti1   WITH HEADER LINE,
            i_reclist  type table of somlreci1  wiTH HEADER LINE.
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      FORMAT                = 'PDF'
      MAX_LINEWIDTH         = 132
    IMPORTING
      BIN_FILESIZE          = lv_filesize
    TABLES
      OTF                   = gs_output-otfdata
      LINES                 = gt_lines
    EXCEPTIONS
      ERR_MAX_LINEWIDTH     = 1
      ERR_FORMAT            = 2
      ERR_CONV_NOT_POSSIBLE = 3
      ERR_BAD_OTF           = 4
      OTHERS                = 5.
  refresh: i_objpack, i_objtxt, i_objbin, i_reclist.
convert to bin
  LOOP AT gt_lines into gs_lines.
    TRANSLATE gs_lines USING '~'.
    CONCATENATE gs_buffer gs_lines INTO gs_buffer.
  ENDLOOP.
  TRANSLATE gs_buffer USING '~'.
  DO.
    i_objbin = gs_buffer.
    APPEND i_objbin.
    SHIFT gs_buffer LEFT BY 255 PLACES.
    IF gs_buffer IS INITIAL.
      EXIT.
    ENDIF.
  ENDDO.
Create Message Body
Title and Description
  concatenate 'Invoice' ls_rseg-belnr
  into i_objtxt separated by space.
  append i_objtxt.
  describe table i_objtxt lines lv_lines.
  read table i_objtxt index lv_lines.
  ls_Doc-obj_name = 'INVOICE'.
  concatenate 'TSL Invoice' ls_rseg-belnr into ls_Doc-obj_descr
    separated by space.
  ls_doc-expiry_dat = sy-datum + 10.
  ls_Doc-sensitivty = 'F'.
  ls_Doc-doc_size = lv_lines * 255.
  clear i_reclist.
  i_reclist-receiver = gv_emailaddr.
  i_reclist-rec_type = 'U'.
  append i_reclist.
  clear i_objpack-transf_bin.
  i_objpack-head_start = 1.
  i_objpack-head_num = 0.
  i_objpack-body_start = 1.
  i_objpack-body_num = lv_lines.
  i_objpack-doc_type = 'RAW'.
  append i_objpack.
(pdf-Attachment)
  i_objpack-transf_bin = 'X'.
  i_objpack-head_start = 1.
  i_objpack-head_num = 0.
  i_objpack-body_start = 1.
Länge des Attachment ermitteln
  describe table i_objbin lines lv_lines.
  read table i_objbin index lv_lines.
  i_objpack-doc_size = lv_lines * 255.
  i_objpack-body_num = lv_lines.
  i_objpack-doc_type = 'PDF'.
  i_objpack-obj_name = 'INVOICE'.
  concatenate 'TSL Invoice' ls_rseg-belnr into i_objpack-obj_descr
    separated by space.
  append i_objpack.
  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = ls_doc
      put_in_outbox              = 'X'
    TABLES
      packing_list               = i_objpack
      object_header              = ls_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.
    message e398(00) with 'Email ERS invoice failed'
     ls_rseg-belnr into g_dummy.
    cf_retcode = sy-subrc.
    PERFORM protocol_update.
  endif.

HI
GOOD
GO THROUGH THIS LINK WHICH LL GIVE YOU BRIEF IDEA ABOUT SENDING PDF FILE USING MAIL, THAT YOU CAN IMPLEMNET IN YUOR PROGRAM
http://www.sapgenie.com/abap/example_code.htm
/people/emmanuele.prudenzano/blog/2006/08/03/an-advanced-solution-for-sending-email-from-solution-manager-or-crm
THANKS
MRUTYUN

Similar Messages

  • Error while emailing pdf Smartform- help needed

    Hi All,
    I have successsully saved smartform as pdf on my local machine and while trying to send the same as an attachment.i am encountering a run time error in SCOT transaction on pressing send message.
    Error details are as follows:-
    CPIC-CALL: THE SAPECMINIT’’ UNABLE TO DETERMINE HOST ADDRESS
    Source Code:  SAPMSSY1
    CALL ‘RFCIMPORT’
    The program is given below. Kindly reply me the solution.
    All helpful answers will b rewarded.
    Regards,
    Eureka.
    *& Report  Z24436_SMARTFORM2                                           *
    REPORT  Z24436_SMARTFORM2                       .
          Global Variables Declarations
    DATA: MAt_id TYPE MATNR VALUE '1%',
          fm_name TYPE rs38l_fnam.
    DATA: ITAB_MAkt TYPE STANDARD TABLE OF MAkt.
    DATA:  p_form   TYPE tdsfname   VALUE 'ZUDAY_SMARTFORMS1'.
          All Database Selections are here
    *Getting Materials belonging to the given plant
    SELECT * FROM MAkt INTO TABLE ITAB_MAkt
             WHERE MATNR LIKE MAT_id.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 =  p_form
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = fm_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.
      EXIT.
    ENDIF.
    DATA : gw_ssfcrescl TYPE ssfcrescl.
    DATA: gt_otf TYPE STANDARD TABLE OF itcoo ,
         gt_tline TYPE STANDARD TABLE OF tline,
          gt_pdf TYPE STANDARD TABLE OF tline,
          gv_len LIKE sood-objlen,
          gw_ssfctrlop TYPE ssfctrlop, "for CONTROL_PARAMETERS
          gw_ssfcompop TYPE ssfcompop. "for OUTPUT_OPTIONS
    gw_ssfctrlop-getotf = 'X'.
    gw_ssfctrlop-no_dialog = 'X'.
    gw_ssfcompop-tdnoprev = 'X'.
    **Calling the generated function module
    CALL FUNCTION fm_name
      EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = gw_ssfctrlop
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
        OUTPUT_OPTIONS             = gw_ssfcompop
        USER_SETTINGS              = 'X'
       customer_info              = customer
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = gw_ssfcrescl
      JOB_OUTPUT_OPTIONS         =
      TABLES
        it_makt                   = itab_makt
      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.
    gt_otf[] = gw_ssfcrescl-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        format                = 'PDF'
        max_linewidth         = 132
      IMPORTING
        bin_filesize          = gv_len
      TABLES
        otf                   = gt_otf
        lines                 = gt_pdf
      EXCEPTIONS
        err_max_linewidth     = 1
        err_format            = 2
        err_conv_not_possible = 3
        OTHERS                = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    DATA:
    gt_pdf          TYPE TABLE OF tline,
      gt_xi_pdf       TYPE TABLE OF tline,
      gt_pdf_conv     TYPE TABLE OF solisti1,
      gt_xi_temp      TYPE TABLE OF bapiqcmime.
      CONSTANTS:
        lc_x(1)          TYPE c VALUE 'X',
        lc_raw(3)        TYPE c VALUE 'RAW',
        lc_pdf(3)        TYPE c VALUE 'PDF',
        lc_attach(12)    TYPE c VALUE 'ATTACHMENT'.
      DATA:
        lv_spool         TYPE rspoid,              "Spool Number
        lv_pdf_size      TYPE i,                   "PDF Size
        lv_subject(40)   TYPE c,                   "Email subject
        lv_tab_lines     TYPE sytabix,             "Table Lines
        lv_date(10)      TYPE c,                   "Variable for date
        lv_time(8)       TYPE c.                   "Variable for Time
      DATA:
    For Compressing document
       ls_objpack       TYPE sopcklsti1,
       lt_objpack       TYPE STANDARD TABLE OF sopcklsti1,
    To specify subject
       lt_objhead       TYPE STANDARD TABLE OF solisti1,
       ls_objhead       TYPE solisti1,
    To send the PDF
       lt_objbin        TYPE STANDARD TABLE OF solisti1,
       ls_objbin        TYPE solisti1,
    Email body
       lt_objtxt        TYPE STANDARD TABLE OF solisti1,
       ls_objtxt        TYPE solisti1,
    To specify Receivers
       lt_reclist       TYPE STANDARD TABLE OF somlreci1,
       ls_reclist       TYPE somlreci1,
    Documenting Data
       ls_doc_chng      TYPE sodocchgi1,
       ls_pdf_conv      TYPE solisti1.
      CONSTANTS: lc_under(1) TYPE c VALUE '_'.
    **Copy the Spool request to a Local Variable
    lv_spool = sy-spono.
    Convert spool job to PDF
    ***************this is normal report spool to pdf.
    but your case it will be smartform to pdf
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
       EXPORTING
         src_spoolid   = lv_spool
         no_dialog     = lc_x
       IMPORTING
         pdf_bytecount = lv_pdf_size
       TABLES
         pdf           = gt_pdf
       EXCEPTIONS
         OTHERS        = 0.
    To Format the PDF file so as each row contains 255 characters
      PERFORM page_format .
    Transfer the file to objbin table
      LOOP AT gt_pdf_conv INTO ls_pdf_conv.
        ls_objbin-line = ls_pdf_conv-line.
        APPEND ls_objbin TO lt_objbin.
        CLEAR ls_objbin.
      ENDLOOP.
    *// Creating the document to be sent - Mail subject creation
      ls_doc_chng-obj_name = sy-repid.
      lv_subject = text-008.                      "Mail subject
      WRITE sy-datum TO lv_date USING EDIT MASK '__/__/____'.
      WRITE sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.
      CONCATENATE lv_subject lc_under lv_date lc_under lv_time
                      INTO ls_doc_chng-obj_descr.
    *// Email body
      PDF attachment of Product Allocation for Open orders
      ls_objtxt = text-009.
      APPEND ls_objtxt TO lt_objtxt.
    Write Date when the mail was sent in the email body
      CONCATENATE text-010 lv_date INTO ls_objtxt.
      APPEND ls_objtxt TO lt_objtxt.
    Write Time when the mail was sent in the email body
      CONCATENATE text-011 lv_time INTO ls_objtxt.
      APPEND ls_objtxt TO lt_objtxt.
      DESCRIBE TABLE lt_objtxt LINES lv_tab_lines.
      READ TABLE lt_objtxt INTO ls_objtxt INDEX lv_tab_lines.
    Calculate the document size
      ls_doc_chng-doc_size = ( lv_tab_lines - 1 ) * 255 +
                              STRLEN( ls_objtxt ).
    *// Creating the entry for the compressed document
      CLEAR ls_objpack-transf_bin.
      ls_objpack-head_start = 1.
      ls_objpack-head_num   = 0.
      ls_objpack-body_start = 1.
      ls_objpack-body_num   = lv_tab_lines.
      ls_objpack-doc_type   = 'RAW'    .    "RAW
      APPEND ls_objpack TO lt_objpack.
      CLEAR lv_tab_lines.
      DESCRIBE TABLE lt_objbin LINES lv_tab_lines.
      ls_objhead = ls_doc_chng-obj_descr.
      APPEND ls_objhead TO lt_objhead.
    *// Creating the entry for the compressed attachment
      ls_objpack-transf_bin = lc_x.
      ls_objpack-head_start = 1.
      ls_objpack-head_num   = 1.
      ls_objpack-body_start = 1.
      ls_objpack-body_num   = lv_tab_lines.
      ls_objpack-doc_type   = 'PDF'.            "PDF
      ls_objpack-obj_name   = 'ATTACHMENT'.         "ATTACHMENT
      CONCATENATE lv_subject lc_under lv_date lc_under lv_time
        INTO ls_objpack-obj_descr.
      CLEAR: ls_objbin.
      READ TABLE lt_objbin INTO ls_objbin INDEX lv_tab_lines.
      ls_objpack-doc_size = ( lv_tab_lines - 1 ) * 255 +
                              STRLEN( ls_objbin ).
      APPEND ls_objpack TO lt_objpack.
    ls_reclist-receiver = '[email protected]'.
    ls_reclist-receiver = gv_email_addr.
      ls_reclist-rec_type = 'U'.
      APPEND ls_reclist TO lt_reclist.
      IF ls_reclist-receiver IS INITIAL.
       MESSAGE i175.
      ELSE.
    *// Send EMail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = ls_doc_chng
            put_in_outbox              = lc_x
            commit_work                = lc_x
          TABLES
            packing_list               = lt_objpack
            object_header              = lt_objhead
            contents_bin               = lt_objbin
            contents_txt               = lt_objtxt
            receivers                  = lt_reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 3
            OTHERS                     = 99.
        CASE sy-subrc.
          WHEN 0.
    Mail successfully delivered
    *// Do nothing
          WHEN 1.
    This will never occur as at any point of time mail will be
    sent to one processor only.
    *// Do nothing
          WHEN 2.
           MESSAGE i175.
          WHEN 3.
           MESSAGE i175.
    *// Do nothing
        ENDCASE.
      ENDIF.
      REFRESH: lt_objpack,
               lt_objbin,
               lt_objtxt,
               lt_objhead,
               lt_reclist.
      CLEAR: ls_reclist,
             ls_doc_chng,
             ls_objpack,
             ls_objhead,
             ls_objtxt.
    DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\Udaya4.pdf'.
    CALL FUNCTION 'DOWNLOAD'
      EXPORTING
        bin_filesize     = gv_len
        filename         = gv_filename
        filetype         = 'BIN'
        filetype_no_show = 'X'
      IMPORTING
        act_filename     = gv_filename
        filesize         = gv_len
       cancel           = ''
      TABLES
        data_tab         = gt_pdf.
        FORM page_format .
    Local data
      DATA : lv_lines       TYPE i,
             lv_temp(500)   TYPE c,
             lv_offset      TYPE p,
             lv_lineslen(2) TYPE p,
             lv_mimelen(2)  TYPE p,
             lv_tabix       LIKE sy-tabix,
             ls_pdf_conv    TYPE solisti1,
             ls_xi_temp     TYPE bapiqcmime,
             ls_xi_pdf      TYPE tline.
      CLEAR : gt_xi_pdf,
              gt_xi_temp.
      REFRESH: gt_xi_pdf,
               gt_xi_temp.
      Copy the PDF file into table gt_xi_pdf
      gt_xi_pdf[] = gt_pdf[].
    Reformat the line to 255 characters wide (code from SAP)
      CLEAR: lv_temp, lv_offset, gt_xi_temp.
      DESCRIBE TABLE gt_xi_pdf   LINES  lv_lines.
      DESCRIBE FIELD ls_xi_pdf   LENGTH lv_lineslen IN CHARACTER MODE.
      DESCRIBE FIELD ls_xi_temp  LENGTH lv_mimelen IN CHARACTER MODE.
    Go through all the lines of table gt_xi_pdf
      LOOP AT gt_xi_pdf INTO ls_xi_pdf.
        lv_tabix = sy-tabix.
        Move ls_xi_pdf into lv_temp variable
        MOVE ls_xi_pdf TO lv_temp+lv_offset.
       Check if its the last line of table gt_xi_pdf
        IF lv_tabix = lv_lines.
          lv_lineslen = STRLEN( ls_xi_pdf ).
        ENDIF.
       Calculate the new offset
        lv_offset = lv_offset + lv_lineslen.
       Check if the new offset is equal to or greater than the length of
       gt_xi_temp
        IF lv_offset GE lv_mimelen.
          CLEAR ls_xi_temp.
        Copy the PDF data into gt_xi_temp
          ls_xi_temp = lv_temp(lv_mimelen).
          APPEND ls_xi_temp TO gt_xi_temp.
          SHIFT lv_temp BY lv_mimelen PLACES.
        Calculate the new offset
          lv_offset = lv_offset - lv_mimelen.
        ENDIF.                        "Offset GE MIMELEN
        Check if its the last line of gt_xi_pdf
        IF lv_tabix = lv_lines.
        Check if lv_temp has some data that is not been transferred to
        gt_xi_temp
          IF lv_offset GT 0.
            CLEAR ls_xi_temp.
         Copy the PDF data into gt_xi_temp
            ls_xi_temp = lv_temp(lv_offset).
            APPEND ls_xi_temp TO gt_xi_temp.
          ENDIF.   "lv_offset GT 0
        ENDIF.     "lv_tabix = lv_lines
      ENDLOOP.
      gt_pdf_conv[] = gt_xi_temp[].
    ENDFORM.                    " page_format

    all settings in SCOT is ok ? like SMTP settings , link b/w ur Outlook server and SAP server ?
    Regards
    Prabhu

  • Email a Smartform

    Hi all,
    I have created a smartform for PO and assigned it to a driver program,and I am able to take the print out.
    In NACE it is assigned and print out can be taken.
    Now tell me how to send the same PO through Email because in NACE we can see the input options to take the print out for a smartform. But not for Emailing.
    So please tell me how to Email a smartform? Do we need to make changes in the form created ?or we need to give some other inputs so that it can be mailed?
    Please answer
    Thx

    Hi,
    You can check the below code which can be used for sending the smartform as e-mail and do check in SDN before posting as it is a duplicate post.
    This has been given earlier by somebody. I am copying it and giving it to you
    Import parameters
    Param name      Type     associated type                                short text
    I_TID                    LIKE       THEAD-TDID                          Text ID of text to be read
    I_LAN                   LIKE       THEAD-TDSPRAS                    Language of text to be read
    I_L_NAME            LIKE        THEAD-TDNAME                  Name of text to be read
    I_OID                   LIKE        THEAD-TDOBJECT                Object of text to be read
    W_RETURN         TYPE      SSFCRESCL                              Smart Forms: Return value at end of form printing
    I_POTITLE           TYPE      EBELN                                     purchase order number
    W_DOC_CHNG   TYPE      SODOCCHGI1                         Data of an object which can be changed
    I_ADDRNUM       LIKE        ADR6-ADDRNUMBER            Address number of Vendor   
    Source code :
    PROGRAM TITLE          : MAIL SEND                                                                               
    AUTHOR                        : K PRASHANTI                                                                               
    DATE                              : 08/08/2008
    DESCRIPTION              : This function module helps in converting the smart form to                                   
                                           pdf format and sends mail with proper text in
                                              mail body                                                                               
    ----                                                                                ""Local Interface:"  IMPORTING
    *"     REFERENCE(I_TID) LIKE  THEAD-TDID
    *"     REFERENCE(I_LAN) LIKE  THEAD-TDSPRAS
    *"     REFERENCE(I_L_NAME) LIKE  THEAD-TDNAME
    *"     REFERENCE(I_OID) LIKE  THEAD-TDOBJECT
    *"     REFERENCE(W_RETURN) TYPE  SSFCRESCL
    *"     REFERENCE(I_POTITLE) TYPE  EBELN
    *"     REFERENCE(W_DOC_CHNG) TYPE  SODOCCHGI1
    *"     REFERENCE(I_ADDRNUM) LIKE  ADR6-ADDRNUMBER
    *data declaration
    *Internal Table declaration
      DATA : it_otf     TYPE STANDARD TABLE OF  itcoo ,
             it_tline   TYPE STANDARD TABLE OF  tline ,
             it_record  TYPE STANDARD TABLE OF  solisti1,
             it_objpack TYPE STANDARD TABLE OF  sopcklsti1,
             it_objtxt  TYPE STANDARD TABLE OF  solisti1 ,
             it_objbin  TYPE STANDARD TABLE OF  solisti1 ,
             it_reclist TYPE STANDARD TABLE OF  somlreci1 ,
             it_tdline  TYPE STANDARD TABLE OF  tline,
    *Work Area declarations
             wa_objhead     TYPE  soli_tab,
             wa_buffer      TYPE  string,       "To convert from 132 to 255
             wa_it_objtxt   TYPE  solisti1,
             wa_it_objpack  TYPE  sopcklsti1,
             wa_it_record   TYPE  solisti1,
             wa_it_reclist  TYPE  somlreci1,
             wa_it_tline    TYPE  tline,
             wa_tdline      TYPE  tline,
    *variable declaration
             v_lines_bin    TYPE  i,
             v_lines_txt    TYPE  i,
             v_len_in       TYPE  sood-objlen,         "#EC NEEDED
             v_mailaddr     TYPE  adr6-smtp_addr.
    *constant declaration
      CONSTANTS : c_msgtype TYPE c VALUE 'E',    " for declaring masseage type as error msg
                  c_X TYPE c VALUE 'X',
                  c_U TYPE c VALUE 'U'.
      it_otf[] = w_return-otfdata[]. 
    *calling function module to convert otf format of smartform to pdf format
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         format                      ='PDF'
         max_linewidth               = 132
        ARCHIVE_INDEX              =
        COPYNUMBER                 =
        ASCII_BIDI_VIS2LOG         =
        PDF_DELETE_OTFTAB          =
       IMPORTING
         bin_filesize                = v_len_in
        BIN_FILE                   =
        TABLES
          otf                        = it_otf
          lines                      = it_tline
       EXCEPTIONS
         err_max_linewidth           = 1
         err_format                  = 2
         err_conv_not_possible       = 3
         err_bad_otf                 = 4
         OTHERS                      = 5  .
      IF sy-subrc NE 0.
        sy-msgid = text-002.     "Vendor creation failed
        sy-msgty = c_msgtype.    " E
        sy-msgno = 040.
        sy-msgv1 = ' '.
        sy-msgv2 = ' '.
        sy-msgv3 = ' '.
        sy-msgv4 = ' '.
        EXIT.
      ELSE.
    Convert PDF from 132 to 255.
        LOOP AT it_tline INTO wa_it_tline.
          TRANSLATE wa_it_tline USING ' ~'.      " Replacing space by ~
          CONCATENATE wa_buffer wa_it_tline INTO wa_buffer.
        ENDLOOP.
        TRANSLATE wa_buffer USING '~ '.         " Replacing space by ~
        DO.
          wa_it_record = wa_buffer.
          APPEND wa_it_record TO it_record.     " Appending 255 characters as a record
          SHIFT wa_buffer LEFT BY 255 PLACES.
          IF wa_buffer IS INITIAL.
            EXIT.
          ENDIF.
        ENDDO.
        REFRESH:it_objbin.
        CLEAR wa_objhead.
    Object with PDF.
        it_objbin[] = it_record[].
        DESCRIBE TABLE it_objbin LINES v_lines_bin.
    *calling a function module read_text to get the text for the mail body
        CALL FUNCTION 'READ_TEXT'
         EXPORTING
            id                            = i_tid
            language                      = i_lan
            name                          = i_l_name
            object                        = i_oid
        IMPORTING
        HEADER                          =
         TABLES
            lines                         = it_tdline
         EXCEPTIONS
           id                             = 1
           language                       = 2
           name                           = 3
           not_found                      = 4
           object                         = 5
           reference_check                = 6
           wrong_access_to_archive        = 7
         OTHERS                           = 8
        IF sy-subrc <> 0.    "#EC
        ENDIF. 
        IF it_tdline IS NOT INITIAL.
          LOOP AT it_tdline INTO wa_tdline.
            wa_it_objtxt = wa_tdline-tdline.
            APPEND wa_it_objtxt TO it_objtxt.
            CLEAR: wa_tdline,
                   wa_it_objtxt.
          ENDLOOP.
          DESCRIBE TABLE it_objtxt LINES v_lines_txt.
        ENDIF.
    Pack to main body as RAW.
        CLEAR wa_it_objpack-transf_bin.        "Obj. to be transported not in binary form
        wa_it_objpack-head_start = 1.          "Start line of object header in transport packet
        wa_it_objpack-head_num = 0.            "Number of lines of an object header in object packet
        wa_it_objpack-body_start = 1.          "Start line of object contents in an object packet
        wa_it_objpack-body_num = v_lines_txt.  "Number of lines of the object contents in an object packet
    Code for document class
        wa_it_objpack-doc_type = text-004.        "RAW
        APPEND wa_it_objpack TO it_objpack.
    Packing as PDF.
        wa_it_objpack-transf_bin = c_X.           " X
        wa_it_objpack-head_start = 1.
        wa_it_objpack-head_num = 1.
        wa_it_objpack-body_start = 1.
        wa_it_objpack-body_num = v_lines_bin.
        wa_it_objpack-doc_type = text-001.        "PDF
        wa_it_objpack-obj_name = text-006.        "SmartForm
        CONCATENATE i_potitle '.pdf' INTO wa_it_objpack-obj_descr.
        wa_it_objpack-doc_size = v_lines_bin * 255.
        APPEND wa_it_objpack TO it_objpack.
    Document information.
        CLEAR wa_it_reclist.
    e-mail receivers... puting a select on adr6 to get mail id on basis of address number which is getting from adrc table based on your requiremnt .
        SELECT SINGLE smtp_addr FROM adr6 INTO v_mailaddr    "#EC *
         WHERE addrnumber = i_addrnum.
        wa_it_reclist-receiver = v_mailaddr.
        wa_it_reclist-express = c_X.                        " X
        wa_it_reclist-rec_type = c_U.                       "U -> Internet address
        APPEND wa_it_reclist TO it_reclist. 
    Sending Mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
          document_data                  = w_doc_chng
          put_in_outbox                  = c_X            "X
        COMMIT_WORK                    =
       IMPORTING
        SENT_TO_ALL                    =
        NEW_OBJECT_ID                  =
         TABLES
          packing_list                   = it_objpack
          object_header                  = wa_objhead
          contents_bin                   = it_objbin
          contents_txt                   = it_objtxt
        CONTENTS_HEX                   =
        OBJECT_PARA                    =
        OBJECT_PARB                    =
            receivers                    = it_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.
          sy-msgid = text-008.      "The entered value is not a valid Storage Location
          sy-msgty = c_msgtype.     " E
          sy-msgno = 041.      sy-msgv1 = ' '.
          sy-msgv2 = ' '.
          sy-msgv3 = ' '.
          sy-msgv4 = ' '.
          EXIT.
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    Please appreciate for the same.
    Regards
    Sachin

  • Emailing .pdf from Acrobat 9

    Hello
    I seem to be having an issue with emailing pdfs from acrobat. I am recieving an error "Acrobat is unable to connect to your email program" I am using Acrobat 9 running on a 2008r2 terminal server. The email program is Outlook 2010. All other users are able to attach a .pdf to email through adobe. Outlook is the default mapi client as i have read this is a common fix for this issue but it still does not work.

    Try clearing the profile preferences for Acrobat 9 and let them get recreate
    Repair both Acrobat and Outlook/Office
    BTW  I don't thing Windows Server 2008R2 was ever tested for Acrobat 9 on WTS.
    http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/reader/pdfs/wts_9.pdf

  • I'm unable to email PDF attachments, this has started in the last 2 weeks - any clues why as other file types are sending?

    I'm unable to email PDF attachments, this has started in the last 2 weeks - any clues why as other file types are sending?

    Greetings,
    That is rather strange. Attachments are attachments.  The big difference between what will send and what won't is usually either who you are sending it to (wrong email address) or how big the attachment is (most email providers have a limit to the total message size between 10 MB and 20 MB).
    -- What happens when you say you are "unable to email PDF attachments"?  What error message do you get?
    -- Are you sending these emails using the Mail program?
    -- What is the file size of the PDF you are trying to send?
    -- What happens if you compress the PDF before you email it (Highlight the PDF on the desktop and then go to File > Compress) ?
    -- What happens if you send the PDF to yourself?
    Cheers.

  • Ipad 2 - email PDF attachments corrupt

    I seem to be having trouble viewing PDF's on my Ipad2.  They read fine on my iphone and my mac and my work PC.  When I "open in" any reader I have same problem.  I tried Ibooks, goodreader, notesplus, Pdf provider and so on.  I get some graphics but then blurry or blackish boxey lines where words should be written.
    I can open them in "cloud on" fine also.  Strange. 
    Any comments?

    Greetings,
    That is rather strange. Attachments are attachments.  The big difference between what will send and what won't is usually either who you are sending it to (wrong email address) or how big the attachment is (most email providers have a limit to the total message size between 10 MB and 20 MB).
    -- What happens when you say you are "unable to email PDF attachments"?  What error message do you get?
    -- Are you sending these emails using the Mail program?
    -- What is the file size of the PDF you are trying to send?
    -- What happens if you compress the PDF before you email it (Highlight the PDF on the desktop and then go to File > Compress) ?
    -- What happens if you send the PDF to yourself?
    Cheers.

  • Cannot email pdf using Acrobat Reader XI v11.0.3 in Windows 8. No problem when using in ms vista. ge

    Cannot email pdf using Acrobat Reader XI v11.0.3 in Windows 8. No problem when using in ms vista. get "authentication error". Sometimes will get a very quick dialogue box showing the gmail login screen but then disappears. I use firefox and IE

    Hi Rodney
    Welcome to Apple Discussions
    This sounds like one of those "oddities", contributed to by a few sources.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    Wondering if you disabled the Safari Cache would the refresh function work correctly? As a test you can disable the Safari Cache by Emptying the Cache first via the Safari menu, then Quit Safari. Now go to the Finder>Your User Library>Caches>Safari. Single click on the Safari folder, then Apple Key + I to open Info panel. There, check the "locked" box. This prevents further additions to the cache. The downside, you lose your ability to upload images etc. within Safari (my cache is disabled, so I use Firefox for the uploads).
    Then restart Safari. Try the PDF from within Safari.
    Post back

  • I am unable to email pdf files. Cant print them either

    I am unable to email PDF files or print them. This happened after i upgraded my Adobe. I have deleted the program and reinstalled several times.

    Windows 7 & adobe reader xi. PDFs will only print a partial page. All other files print. Can't email a PDF attachment. An error message comes up that reads....your server has unexpectedly terminated the connection. This only happens with PDF files
    Sent from my iPhone

  • PDF converter error

    Signed in.  Was offered a different email address at signin, ignored.  Signed into account fine.  Tried to convert PDF to Word as I have numerous times before.  This time I keep getting the error message "Invalid email address or password.  Click "sign up" if you don't have an account".  I've checked my ID page and everything is correct.  Need my documents NOW.  Can you help me?

    I was unable to view this response.  I checked the blog but this post appeared at the bottom of the page and only indicated there was a post but no text appeared.  Does it make a difference that I've been viewing the blog on my iPad which does not support Adobe products?
    Thank you so much for responding to my post.  I'm glad I'm not the only one facing frustration.
    Re: PDF converter error
    created by Atimoth in Adobe ExportPDF - View the full discussion
    The problem does not seem to be with the version of Adobe Reader that I have. It seems to be a problem when connecting to your server. There are other forum posts where others are experiencing the same difficulty.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6070278#6070278
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6070278#6070278
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6070278#6070278. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe ExportPDF at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Email pdf fails on different login

    Hello Everyone,
    Created an emailable pdf form with livecycle.  Tested on that computer under a different login (someone else working on it) and it continually failed to send (operation failed).  Tested on a different computer and it works fine.  Tested under a different login on original computer and it works fine.  Any ideas what could be failing?
    Here is how we created it and stats of system (corporate system so changes not an option):
    xp
    acrobat 9
    associated livecycle designer
    created email submit button and changed xml to "pdf" in the submit area
    opened form in acrobat and added advanced->extend for reader, saved file
    opened just after that in reader, operation fails
    opened on different computer and different user, operation works.
    Thanks for the help!!

    Hello all,
    I have narrowed down the error but still need help to fix.  On initial opening of the form for that session of being logged in, if the person's email program is not open (outlook) then reader opens an invisible instance and creates a new email with the pdf attached (all good so far).  Then, hitting send, closes that instance of outlook message and puts the message in the outbox but does not send!!!  Then, when I try to send another form by hitting send by email button, the operation fails.  At a guess it is because there is something not completely closing down on a failed send from outlook.  Also, when the email pops up to send and instead of sending is canceled by closing, on the next instance of trying to send (same reader open session or closing and trying again) there is an operation fail.  Presuming this is because of the same reason that the action sending to outlook is not properly shut down.
    Is there anything that can be done to fix this error??

  • PDF decoding error then  data exceeds 99 pages

    Dear all,
    i'm facing a PDF decoding error when as an atachment in a Email.
    I figure that PDF attachment is opening when it HAS less the 100 pages but can not open
    below is the error message when open ADOBE, this happens only when pages are more  than 99.
    "Adobe Reader could not open 'NAME.PDF' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded) "
    can anyone help me please.

    For checking this
    First download using fm GUI_DOWNLOAD as bin (PDF) download to you desktop and open it. if its working then you may need to check settings in SCOT.

  • Processing this item failed because of a PDF parser error. Input string was not in a correct format.

    Good Morning,
    We're having issues parsing several hundred PDF files located in two separate Record Center sites. All other PDF documents in the environment are being crawled and parsed without issue. I've verified the permissions for the Search service account, but that
    doesn't seem to be the issue. Searching for this particular error hasn't returned much, but I have ensured that the Search service account has been added to the necessary Local Security Policy objects and cleared the configuration cache. Any help would be
    greatly appreciated.
    Processing this item failed because of a PDF parser error. ( Error parsing document 'https://asdf.com/sites/HRRecords/asdf.pdf'. Input string was not in a correct format.; ; SearchID = 6642FEEF-6921-434E-B084-02809173D8A7 )

    This issue came back up for me as my results aren't displaying since this data is not part of the search index.
    Curious if anyone knows of a way to increase the parser server memory in SharePoint 2013 search?
    http://sharepoint/materials-ca/HPSActiveCDs/Votrevieprofessionnelleetvotrecarrireenregistrement.zip
    Processing this item failed because the parser server ran out of memory. ( Error parsing document 'http://sharepoint/materials-ca/HPSActiveCDs/Votrevieprofessionnelleetvotrecarrireenregistrement.zip'. Document failed to be processed. It probably crashed the
    server.; ; SearchID = 097AE4B0-9EB0-4AEC-AECE-AEFA631D4AA6 )
    http://sharepoint/materials-ca/HPSActiveCDs/Travaillerauseindunequipemultignrationnelle.zip
    Processing this item failed because of a IFilter parser error. ( Error parsing document 'http://sharepoint/materials-ca/HPSActiveCDs/Travaillerauseindunequipemultignrationnelle.zip'. Error loading IFilter for extension '.zip' (Error code is 0x80CB4204). The
    function encountered an unknown error.; ; SearchID = 4A0C99B1-CF44-4C8B-A6FF-E42309F97B72 )

  • TS3276 Can't open web addresses from an email-get an ERROR message saying-no application could be found

    Can't open web addresses from an email-get an ERROR message saying-no application could be found

    Hi, I had the same problem. I finally figured it out. Plug in the USB cord to your ipad, but beofre plugging it into your computer make sure your ipad is not in the locked or sleep mode. Once I did this, my photos showed up and started downloading. Hope that helps you!

  • Printing dunning notices using SMARTFORMS,error during parameter transfer

    Hi Friends,
                    I face a error message "Include text ZGA_DUN_HDR does not exist (object TEXT, ID ST)" when i run the dunning run.
                    I had searched every node for text ZGA_DUN_HDR in the smartform,I didnt find the text in it.
    However when I execute the smart form for print preview an error message "Printing dunning notices using SMARTFORMS,error during parameter transfer".This error i believe is due to wrong parameter passing in the fm 'GET_SF_DUNN_DATA'.It raises an error no_parameters_found.All parameters are passed correctly.
                    Can you guys help me out.
    Edited by: RAJIV KAUSHAL on Nov 14, 2008 6:03 PM

    you can create this text ZGA_DUN_HDR  in SO10 tcode and try ...

  • Smartforms error 173

    I would like to know how to solve the following error in smartforms:
    Error number: 173
    Message     : "Table does not fit into window."
    Exception   : FORMATTING_ERROR
    Message ID  : SSFCOMPOSER
    I am trying to fit a main window and another window in a
    template
    Thanks in advance

    As I discovered, this error occurred when there is a conflict between the window created for a template and the template itself. The main node for the template is the window in which one can define a height. In the template, which is the node below the window node, one is also required to enter a value for height that has to be the same value. This can be done in the Template table (tab Template), you’ll find the height defined that is in conflict with the height defined in the table of the window.

Maybe you are looking for

  • Building for Retina Display??

    Are books created for Retina display compatible with 1st and 2nd Gen iPads?

  • How to run ABAP code as a daemon process?

    Background: I need a daemon process to check status and react on it. This daemon may run for a long time. Current: to implement this, use an update module, to call a normal module with an endless loop (the loop may end dependent on some condition). W

  • Does the current WebKit version in Air SDK 3.5 support Uint8Array or any bufferArray stuffs?

    Does the current WebKit version in Air SDK 3.5 support Uint8Array or any bufferArray stuffs?  If not, is there an alternative or workaround solution so I can reuse some javascript routines that requires bufferArray like Uint8Array...?   Thanks in adv

  • Embed images inFH10

    is there a way to make FH10 embed the images instead of linking to them. i print my artwork externally and this affects me a lot as i sometimes forget to include the images.

  • CS5 Master Coll installs 32bit Photoshop on 64bit Win7

    I have installed a CS5 Master Collection on my PC with Win7 64bit. To my big surprise I found the 32bit version of Photoshop on my PC now. Before that action I had already Photoshop CS5 64-bit installed on this PC, I uninstalled it prior to the Maste