Problem in sending the smartform as email for other language except english

Hi Experts,
I could not send the smartform as an attachment for other languages, but where as i could send it in english.
The program is working fine with print priview but not when sending the SF as an attachment
(in other languages except english).
Please do find the below code which i used to send the smartform as an attachment.
Please let me know if there is any mistake in the code.
    wa_ctrlop-LANGU = nast-spras.
    wa_ctrlop-getotf = 'X'.
    wa_ctrlop-no_dialog = 'X'.
    wa_compop-tdnoprev = 'X'.
    CALL FUNCTION lf_fm_name                  "'/1BCDWB/SF00000197'
      EXPORTING
        control_parameters = wa_ctrlop
        output_options     = wa_compop
        user_settings      = 'X'
        is_ekko            = l_doc-xekko
        is_pekko           = l_doc-xpekko
        is_nast            = l_nast
        iv_from_mem        = l_from_memory
        iv_druvo           = iv_druvo
        iv_xfz             = iv_xfz
      IMPORTING
        job_output_info    = wa_return
      TABLES
        it_ekpo            = l_doc-xekpo[]
        it_ekpa            = l_doc-xekpa[]
        it_pekpo           = l_doc-xpekpo[]
        it_eket            = l_doc-xeket[]
        it_tkomv           = l_doc-xtkomv[]
        it_ekkn            = l_doc-xekkn[]
        it_ekek            = l_doc-xekek[]
        it_komk            = l_xkomk[]
      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.
*Convert the data from OTF to PDF format
    it_otf[] = wa_return-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        format                = 'PDF'
        max_linewidth         = 132
      IMPORTING
        bin_filesize          = l_len_in
        bin_file              = lp_xcontent
      TABLES
        otf                   = it_otf
        lines                 = it_tline
      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.
    TRY.
  ---------- create persistent send request ----------------------
        send_request = cl_bcs=>create_persistent( ).
        len = XSTRLEN( lp_xcontent ).
transform to solix tab
        lt_solix =
          cl_document_bcs=>xstring_to_solix(
            ip_xstring = lp_xcontent ).
Create Body to the E-mail.
        APPEND Text-005 TO l_text.
Attachment Name
        l_ponumber = text-004.
        CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
Subject for the E-Mail.
        l_subject = text-001.
        CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
*create document E-Mail.
*TRY.
CALL METHOD cl_document_bcs=>create_document
  EXPORTING
    i_type        = 'RAW'
    i_subject     = l_subject
    i_length      = '13'
    i_language    = nast-spras
   i_importance  =
   i_sensitivity =
    i_text        = l_text
   i_hex         =
   i_header      =
   i_sender      =
  receiving
    RESULT        = l_email_object
CATCH cx_document_bcs .
*ENDTRY.
       CALL METHOD cl_document_bcs=>create_document
         EXPORTING
           i_type    = 'RAW'
           i_subject = l_subject
           i_length  = '13'
           i_text    = l_text
         RECEIVING
           result    = l_email_object.
*Create PDF Document
        bcs_doc =  cl_document_bcs=>create_document(
                                        i_type     = 'PDF'
                                        i_subject  = l_ponumber
                                        i_length   = len
                                        i_language = nast-spras
                                        i_hex     = lt_solix
*Type casting
        obj_pdf_file ?= bcs_doc.
Add PDF document as an attachment
        CALL METHOD l_email_object->add_document_as_attachment
          EXPORTING
            im_document = obj_pdf_file.

hi,
i tried with ur problem.but i am able send mail in other languages also.actaullly i wrote a msg whether the mail has been sent or not.i got success message. i am placing my code here please go thorugh it,and do relavant modifications.
*& Report  ZPPS_SMARTFORM_TO_PDF
REPORT  ZPPS_SMARTFORM_TO_PDF.
PARAMETER: p_date LIKE sy-datum.
PARAMETER: p_rea TYPE char255.
DATA: t_otfdata TYPE ssfcrescl,
      t_lines LIKE tline OCCURS 0 WITH HEADER LINE,
      t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
      t_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
Objects to send mail.
DATA:T_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
     T_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
     T_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
     T_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i,
      w_bin_filesize TYPE i,
      wa_ctrlop TYPE ssfctrlop,
      wa_outopt TYPE ssfcompop,
      WA_BUFFER TYPE STRING,          "To convert from 132 to 255
      WA_OBJHEAD TYPE SOLI_TAB,
      WA_DOC_CHNG TYPE SODOCCHGI1,
      W_DATA TYPE SODOCCHGI1.
DATA: form_name TYPE rs38l_fnam,
      V_LINES_TXT TYPE I,
      V_LINES_BIN TYPE I,
      nast-spras type sy-langu value 'DE'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME                 = 'ZSR_DEMO1'
  VARIANT                  = ' '
  DIRECT_CALL              = ' '
IMPORTING
   FM_NAME                  = 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.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION form_name
  EXPORTING
  ARCHIVE_INDEX              =
  ARCHIVE_INDEX_TAB          =
  ARCHIVE_PARAMETERS         =
   CONTROL_PARAMETERS         = wa_ctrlop
  MAIL_APPL_OBJ              =
  MAIL_RECIPIENT             =
  MAIL_SENDER                =
   OUTPUT_OPTIONS             = wa_outopt
   USER_SETTINGS              = 'X'
    MYDATE                     = p_date
    REASON                     = p_rea
IMPORTING
  DOCUMENT_OUTPUT_INFO       =
   JOB_OUTPUT_INFO            = t_otfdata
  JOB_OUTPUT_OPTIONS         =
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.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
   FORMAT                      = 'PDF'
   MAX_LINEWIDTH               = 132
  ARCHIVE_INDEX               = ' '
  COPYNUMBER                  = 0
  ASCII_BIDI_VIS2LOG          = ' '
  PDF_DELETE_OTFTAB           = ' '
IMPORTING
   BIN_FILESIZE                = w_bin_filesize
  BIN_FILE                    =
  TABLES
    OTF                         = t_otf
    LINES                       = t_lines
EXCEPTIONS
   ERR_MAX_LINEWIDTH           = 1
   ERR_FORMAT                  = 2
   ERR_CONV_NOT_POSSIBLE       = 3
   ERR_BAD_OTF                 = 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.
loop at t_lines.
TRANSLATE t_lines USING '~'.
  CONCATENATE WA_BUFFER T_LINES INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
  t_RECORD = WA_BUFFER.
  APPEND t_RECORD.
  SHIFT WA_BUFFER LEFT BY 255 PLACES.
  IF WA_BUFFER IS INITIAL.
    EXIT.
  ENDIF.
ENDDO.
Attachment
REFRESH: T_RECLIST,
T_OBJTXT,
T_OBJBIN,
T_OBJPACK.
CLEAR WA_OBJHEAD.
T_OBJBIN[] = T_RECORD[].
Create Message Body Title and Description
T_OBJTXT = 'test with pdf-Attachment!'.
APPEND T_OBJTXT.
DESCRIBE TABLE T_OBJTXT LINES V_LINES_TXT.
READ TABLE T_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 T_OBJPACK-TRANSF_BIN.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = V_LINES_TXT.
T_OBJPACK-DOC_TYPE = 'RAW'.
APPEND T_OBJPACK.
Attachment (pdf-Attachment)
T_OBJPACK-TRANSF_BIN = 'X'.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
DESCRIBE TABLE T_OBJBIN LINES V_LINES_BIN.
READ TABLE T_OBJBIN INDEX V_LINES_BIN.
T_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
T_OBJPACK-BODY_NUM = V_LINES_BIN.
T_OBJPACK-DOC_TYPE = 'PDF'.
T_OBJPACK-OBJ_NAME = 'smart'.
T_OBJPACK-OBJ_DESCR = 'test'.
APPEND T_OBJPACK.
CLEAR T_RECLIST.
T_RECLIST-RECEIVER = 'MAIL-ID'.
T_RECLIST-REC_TYPE = 'U'.
APPEND T_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               = T_OBJPACK
    OBJECT_HEADER              = WA_OBJHEAD
    CONTENTS_BIN               = T_OBJBIN
    CONTENTS_TXT               = T_OBJTXT
    RECEIVERS                  = T_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.
and i thought of one more soluyion u can write
wa_ctrlop-langu = T002-spras. i think it will also help for u.
revert back if any questions.
please reward me if helpful.
gupta.pullipudi

Similar Messages

  • Problem in sending the smartform as an email in a country specific language

    Hi,
    I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
    the program is working fine for english.
    Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
    Please help.
    Arun.
    Determine smartform function module for purchase document
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = lf_formname
        IMPORTING
          fm_name            = lf_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
    error handling
        ent_retco = sy-subrc.
        IF sy-subrc = 1.
          MESSAGE e001(/smb40/ssfcomposer).
        ENDIF.
        IF sy-subrc = 2.
          MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
        ENDIF.
        PERFORM protocol_update_i.
      ENDIF.
    *Start of changes <Arun K Singarapu> C082493 <04/28/2008>
    *for print preview
      IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
        CALL FUNCTION lf_fm_name                  "'/1BCDWB/SF00000197'
          EXPORTING
            control_parameters = wa_ctrlop
            output_options     = wa_compop
            user_settings      = 'X'
            is_ekko            = l_doc-xekko
            is_pekko           = l_doc-xpekko
            is_nast            = l_nast
            iv_from_mem        = l_from_memory
            iv_druvo           = iv_druvo
            iv_xfz             = iv_xfz
          IMPORTING
            job_output_info    = wa_return
          TABLES
            it_ekpo            = l_doc-xekpo[]
            it_ekpa            = l_doc-xekpa[]
            it_pekpo           = l_doc-xpekpo[]
            it_eket            = l_doc-xeket[]
            it_tkomv           = l_doc-xtkomv[]
            it_ekkn            = l_doc-xekkn[]
            it_ekek            = l_doc-xekek[]
            it_komk            = l_xkomk[]
          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.
        EXIT.
      ELSE.
        wa_ctrlop-LANGU = nast-spras.
        wa_ctrlop-getotf = 'X'.
        wa_ctrlop-no_dialog = 'X'.
        wa_compop-tdnoprev = 'X'.
        CALL FUNCTION lf_fm_name                  "'/1BCDWB/SF00000197'
          EXPORTING
            control_parameters = wa_ctrlop
            output_options     = wa_compop
            user_settings      = 'X'
            is_ekko            = l_doc-xekko
            is_pekko           = l_doc-xpekko
            is_nast            = l_nast
            iv_from_mem        = l_from_memory
            iv_druvo           = iv_druvo
            iv_xfz             = iv_xfz
          IMPORTING
            job_output_info    = wa_return
          TABLES
            it_ekpo            = l_doc-xekpo[]
            it_ekpa            = l_doc-xekpa[]
            it_pekpo           = l_doc-xpekpo[]
            it_eket            = l_doc-xeket[]
            it_tkomv           = l_doc-xtkomv[]
            it_ekkn            = l_doc-xekkn[]
            it_ekek            = l_doc-xekek[]
            it_komk            = l_xkomk[]
          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.
    *Convert the data from OTF to PDF format
        it_otf[] = wa_return-otfdata[].
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = l_len_in
            bin_file              = lp_xcontent
          TABLES
            otf                   = it_otf
            lines                 = it_tline
          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.
        TRY.
      ---------- create persistent send request ----------------------
            send_request = cl_bcs=>create_persistent( ).
            len = XSTRLEN( lp_xcontent ).
    transform to solix tab
            lt_solix =
              cl_document_bcs=>xstring_to_solix(
                ip_xstring = lp_xcontent ).
    Create Body to the E-mail.
            APPEND Text-005 TO l_text.
    Attachment Name
            l_ponumber = text-004.
            CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
    Subject for the E-Mail.
            l_subject = text-001.
            CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
    *create document E-Mail.
            CALL METHOD cl_document_bcs=>create_document
              EXPORTING
                i_type    = 'RAW'
                i_subject = l_subject
                i_length  = '13'
                i_text    = l_text
              RECEIVING
                result    = l_email_object.
    *Create PDF Document
            bcs_doc =  cl_document_bcs=>create_document(
                                            i_type     = 'PDF'
                                            i_subject  = l_ponumber
                                            i_length   = len
                                            i_language = nast-spras
                                            i_hex     = lt_solix
    *Type casting
            obj_pdf_file ?= bcs_doc.
    Add PDF document as an attachment
            CALL METHOD l_email_object->add_document_as_attachment
              EXPORTING
                im_document = obj_pdf_file.
    get the attachments of the PO for each line item
            SELECT ebeln
                   ebelp
                   FROM ekpo
                   INTO TABLE it_ekpo
                   WHERE ebeln = l_doc-xekko-ebeln.
    concatenate PO and the Line Item Numebr to get the Object key
            LOOP AT it_ekpo INTO wa_ekpo.
              CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
              APPEND wa_temp TO it_temp.
              CLEAR: wa_temp,wa_ekpo.
            ENDLOOP.
    *Get data from table DRAD
            IF it_temp[] IS NOT INITIAL.
              SELECT dokar
                     doknr
                     dokvr
                     doktl
                     objky
                     FROM drad
                     client specified
                     INTO TABLE it_drad
                     FOR ALL ENTRIES IN it_temp
                     WHERE mandt = sy-mandt
                     AND objky = it_temp-objky.
            ENDIF.
            IF NOT it_drad IS INITIAL.
              SELECT * FROM dms_doc2loio
                       INTO TABLE it_dms_doc2loio
                       FOR ALL ENTRIES IN it_drad
                       WHERE dokar = 'SRM'
                         AND doknr = it_drad-doknr
                         AND dokvr = it_drad-dokvr
                         AND doktl = it_drad-doktl.
            ENDIF.
    Get the Physical object class and Object ID of the attachment
            IF NOT it_dms_doc2loio IS INITIAL.
              SELECT * FROM dms_ph_cd1
                       INTO TABLE it_dms_ph_cd1
                       FOR ALL ENTRIES IN it_dms_doc2loio
                       WHERE loio_id = it_dms_doc2loio-lo_objid.
            ENDIF.
    Get the file from the DMS server using the below function module.
            LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
              wa_object_id-class = wa_dms_ph_cd1-ph_class.
              wa_object_id-objid = wa_dms_ph_cd1-phio_id.
              CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
                EXPORTING
                  object_id           = wa_object_id
                  client              = sy-mandt
                TABLES
                  file_access_info    = it_file_access_info
                  file_content_binary = it_sdokcntbin
                EXCEPTIONS
                  not_existing        = 1
                  not_authorized      = 2
                  no_content          = 3
                  bad_storage_type    = 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.
              READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
              IF wa_file_access_info-mimetype = 'application/msword'.
                l_doc_type = 'DOC'.
                CLEAR: a_xstring,len.
                LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
                  CONCATENATE a_xstring wa_sdokcntbin-line
                         INTO a_xstring IN BYTE MODE.
                ENDLOOP.
                len = XSTRLEN( a_xstring ).
        transform to solix tab - adding additional attachments
                REFRESH lt_solix.
                lt_solix =
                  cl_document_bcs=>xstring_to_solix(
                    ip_xstring = a_xstring ).
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_solix
    *Type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for PDF document
              ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
                l_doc_type = 'PDF'.
                file_size = wa_file_access_info-file_size.
    Convert the 1022 binary data to xstring
                CLEAR a_xstring.
                CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
                  EXPORTING
                    input_length = file_size
                  IMPORTING
                    buffer       = a_xstring
                  TABLES
                    binary_tab   = it_sdokcntbin
                  EXCEPTIONS
                    failed       = 1
                    OTHERS       = 2.
                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: w_output_length TYPE i.
    Convert Xstring to 255 RAW
                CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
                  EXPORTING
                    buffer        = a_xstring
                  IMPORTING
                    output_length = w_output_length
                  TABLES
                    binary_tab    = lt_content_bin.
                len = w_output_length.
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_content_bin
           type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for Excel Document
              ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
                l_doc_type = 'XLS'.
                CLEAR: a_xstring,len.
                LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
                  CONCATENATE a_xstring wa_sdokcntbin-line
                         INTO a_xstring IN BYTE MODE.
                ENDLOOP.
                len = XSTRLEN( a_xstring ).
        transform to solix tab - adding additional attachments
                REFRESH lt_solix.
                lt_solix =
                  cl_document_bcs=>xstring_to_solix(
                    ip_xstring = a_xstring ).
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_solix
    *Type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for text doxument
              ELSEIF wa_file_access_info-mimetype = 'plain/text'.
                l_doc_type = 'TXT'.
                file_size = wa_file_access_info-file_size.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
                  EXPORTING
                    input_length = file_size
                  TABLES
                    binary_tab   = it_sdokcntbin
                    text_tab     = file_data
                  EXCEPTIONS
                    failed       = 1
                    OTHERS       = 2.
                IF sy-subrc <> 0.
                  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
                ENDIF.
                CALL METHOD cl_document_bcs=>create_document
                  EXPORTING
                    i_type    = l_doc_type
                    i_subject = l_filename
                    i_text    = file_data
                  RECEIVING
                    result    = bcs_doc1.
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
              ENDIF.
              CLEAR:it_file_access_info,it_sdokcntbin.
              CLEAR:wa_object_id,wa_file_access_info,file_size.
            ENDLOOP.
            CALL METHOD send_request->set_document( l_email_object ).
    *Get the address number for the vendor
            SELECT SINGLE adrnr
                          FROM lfa1
                          INTO l_adrnr
                          WHERE lifnr = l_doc-xekko-lifnr.
            MOVE l_adrnr TO l_addrno.
    Get the Email Address for the vendor using address number
            CALL FUNCTION 'ADDR_GET_REMOTE'
              EXPORTING
                addrnumber        = l_addrno
              TABLES
                adsmtp            = it_adsmtp
              EXCEPTIONS
                parameter_error   = 1
                address_not_exist = 2
                internal_error    = 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.
            sender = cl_sapuser_bcs=>create( sy-uname ).
            CALL METHOD send_request->set_sender
              EXPORTING
                i_sender = sender.
            READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
            IF sy-subrc = 0.
              LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
                CALL METHOD cl_cam_address_bcs=>create_internet_address
                  EXPORTING
                    i_address_string = wa_adsmtp-smtp_addr
                  RECEIVING
                    result           = recipient.
                CALL METHOD send_request->add_recipient
                  EXPORTING
                    i_recipient = recipient
                    i_express   = 'X'.
              ENDLOOP.
            ELSE.
              READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
              IF sy-subrc = 0.
                CALL METHOD cl_cam_address_bcs=>create_internet_address
                  EXPORTING
                    i_address_string = wa_adsmtp-smtp_addr
                  RECEIVING
                    result           = recipient.
                CALL METHOD send_request->add_recipient
                  EXPORTING
                    i_recipient = recipient
                    i_express   = 'X'.
              ENDIF.
            ENDIF.
            CALL METHOD send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
              RECEIVING
                result              = l_sent_to_all ).
          CATCH cx_bcs INTO bcs_exception.
            WRITE: 'Fehler aufgetreten.'(001).
            WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
            EXIT.
        ENDTRY.
      ENDIF.

    Hi,
    I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
    the program is working fine for english.
    Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
    Please help.
    Arun.
    Determine smartform function module for purchase document
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = lf_formname
        IMPORTING
          fm_name            = lf_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
    error handling
        ent_retco = sy-subrc.
        IF sy-subrc = 1.
          MESSAGE e001(/smb40/ssfcomposer).
        ENDIF.
        IF sy-subrc = 2.
          MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
        ENDIF.
        PERFORM protocol_update_i.
      ENDIF.
    *Start of changes <Arun K Singarapu> C082493 <04/28/2008>
    *for print preview
      IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
        CALL FUNCTION lf_fm_name                  "'/1BCDWB/SF00000197'
          EXPORTING
            control_parameters = wa_ctrlop
            output_options     = wa_compop
            user_settings      = 'X'
            is_ekko            = l_doc-xekko
            is_pekko           = l_doc-xpekko
            is_nast            = l_nast
            iv_from_mem        = l_from_memory
            iv_druvo           = iv_druvo
            iv_xfz             = iv_xfz
          IMPORTING
            job_output_info    = wa_return
          TABLES
            it_ekpo            = l_doc-xekpo[]
            it_ekpa            = l_doc-xekpa[]
            it_pekpo           = l_doc-xpekpo[]
            it_eket            = l_doc-xeket[]
            it_tkomv           = l_doc-xtkomv[]
            it_ekkn            = l_doc-xekkn[]
            it_ekek            = l_doc-xekek[]
            it_komk            = l_xkomk[]
          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.
        EXIT.
      ELSE.
        wa_ctrlop-LANGU = nast-spras.
        wa_ctrlop-getotf = 'X'.
        wa_ctrlop-no_dialog = 'X'.
        wa_compop-tdnoprev = 'X'.
        CALL FUNCTION lf_fm_name                  "'/1BCDWB/SF00000197'
          EXPORTING
            control_parameters = wa_ctrlop
            output_options     = wa_compop
            user_settings      = 'X'
            is_ekko            = l_doc-xekko
            is_pekko           = l_doc-xpekko
            is_nast            = l_nast
            iv_from_mem        = l_from_memory
            iv_druvo           = iv_druvo
            iv_xfz             = iv_xfz
          IMPORTING
            job_output_info    = wa_return
          TABLES
            it_ekpo            = l_doc-xekpo[]
            it_ekpa            = l_doc-xekpa[]
            it_pekpo           = l_doc-xpekpo[]
            it_eket            = l_doc-xeket[]
            it_tkomv           = l_doc-xtkomv[]
            it_ekkn            = l_doc-xekkn[]
            it_ekek            = l_doc-xekek[]
            it_komk            = l_xkomk[]
          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.
    *Convert the data from OTF to PDF format
        it_otf[] = wa_return-otfdata[].
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = l_len_in
            bin_file              = lp_xcontent
          TABLES
            otf                   = it_otf
            lines                 = it_tline
          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.
        TRY.
      ---------- create persistent send request ----------------------
            send_request = cl_bcs=>create_persistent( ).
            len = XSTRLEN( lp_xcontent ).
    transform to solix tab
            lt_solix =
              cl_document_bcs=>xstring_to_solix(
                ip_xstring = lp_xcontent ).
    Create Body to the E-mail.
            APPEND Text-005 TO l_text.
    Attachment Name
            l_ponumber = text-004.
            CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
    Subject for the E-Mail.
            l_subject = text-001.
            CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
    *create document E-Mail.
            CALL METHOD cl_document_bcs=>create_document
              EXPORTING
                i_type    = 'RAW'
                i_subject = l_subject
                i_length  = '13'
                i_text    = l_text
              RECEIVING
                result    = l_email_object.
    *Create PDF Document
            bcs_doc =  cl_document_bcs=>create_document(
                                            i_type     = 'PDF'
                                            i_subject  = l_ponumber
                                            i_length   = len
                                            i_language = nast-spras
                                            i_hex     = lt_solix
    *Type casting
            obj_pdf_file ?= bcs_doc.
    Add PDF document as an attachment
            CALL METHOD l_email_object->add_document_as_attachment
              EXPORTING
                im_document = obj_pdf_file.
    get the attachments of the PO for each line item
            SELECT ebeln
                   ebelp
                   FROM ekpo
                   INTO TABLE it_ekpo
                   WHERE ebeln = l_doc-xekko-ebeln.
    concatenate PO and the Line Item Numebr to get the Object key
            LOOP AT it_ekpo INTO wa_ekpo.
              CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
              APPEND wa_temp TO it_temp.
              CLEAR: wa_temp,wa_ekpo.
            ENDLOOP.
    *Get data from table DRAD
            IF it_temp[] IS NOT INITIAL.
              SELECT dokar
                     doknr
                     dokvr
                     doktl
                     objky
                     FROM drad
                     client specified
                     INTO TABLE it_drad
                     FOR ALL ENTRIES IN it_temp
                     WHERE mandt = sy-mandt
                     AND objky = it_temp-objky.
            ENDIF.
            IF NOT it_drad IS INITIAL.
              SELECT * FROM dms_doc2loio
                       INTO TABLE it_dms_doc2loio
                       FOR ALL ENTRIES IN it_drad
                       WHERE dokar = 'SRM'
                         AND doknr = it_drad-doknr
                         AND dokvr = it_drad-dokvr
                         AND doktl = it_drad-doktl.
            ENDIF.
    Get the Physical object class and Object ID of the attachment
            IF NOT it_dms_doc2loio IS INITIAL.
              SELECT * FROM dms_ph_cd1
                       INTO TABLE it_dms_ph_cd1
                       FOR ALL ENTRIES IN it_dms_doc2loio
                       WHERE loio_id = it_dms_doc2loio-lo_objid.
            ENDIF.
    Get the file from the DMS server using the below function module.
            LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
              wa_object_id-class = wa_dms_ph_cd1-ph_class.
              wa_object_id-objid = wa_dms_ph_cd1-phio_id.
              CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
                EXPORTING
                  object_id           = wa_object_id
                  client              = sy-mandt
                TABLES
                  file_access_info    = it_file_access_info
                  file_content_binary = it_sdokcntbin
                EXCEPTIONS
                  not_existing        = 1
                  not_authorized      = 2
                  no_content          = 3
                  bad_storage_type    = 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.
              READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
              IF wa_file_access_info-mimetype = 'application/msword'.
                l_doc_type = 'DOC'.
                CLEAR: a_xstring,len.
                LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
                  CONCATENATE a_xstring wa_sdokcntbin-line
                         INTO a_xstring IN BYTE MODE.
                ENDLOOP.
                len = XSTRLEN( a_xstring ).
        transform to solix tab - adding additional attachments
                REFRESH lt_solix.
                lt_solix =
                  cl_document_bcs=>xstring_to_solix(
                    ip_xstring = a_xstring ).
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_solix
    *Type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for PDF document
              ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
                l_doc_type = 'PDF'.
                file_size = wa_file_access_info-file_size.
    Convert the 1022 binary data to xstring
                CLEAR a_xstring.
                CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
                  EXPORTING
                    input_length = file_size
                  IMPORTING
                    buffer       = a_xstring
                  TABLES
                    binary_tab   = it_sdokcntbin
                  EXCEPTIONS
                    failed       = 1
                    OTHERS       = 2.
                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: w_output_length TYPE i.
    Convert Xstring to 255 RAW
                CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
                  EXPORTING
                    buffer        = a_xstring
                  IMPORTING
                    output_length = w_output_length
                  TABLES
                    binary_tab    = lt_content_bin.
                len = w_output_length.
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_content_bin
           type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for Excel Document
              ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
                l_doc_type = 'XLS'.
                CLEAR: a_xstring,len.
                LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
                  CONCATENATE a_xstring wa_sdokcntbin-line
                         INTO a_xstring IN BYTE MODE.
                ENDLOOP.
                len = XSTRLEN( a_xstring ).
        transform to solix tab - adding additional attachments
                REFRESH lt_solix.
                lt_solix =
                  cl_document_bcs=>xstring_to_solix(
                    ip_xstring = a_xstring ).
                CLEAR l_filename.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                bcs_doc1 =  cl_document_bcs=>create_document(
                                                i_type     = l_doc_type
                                                i_subject  = l_filename
                                                i_length   = len
                                                i_language = sy-langu
                                                i_hex     = lt_solix
    *Type casting
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
    for text doxument
              ELSEIF wa_file_access_info-mimetype = 'plain/text'.
                l_doc_type = 'TXT'.
                file_size = wa_file_access_info-file_size.
            Get the file name
                l_filename = wa_file_access_info-file_name.
                CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
                  EXPORTING
                    input_length = file_size
                  TABLES
                    binary_tab   = it_sdokcntbin
                    text_tab     = file_data
                  EXCEPTIONS
                    failed       = 1
                    OTHERS       = 2.
                IF sy-subrc <> 0.
                  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
                ENDIF.
                CALL METHOD cl_document_bcs=>create_document
                  EXPORTING
                    i_type    = l_doc_type
                    i_subject = l_filename
                    i_text    = file_data
                  RECEIVING
                    result    = bcs_doc1.
                obj_file ?= bcs_doc1.
    Add Attachment as a document to the email object
                CALL METHOD l_email_object->add_document_as_attachment
                  EXPORTING
                    im_document = obj_file.
              ENDIF.
              CLEAR:it_file_access_info,it_sdokcntbin.
              CLEAR:wa_object_id,wa_file_access_info,file_size.
            ENDLOOP.
            CALL METHOD send_request->set_document( l_email_object ).
    *Get the address number for the vendor
            SELECT SINGLE adrnr
                          FROM lfa1
                          INTO l_adrnr
                          WHERE lifnr = l_doc-xekko-lifnr.
            MOVE l_adrnr TO l_addrno.
    Get the Email Address for the vendor using address number
            CALL FUNCTION 'ADDR_GET_REMOTE'
              EXPORTING
                addrnumber        = l_addrno
              TABLES
                adsmtp            = it_adsmtp
              EXCEPTIONS
                parameter_error   = 1
                address_not_exist = 2
                internal_error    = 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.
            sender = cl_sapuser_bcs=>create( sy-uname ).
            CALL METHOD send_request->set_sender
              EXPORTING
                i_sender = sender.
            READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
            IF sy-subrc = 0.
              LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
                CALL METHOD cl_cam_address_bcs=>create_internet_address
                  EXPORTING
                    i_address_string = wa_adsmtp-smtp_addr
                  RECEIVING
                    result           = recipient.
                CALL METHOD send_request->add_recipient
                  EXPORTING
                    i_recipient = recipient
                    i_express   = 'X'.
              ENDLOOP.
            ELSE.
              READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
              IF sy-subrc = 0.
                CALL METHOD cl_cam_address_bcs=>create_internet_address
                  EXPORTING
                    i_address_string = wa_adsmtp-smtp_addr
                  RECEIVING
                    result           = recipient.
                CALL METHOD send_request->add_recipient
                  EXPORTING
                    i_recipient = recipient
                    i_express   = 'X'.
              ENDIF.
            ENDIF.
            CALL METHOD send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
              RECEIVING
                result              = l_sent_to_all ).
          CATCH cx_bcs INTO bcs_exception.
            WRITE: 'Fehler aufgetreten.'(001).
            WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
            EXIT.
        ENDTRY.
      ENDIF.

  • Problem in sending the Smartform Output as PDF through Mail

    Dear All,
    I am sending the Smartform Output as an attachment by converting it into PDF. But when I am recieve this attachment I am unable to open the PDF file, it is giving error that FILE IS DAMAGED. Below is the code:
    REPORT  Y_SEND_MAIL2.
    TABLES: vbrk, vbrp.
    TYPE-POOLS: abap.
    DATA: it_vbrk TYPE TABLE OF vbrk WITH HEADER LINE.
    DATA: i_formname      TYPE       tdsfname,
          i_fm_name       TYPE       rs38l_fnam,
          it_vbak TYPE TABLE OF vbak WITH HEADER LINE,
          it_ekko TYPE TABLE OF ekko WITH HEADER LINE.
    DATA:  is_bil_invoice TYPE lbbil_invoice,
           output_options      TYPE ssfcompop,
           control_parameters  TYPE ssfctrlop,
           e_devtype           TYPE rspoptype,
           job_output_info     TYPE ssfcrescl,
           bin_file            TYPE xstring,
           lines               TYPE TABLE OF tline WITH HEADER LINE,
           doctab_archive      TYPE TABLE OF docs WITH HEADER LINE,
           filelength          TYPE i,
           bin_filesize        TYPE i,
           docs          TYPE TABLE OF docs WITH HEADER LINE.
    *"Types
    TYPES: t_document_data TYPE sodocchgi1,
           t_packing_list TYPE sopcklsti1,
           t_attachment TYPE solisti1,
           t_body_msg TYPE solisti1,
           t_receivers TYPE somlreci1,
           t_pdf TYPE tline.
    *"Workareas
    DATA :w_document_data TYPE t_document_data,
          w_packing_list TYPE t_packing_list,
          w_attachment TYPE t_attachment,
          w_body_msg TYPE t_body_msg,
          w_receivers TYPE t_receivers,
          w_pdf TYPE t_pdf.
    *internal tables
    DATA : i_document_data TYPE STANDARD TABLE OF t_document_data,
           i_packing_list TYPE STANDARD TABLE OF t_packing_list,
           i_attachment TYPE STANDARD TABLE OF t_attachment,
           i_body_msg TYPE STANDARD TABLE OF t_body_msg,
           i_receivers TYPE STANDARD TABLE OF t_receivers,
           i_pdf TYPE STANDARD TABLE OF t_pdf.
    DATA: BEGIN OF line_bin,
             data(1024) TYPE x,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    So please suggest a solution.
    Regards,
    Vishal

    Continued:
    SELECT-OPTIONS: s_vbeln FOR vbrk-vbeln,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY DEFAULT sy-datum.
    SELECT * FROM vbrk
    INTO TABLE it_vbrk
    WHERE fkdat IN s_fkdat
          AND vbeln IN s_vbeln.
    i_formname = 'Z_SD_JINDAL_INVOICE10'.
    output_options-tddest        = 'LP02'.
    output_options-tdimmed       = 'X'.
    output_options-tdnewid       = 'X'.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = i_formname
      IMPORTING
        fm_name            = i_fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.          "checking subrc
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.                     "IF sy-subrc <> 0
    READ TABLE it_vbrk INDEX 1.
    IF sy-subrc = 0.
      is_bil_invoice-hd_gen-bil_number = it_vbrk-vbeln.
    ENDIF.
    control_parameters-no_dialog = 'X'.
    control_parameters-getotf = 'X'.
    CALL FUNCTION i_fm_name        "'/1BCDWB/SF00000097'
      EXPORTING
       control_parameters         = control_parameters
       output_options             = output_options
       user_settings              = space
       is_bil_invoice             = is_bil_invoice
    IMPORTING
       job_output_info            = job_output_info
    TABLES
       it_vbak                    = it_vbak
    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.
    *FORM convert_otf_2_pdf.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
    *      EXPORTING
    *        USE_OTF_MC_CMD               = 'X'
    *        ARCHIVE_INDEX                =
        IMPORTING
          bin_filesize                 = bin_filesize
        TABLES
          otf                          = job_output_info-otfdata[]
          doctab_archive               = docs[]
          lines                        = lines[]
        EXCEPTIONS
          err_conv_not_possible        = 1
          err_otf_mc_noendmarker       = 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.
    *ENDFORM.                    "convert_otf_2_pdf

  • Hi how to send the smartform threw email

    Hi all,
    I have a smartform which I have to send threw email i want some of the data i.e there in smart form is to be printed on to the mail body. is it possible.
    Thanks & Regards,
    sam.

    Hi Sam,
    Check this program.
    REPORT Ztest_SEND_SMARTFORMS .
    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 = 'ZZZ_TEST1'
    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.
    Fehlerhandling
    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
    wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
    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.
    Länge des Attachment ermitteln
    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 = '[email protected]'.
    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'
    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.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Configuration to send the smartform through fax

    Hi,
    I have used CONVERT_OTF_AND_FAX and SO_OBJECT_SEND FM's to send the smartform through fax.After executing SO_OBJECT_SEND function module,I am getting sy-subrc alue as 9(OBJECT_NOT_SEND).I am able to send the document through fax.But when I click on display in SOST transaction it is just printing the output of the smartform.It is not coming in PDF format.
    The code looks fine.I think there is some problem with confuration settings.Is there any configuration to be done to send the smartform  output through fax?
    Please reply.
    Regards,
    Hema

    Hi,
    Actually,my requirement is to send the smartform output through email with medium 'external send'.I have done some coding for that.it is working fine and I am able to send the smartform through email and open the attachment in PDF format.
    But if the email id of the recipient is not present then the smartform output has to be sent through fax with the same medium 'external send'.
    So I have done some coding to send the smartform through fax when the email id is not present.
    I am able to send the output of smartform through fax.But when I clicked on display in SOST transaction,it is not coming in PDF format.It is coming in RAW format.
    Is it possible to send the smartform output through fax with medium 'external send'?
    Regards,
    Hema

  • Images for other languages

    Hi,
    are the gif's available for other languages? I mean I have now english installed and this will give for the GO button a image on the button named go.gif. Is the go.gif also available in other languages or should I change the gif file myself?
    Thanks
    Herald ten Dam

    There are a number of so-called translation memory tools that can translate MIF files. There's a Wikipedia article on translation memory tools: http://en.wikipedia.org/wiki/Translation_memory
    We use Star Transit, but SDL Trados can do the job as well and there are a number of other tools. These tools separate text from formatted. Then the text is segemented. This allows you to reuse previous translations when the source documents is modified. Only new and modified segements will have to be translated then. These tools are very useful, but most of them are very expensive. A pretty new tool which is more affordable is memoQ (which I have never used myself). It is available from http://en.kilgray.com/.
    As for screenshots, I think the most important thing is to make sure that they are imported by reference.
    HTH
    Susanne

  • Logo Problem While sending the smart form as an attachment via Email

    Hi ,
    I am using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the smartforma as an attachement into the mailbox . it is sent correctly but the COLOR LOGO are not coming correctlly .
    I checked the OTF to PDF file is getting converted correctly .i.e. if i am downloading the foem then it is displaying correctly , but in case of sending it to mailbox as an attached PDF file ,the logo are not comming correctly ,
    If anybody faced such type of problem can u please clarify .
    I am thinking the problem is in FM  SO_NEW_DOCUMENT_ATT_SEND_API1 . this FM is not sending the Attached PDF file correctly .
    All the TExt/variables are displaying  correctly in the PDF file except the LOGO.while opening the PDF file one Warnng message is getting displayed : "An error occured while opening the Image" .
    PLease help ..
    Thanks,
    sachi

    Hi,
    Edit your  logo as 256 color bit map image and save it  and upload  into SE78,
    And also better to use this FM :SO_DOCUMENT_SEND_API1  it is good for new versions.
    thanks,
    venkat.
    Edited by: Satya venkat Rao.R on Dec 13, 2011 6:02 AM

  • Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email.  t worked, but only for those with PC.  I could not get it to work with Apple Yosemite even with reader installed .  is there a way i can make it work for apple /

    Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email. It worked, but only for those with PC. However,  I could not get it to work with Apple loaded with Yosemite even with reader installed .  Is there a way i can make it work for apple / Mac? It worked fine on a mac using Mountain Lion and reader
    Thanks

    LiveCycle = XFA forms.
    afaik - These cannot be used in Apple OSs.
    Be well...

  • Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email.  the button did not work and i looked online and saw where you could change it to a regular button and enter the email for it to go.  it worked, but only for thos

    Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email.  the button did not work and i looked online and saw where you could change it to a regular button and enter the email for it to go.  it worked, but only for those with adobe pro.  i could not get it to work with reader.  is there a way i can make it work for reader?

    Noted.
    The LiveCycle user to user forum is across town at:
    Adobe LiveCycle 
    Be well...

  • I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because wh

    I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because when I'm not at home I can't plug in the power.

    hi,
    I am sending file from server to client i.e client will request for a file and service will send it back....... no socket connection is there...I am using JBOSS and apache axis.
    pls help me out.....
    Rashi

  • Display and Send the Smartforms

    Hi,
    I send the smartfoms with pdf attachment.
    But My client requirement is send and display the smartform.
    can you please help me.
    Thanks & Regards,
    venkatesh

    After sending the Smartform, you could call the assigned FM again to display the form in print preview mode... something like this:
    wa_control_parameters-no_dialog = 'X'.
    wa_control_parameters-preview = 'X'.
    wa_output_options-tddest = 'LOCL'.
    CALL FUNCTION fmname
      EXPORTING
        control_parameters = wa_control_parameters
        output_options     = wa_output_options
      IMPORTING
        job_output_info    = wa_job_output_info
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.
    There was a similar thread a few days ago, where the requirement was to download the form in PDF and display it: "OTF end command // missing in OTF data" while converting smartform to pdf
    There is a working test program in that thread, you could replace the downloading part with the email logic that you already wrote. Then call the FM again at the end for the form display.

  • Data from check boxes fails to be collected, when sending the PDF as email

    Hi
    I am working on an interactive PDF that should act as an ordersheet for clients to fill out. I am using Acrobat Pro 9, and everything works as intended, but when the client tries to send the order by email (By pressing a button that uses "submit a form" as actio, where it sends the whole PDF to a single email), the pdf pops up in the email client, and everything looks fine, except all of the checkboxes. None of them have been checked, even though the client have done so. I have searched the forums without luck, so now i am trying in here.
    I have made sure that the client is using the version, that has the extended reader rights.
    If you feel need additional information regarding the PDF, just ask.
    Thank you very much for your time.

    Edit>Preferences>Email accounts>List of email accounts. Click the drop-down that says "add account" and select Gmail. After adding it, you can go to the account area and change it to default.

  • Not able to see the output in sost when sending the image in email body

    I am sending the image in email body and when m trying to see the output in SOST then it showing a page 'you are not connected to the internet'
    I am able to see the output when m saving local objects but when m saving it in some package its showing me this page
    Kindly help it
    Regards
    Pratham Kapoor

    Hello Prakash,
    Thanks for the reply
    I am able to see the mail in SOST but when I click on the Display Document to see the content of the mail then I am getting this error of 'you are not connected to the internet'
    My Program is to put the logo in my email body
    I am sending you the attached image

  • I updated Firefox and now, when I select File, Send Link, a dialog box pops up asking me to establish a new account before I can send the link via email.

    I updated Firefox and now, when I select File, Send Link, a dialog box pops up asking me to establish a new account before I can send the link via email. I use Outlook, so how do I avoid setting up some new account and yet am able to send the link via Outlook?
    I have a feeling it may have something to do with HotMail.com.

    My Error: I found out that it was Mozilla Thunderbird that was causing the problem. I uninstalled it and the problem went away.

  • Exchange 2010 : Delivery Restrictions. Send the delivery failure email to a list.

    Hello,
    As the title says, I would like to know if it's possible to send the delivery failure email to a specific list.
    I have correctly configured the mailbox so it's working like a whitelist, if you dont have the right to send email to it then you will recieve a delivery failure from Exchange. That is perfectly working.
    But, my question is, for that specific mailbox, I'd like to know if we can send also the delivery failure to a specific list, in order to let the admins to know that someone tried to send an email to that mailbox.
    Regards,

    Hi,
    According to your description, you want the specific mailbox send NDR to a group(list). If I misunderstand your meaning, please feel free to let me know.
    If yes, I’m afraid that it’s an unsupported behavior:
    http://support.microsoft.com/kb/817220
    However, admin can depend audit log to detect the mailbox activities.
    http://technet.microsoft.com/en-us/library/ff459237(v=exchg.141).aspx
    If you have any question, please feel free to let me know.
    Thanks,
    Angela Shi
    TechNet Community Support

Maybe you are looking for

  • How do I add a 'folder' on my iPhone through iOS8?

    I Want to Be able to sort my emails on my iPhone. But I can't seem to create a 'folder' as such. I am using a Bigpond email account. What can/should I do? Can it be done?

  • Entire music and photo libraries not showing up

    I can't access my entire iPhoto and iTunes libraries on my Apple TV. I have both programs open, ATV sees the libraries, but picks a small, seemingly random, sample from each instead of allowing me to access all my photos and music. The separate "Scre

  • Need help on xml parsing... no body replied at xml forum...plz help

    it 's 10g set serveroutput on set line 2000 drop table emp; CREATE TABLE EMP (   EMPNO     NUMBER(10),   ENAME     VARCHAR2(10),   JOB       VARCHAR2(9),   MGR       NUMBER(4),   HIREDATE  DATE,   SAL       NUMBER(7, 2),   COMM      NUMBER(7, 2),   D

  • Table names in generated stored procs are qualified with sa schema name

    I am using OMW 9.2.0.1.2 with the 9.2.0.1.3 SQL Serevr plugin to help with a SQL Server 7 to Oracle 9.2.0.1 migration on NT. As is common with SQL Server databases, the dbo is sa. I don't want my Oracle schema to be called sa. I have succesfully gott

  • My Compressor Export file not liked by a program

    Hi, So my Quicktime Movie export files from Motion are not being allow to be imported into a audio program i use (Ableton Live)....I've tried H264 and PJEG both at 640x480 and 29.97 I've checked had no problems importing movies that had the same sett