Q about:Sending Smartform's O/P as an attchment of an e-mail

Hi friends...
I have dveloped a new Smartform for PO reminder letter..
and I am trying to send it as an attachment thru mail...
the code I wrote for that is given...
but I am getting a runtime error like
In program "CL_TRACE_BCS==================CP ", the following syntax error
occurred
in the Include "CL_TRACE_BCS==================CU " in line 85:
"Implementation missing for method "END_FUNC". "END_FUNC"."
Plz help me....
*******CODE********
REPORT zmm_vendor_reminder_mail.
TABLES : ekko,ekpo,eket,makt,adrc,adr6,lfa1.
DATA: fm_name TYPE rs38l_fnam.
DATA: BEGIN OF itab1 OCCURS 0.
INCLUDE STRUCTURE lfa1.
DATA: END OF itab1.
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE zmm_podetails.
DATA: END OF itab.
DATA : BEGIN OF it_pos OCCURS 0 ,
bukrs LIKE ekpo-bukrs,
werks LIKE ekpo-werks,
ebeln LIKE eket-ebeln,
ebelp LIKE eket-ebelp,
etenr LIKE eket-etenr,
bedat LIKE eket-bedat,
matnr LIKE ekpo-matnr,
meins LIKE ekpo-meins,
menge LIKE eket-menge,
wemng LIKE eket-wemng,
eindt LIKE eket-eindt,
lifnr LIKE ekko-lifnr,
END OF it_pos.
DATA : BEGIN OF it_vendor OCCURS 0 ,
lifnr LIKE lfa1-lifnr,
name1 LIKE adrc-name1,
street LIKE adrc-street,
str_suppl1 LIKE adrc-str_suppl1,
str_suppl2 LIKE adrc-str_suppl2,
city1 LIKE adrc-city1,
post_code1 LIKE adrc-post_code1,
smtp_addr LIKE adr6-smtp_addr,
adrnr LIKE lfa1-adrnr,
telf1 LIKE lfa1-telf1,
telf2 LIKE lfa1-telf2,
END OF it_vendor.
*RAMESH **********
tables: soud.
data: control_parameters TYPE ssfctrlop,
output_options TYPE ssfcompop,
EMail_Subject(50) TYPE c value 'abc'.
DATA: email_recipient TYPE SWOTOBJID,
email_sender TYPE SWOTOBJID,
g_mail_app_obj type SWOTOBJID.
*concatenate text-004 '400000124' into EMail_Subject.
control_parameters-device = 'MAIL'.
control_parameters-no_dialog = 'X'.
control_parameters-preview = space.
output_options-tdnewid = 'X'.
output_options-tdtitle = EMail_Subject.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_bukrs FOR ekpo-bukrs,
s_werks FOR ekpo-werks,
s_ekgrp FOR ekko-ekgrp,
s_lifnr FOR ekko-lifnr,
s_ebeln FOR ekko-ebeln,
s_eindt FOR eket-eindt,
s_mtart FOR ekpo-mtart,
s_matkl FOR ekpo-matkl,
s_matnr FOR ekpo-matnr.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM mail_recipient_object.
PERFORM mail_sender_object.
PERFORM mail_appl_object changing g_mail_app_obj.
*RAMESH **********
*******************************SELECTION-SCREEN************
AT SELECTION-SCREEN.
Validate test for Plant in selections
LOOP AT s_werks.
IF NOT s_werks-high IS INITIAL.
SELECT SINGLE * FROM ekpo
WHERE werks = s_werks-high.
IF sy-subrc NE 0.
MESSAGE e600(fr) WITH 'This Plant'
s_werks-high ' does not exist.'
ENDIF.
ENDIF.
IF NOT s_werks-low IS INITIAL.
SELECT SINGLE * FROM ekpo
WHERE werks = s_werks-low.
IF sy-subrc NE 0.
MESSAGE e600(fr) WITH 'This Plant'
s_werks-low ' does not exist.'
ENDIF.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
PERFORM get_data.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMM_VENDOR_REMINDER_MAIL'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: / 'ERROR 1'.
ENDIF.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = control_parameters
MAIL_APPL_OBJ = g_mail_app_obj
MAIL_RECIPIENT = email_recipient
MAIL_SENDER = email_sender
OUTPUT_OPTIONS = output_options
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
itab1 = itab1
itab = itab
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 get_data
text
FORM get_data.
SELECT a~bukrs a~werks a~ebeln a~ebelp
b~bedat a~matnr a~meins b~menge
b~wemng b~eindt c~lifnr b~etenr
FROM ekpo AS a
INNER JOIN eket AS b
ON a~ebeln = b~ebeln AND
a~ebelp = b~ebelp
INNER JOIN ekko AS c
ON a~ebeln = c~ebeln AND
a~bukrs = c~bukrs
INTO CORRESPONDING FIELDS OF TABLE it_pos
WHERE a~bukrs IN s_bukrs
AND a~werks IN s_werks
AND b~eindt IN s_eindt
AND c~lifnr IN s_lifnr
AND c~ekgrp IN s_ekgrp
AND c~ebeln IN s_ebeln
AND a~mtart IN s_mtart
AND a~matkl IN s_matkl
AND a~matnr IN s_matnr
AND c~bstyp EQ 'F'
AND c~loekz EQ space
AND a~loekz EQ space
AND b~menge > b~wemng.
SELECT DISTINCT a~lifnr b~name1 b~street b~str_suppl1 b~str_suppl2
b~city1 b~post_code1 a~adrnr a~telf1 a~telf2
FROM lfa1 AS a
INNER JOIN adrc AS b
ON a~adrnr = b~addrnumber
INTO CORRESPONDING FIELDS OF TABLE it_vendor
FOR ALL ENTRIES IN it_pos
WHERE a~lifnr = it_pos-lifnr.
LOOP AT it_vendor.
SELECT SINGLE * FROM adr6
WHERE addrnumber = it_vendor-adrnr
AND persnumber EQ space.
IF sy-subrc = 0.
it_vendor-smtp_addr = adr6-smtp_addr.
ENDIF.
MODIFY it_vendor.
SELECT SINGLE * FROM lfa1
WHERE lifnr = it_vendor-lifnr.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING lfa1 TO itab1.
APPEND itab1.
ENDIF.
ENDLOOP.
LOOP AT it_pos.
itab-bukrs = it_pos-bukrs.
itab-ebeln = it_pos-ebeln.
itab-ebelp = it_pos-ebelp.
itab-matnr = it_pos-matnr.
itab-bedat = it_pos-bedat.
itab-meins = it_pos-meins.
itab-eindt = it_pos-eindt.
itab-lifnr = it_pos-lifnr.
itab-etenr = it_pos-etenr.
APPEND itab.
CLEAR itab.
ENDLOOP.
ENDFORM. "get_data
*& Form mail_recipient_object
text
--> p1 text
<-- p2 text
form mail_recipient_object .
data: email_address TYPE SO_NAME.
email_address = '[email protected]'.
CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
EXPORTING
IP_COUNTRY =
IP_FAXNO =
IP_MAILADDR = email_address
IP_TYPE_ID = 'U'
IMPORTING
EP_RECIPIENT_ID = email_recipient
EP_ADDRESS =
ET_RECIPIENT =
EXCEPTIONS
INVALID_RECIPIENT = 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.
endform. " mail_recipient_object
*& Form mail_sender_object
text
--> p1 text
<-- p2 text
form mail_sender_object .
CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
EXPORTING
IP_SENDER = sy-uname
IMPORTING
EP_SENDER_ID = email_sender
EXCEPTIONS
INVALID_SENDER = 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.
endform. " mail_sender_object
*& Form mail_appl_object
text
<--P_G_MAIL_APP_OBJ text
form mail_appl_object changing p_g_mail_app_obj.
include <cntn01>.
DATA: FOLDER TYPE swc_object,
BEGIN OF SOFMFOL_KEY,
FOLDERTYPE LIKE SOFM-FOLTP,
FOLDERYEAR LIKE SOFM-FOLYR,
FOLDERNUMBER LIKE SOFM-FOLNO,
TYPE LIKE SOFM-DOCTP,
YEAR LIKE SOFM-DOCYR,
NUMBER LIKE SOFM-DOCNO,
FORWARDER LIKE SOUB-USRNAM,
END OF SOFMFOL_KEY,
BOR_KEY LIKE SWOTOBJID-OBJKEY.
SELECT single * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.
IF sy-subrc NE 0.
CALL FUNCTION 'SO_USER_AUTOMATIC_INSERT'
EXPORTING
SAPNAME = SY-UNAME
SO_KEY = ' '
SEND_MAIL_IF_NO_ADDRESS = 'X'
IMPORTING
USRADR =
EXCEPTIONS
NO_INSERT = 1
SAP_NAME_EXIST = 2
X_ERROR = 3
SAP_NAME_NOT_EXIST = 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.
clear sofmfol_key.
sofmfol_key-type = 'FOL'.
sofmfol_key-year = soud-inbyr.
sofmfol_key-number = soud-inbno.
bor_key = sofmfol_key.
IF not bor_key is initial.
swc_create_object folder 'SOFMFOL' bor_key.
IF sy-subrc = 0.
swc_object_to_persistent folder g_mail_app_obj.
IF sy-subrc ne 0.
clear g_mail_app_obj.
ENDIF.
ENDIF.
ELSE.
clear g_mail_app_obj.
ENDIF.
endform. " mail_appl_object

try to release the mail manually from the sost.
to see whether the mail is workin fine or not go sbwp(*sap business work place) transeaction and see it.
once see the scot also.
in general the administrator should allow the mail to trnsmit .only this case it fails.
i am sure this works.

Similar Messages

  • Change e-mail sender smartforms

    Hi Experts,
    When I send a billing document from VF03 to a customer, the e-mail address is read from my sap user (SU01). I would like an e-mail address for each billing type, but I don't now how to change "mail_sender" parameters in the smartforms (RLB_INVOICE program).
    Can you help me, please?
    Thanks.
    Luca

    No, it certainly is an ABAP-related issue.  Developers are the only ones smart enough to figure this stuff out ;-).  The note says nothing about sender configuration for medium '5'.  The sender is hard-coded as SY-UNAME during the communication strategy analysis (since the call to CONVERT_COMM_TYPE_DATA does not specify a sender).
    This is a common issue - most companies normally use a single sender for all invoices (or invoices per company code) and identify the correct sender details on the job user ID.  If this isn't good enough, then you have two choices: use a custom program to generate the email yourself after rendering the form (a copy of RLB_INVOICE) and specify the sender OR enhance the existing function to return a different sender based on your criteria.  Personally, I'd go with the custom approach.

  • Send smartform as pdf attachment through Email on ECC 5.0

    I have been trying hard to do this, but am not able to send attachment. Below are the problems -
    1. If sometimes the mail goes, the attachment is empty.
    2. if i use COMMIT_WORK = 'X' in FM SO_NEW_DOCUMENT_ATT_SEND_API1 , it throws a dump - ' Invalid COMMIT WORK in an update function module.'
    3. If i comment COMMIT_WORK = 'X', it gets executed successfully but, in the program i get a dump 'UC_OBJECTS_NOT_CHAR' exception.
    Can someone suggest, what settings are required in SAP to send smartforms as PDF attachments. Also, please suggest how can i remove the dump. If anyone can give me a working program, it will be very very helpful.
    here is the code,
    REPORT  zrsmfmail.
    TYPE-POOLS: addi.
    Tables defination.
    TABLES : vbpa,vbak,nast, stxl, stxh.
    Data Decleration .
    DATA: lf_fm_name  TYPE rs38l_fnam,
          l_lines TYPE i.
    DATA: output_options TYPE ssfcompop.
    DATA: fcodem TYPE sy-ucomm.
    DATA: i_id LIKE thead-tdid VALUE 'V002',
          i_object LIKE thead-tdobject VALUE 'VBBK' ,
          i_tdname LIKE thead-tdname ,
          i_lang LIKE thead-tdspras VALUE 'E' .
    Internal Table declration.
    DATA: int_vbak LIKE vbak OCCURS 0 WITH HEADER LINE,
          int_vbap LIKE vbap OCCURS 0 WITH HEADER LINE.
    DATA : itline1 LIKE tline OCCURS 0 WITH HEADER LINE .
    DATA: retcode   LIKE sy-subrc.         "Returncode
    DATA: repeat(1) TYPE c.
    DATA: xscreen(1) TYPE c.               "Output on printer or screen
    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,
    lt_att_content_hex 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,
    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.
    DATA: BEGIN OF zlines2 OCCURS 0,
    tline TYPE char255,
    END OF zlines2,
    size TYPE i,
    zdata TYPE sodocchgi1.
    *&      Form  entry
    FORM entry USING return_code TYPE i
                     us_screen TYPE c.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing.
      IF retcode NE 0.
        return_code = 1.
      ELSE.
        return_code = 0.
      ENDIF.
    ENDFORM.                    "ENTRY
    *&      Form  PROCESSING
          text
    FORM processing.
      SELECT *
      INTO   CORRESPONDING FIELDS OF TABLE int_vbak
      FROM   vbak
      WHERE  vbeln = nast-objky.
      LOOP AT int_vbak .
        i_tdname = int_vbak-vbeln .
        SELECT SINGLE * FROM stxh WHERE tdobject = i_object
                                    AND tdname = i_tdname
                                    AND tdid = i_id
                                    AND tdspras = i_lang.
        IF sy-subrc = 0 .
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id       = i_id
              language = i_lang
              name     = i_tdname
              object   = i_object
            TABLES
              lines    = itline1.
          IF sy-subrc NE 0 .
            APPEND itline1 .
          ENDIF .
        ENDIF .
        DESCRIBE TABLE int_vbak LINES l_lines.
        l_lines = l_lines .
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = 'ZORDER_QUOTE'
          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
            l_lines            = l_lines
            control_parameters = w_ctrlop
            output_options     = w_compop
            user_settings      = 'X'
          IMPORTING
            job_output_info    = w_return
          TABLES
            int_vbak           = int_vbak
            int_vbap           = int_vbap
            itline1            = itline1
          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          = size
          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.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Change the PDF format from 132 to 255.
        CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
          EXPORTING
            transfer_bin = 'X'
          TABLES
            content_in   = i_tline
            content_out  = zlines2
          EXCEPTIONS
            err_line_width_src_too_long = 1
            err_line_width_dst_too_long = 2
            err_conv_failed = 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.
    Attachment
        REFRESH:
        i_reclist,
        i_objtxt,
        i_objbin,
        i_objpack.
        CLEAR wa_objhead.
        i_objtxt = 'TEST 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-no_change = 'X'.
        wa_doc_chng-obj_langu = sy-langu.
        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.
    (pdf-Attachment)
        i_objbin[] = zlines2[].
        i_objpack-transf_bin = 'X'.
        i_objpack-head_start = 1.
        i_objpack-head_num = 1.
        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 = 'SMARTFORM'.
        i_objpack-obj_descr = 'TEST'.
        APPEND i_objpack.
        CLEAR i_reclist.
        i_reclist-receiver = 'abc at aa.com'.
        i_reclist-rec_type = 'F'.
        i_reclist-express = 'X'.
        APPEND i_reclist.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA = WA_DOC_CHNG
          PUT_IN_OUTBOX = 'X'
         commit_work = 'X'
        TABLES
          PACKING_LIST = I_OBJPACK
          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.
        CASE sy-subrc.
          WHEN 0.
          WHEN 1. RAISE too_many_receivers.
          WHEN 2. RAISE document_not_sent .
          WHEN 3. RAISE document_type_not_exist.
          WHEN 4. RAISE operation_no_authorization.
          WHEN 5. RAISE parameter_error.
          WHEN 7. RAISE enqueue_error .
          WHEN OTHERS. RAISE x_error.
        ENDCASE.
    COMMIT WORK.
      ENDLOOP.
    ENDFORM.                    "entry
    Please suggest ASAP, it has come to a critical stage now, a fruitful help will be a great saviour.
    Thanks !

    Hi Guys,
    You can even try this 'CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
          IMPORTING
            bin_filesize          = bin_filesize
            bin_file              = xstring
          TABLES
            otf                   = it_otf_final
            lines                 = it_pdfdata[]
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            err_bad_otf           = 4
            OTHERS                = 5.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            buffer                = xstring
          APPEND_TO_TABLE       = ' '
        IMPORTING
          OUTPUT_LENGTH         =
          TABLES
            binary_tab            = it_pdf
    Use Cl_BSC Class for easy way to send mail.
    Either u can Distribution list Tcode so23.
    This is the way i have implemted .. !

  • How to send smartform output in body of email?

    Hi all ,
    I have to send smartform output in body of email (not as an attachement in mail) .PLease help me in this regard.
    Thanks,
    Ananth S.

    Hi Ananth
    See these threads.
    [https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6889194]
    [https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6861330]
    [https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6855364]
    Regards
    Hareesh Menon

  • To send smartform output in an email without attachment

    Hi All,
      How to send smartform output in an email without attachment?
    Thanks & Regards,
    Mamta Gupta.

    Try this,
    DATA:
    ls_control_param TYPE ssfctrlop, "Control paramters
    ls_output_options TYPE ssfcompop. "Output options
    DATA:
    lv_ip_mailaddr TYPE so_name, "Address of a Mail Recipient
    lv_ip_type_id TYPE so_escape, "Recipient type
    ls_recipient_id TYPE swotobjid, "Structure for recvr obj ID
    ls_sender_id TYPE swotobjid. "Structure for sender obj id
    CONSTANTS:
    lc_ip_type_id TYPE so_escape VALUE 'U', "For internet address.
    lc_smartform TYPE tdsfname VALUE 'ZVSF_ASN_DELNOTE', "Smart form name
    lc_mail TYPE tddevice VALUE 'MAIL'. "Mail device
    Assign recipient
    lv_ip_mailaddr = gv_smtp_addr. "CSAM email id
    lv_ip_type_id = lc_ip_type_id. "External address
    Create Mail title
    CONCATENATE text-001
    nast-objky
    INTO ls_output_options-tdtitle.
    Create recipient object
    CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
    EXPORTING
    ip_mailaddr = lv_ip_mailaddr
    ip_type_id = lv_ip_type_id
    IMPORTING
    ep_recipient_id = ls_recipient_id
    EXCEPTIONS
    invalid_recipient = 1
    OTHERS = 2.
    IF sy-subrc 0.
    cf_retcode = sy-subrc.
    PERFORM protocol_update.
    ENDIF.
    Get sender object id.
    CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
    EXPORTING
    ip_sender = sy-uname
    IMPORTING
    ep_sender_id = ls_sender_id
    EXCEPTIONS
    invalid_sender = 1
    OTHERS = 2.
    IF sy-subrc 0.
    cf_retcode = sy-subrc.
    PERFORM protocol_update.
    ENDIF.
    Assign the smart form name
    w_ssfname = lc_smartform.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_ssfname
    IMPORTING
    fm_name = lf_fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc 0.
    cf_retcode = sy-subrc.
    PERFORM protocol_update.
    ENDIF.
    For Print output:
    IF nast-nacha = '1'. "Print output
    ls_control_param-preview = 'X'.
    ls_control_param-no_dialog = 'X'.
    ENDIF.
    For Email output.
    IF nast-nacha = '2'. "Email
    Output options
    ls_output_options-tdteleland = gs_kna1-land1.
    ls_output_options-tdtelenum = gs_kna1-telfx.
    ls_output_options-tdfaxuser = sy-uname.
    ls_output_options-BCS_COMMIT = 'X'.
    ls_control_param-device = lc_mail.
    ENDIF.
    dynamically call Fm behind the Smart form
    CALL FUNCTION lf_fm_name
    EXPORTING
    control_parameters = ls_control_param
    mail_recipient = ls_recipient_id
    mail_sender = ls_sender_id
    output_options = ls_output_options
    user_settings = ' '
    TABLES
    delivery = gt_delivery
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    IF sy-subrc 0.
    cf_retcode = sy-subrc.
    PERFORM protocol_update.
    ENDIF.
    Regards,
    Joan

  • Sending smartform as email

    Hi All
    I have a requirement like we are sending a smart form as a body of email . For this we copied a class CL_DOC_PROCESSING_CRM_ORDER into YCL_DOC_PROCESSING_CRM_ORDER and in that there is one method ie CRM_ORDER_EXEC_SMART_FORM , In this method we are calling smart form to trigger this as an automatic mail.
    we are passing subject line to field  SSFCOMPOP-TDTITLE . But this field length is currently 50 chars.
    We need to extend this field length to 150 chars.
    So could you please guid  me the solution if any one faces this type of issue in their career or can you please advice me is there any alternate solution for this.
    Regards,
    CHANDU

    HI CHANDUPANDAVULA,
    You can send smartform directly right . Is there any issue in that.
    Regards,
    Madhu.
    Edited by: madhurao123 on Feb 22, 2011 4:29 PM

  • How to send SMARTFORMS output as attachment through?

    how to send SMARTFORMS output as attachment through e-mail?
    after executing SMARTFORMS how to send that output via e-mail.
    Help me.
    thanks
    surya.
    Moderator Message: Please search for available information first
    Edited by: kishan P on Nov 7, 2010 7:19 PM

    hi Vinod,
    Can you please tell me how you have zipped the file.
    I am having a text file in application server. I need to zip that file. Then the middleware moves it to Legacy system.
    I used the following code. With this I am having the data in Binary format which my midleware cannot understand.
    What I need on the whole is just to reduce the size of the file.
    form ZIP_FILE .
    DATA: lt_data TYPE TABLE OF x255,
          lt_textdata TYPE TABLE OF x255.
    DATA: ls_data LIKE LINE OF lt_data.
    DATA: lv_dsn1(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEX.TXT'.
    DATA: lv_dsn3(100) VALUE '/ECD/120/GIS/FTP/IB/DNBPAYDEXZIP.zip'.
    *DATA: lv_dsn3(100) VALUE '/interfaces/SM5/test.zip'. " Contains sample1.xls and sample2.xls
    DATA: lv_file_length TYPE i.
    DATA: lv_content TYPE xstring.
    DATA: lo_zip TYPE REF TO cl_abap_zip.
    CREATE OBJECT lo_zip.
    Read the data as a string
    clear lv_content .
    OPEN DATASET lv_dsn1 FOR INPUT IN BINARY MODE.
    READ DATASET lv_dsn1 INTO lv_content .
    CLOSE DATASET lv_dsn1.
    lo_zip->add( name = 'sample.TXT' content = lv_content ).
    lv_content = lo_zip->save( ).
    *clear lv_content .
    Conver the xstring content to binary
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = lv_content
    IMPORTING
    output_length = lv_file_length
    TABLES
    binary_tab = lt_data.
    OPEN DATASET lv_dsn3 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT lt_textdata INTO ls_data.
    TRANSFER ls_data TO lv_dsn3.
    ENDLOOP.
    CLOSE DATASET lv_dsn3.
    IF sy-subrc EQ '0'.
        MESSAGE s999(zfi_ap_gl) WITH text-t10.
      ENDIF.
    Can you please help.
    Thanks Aravind

  • Sending smartforms as PDF attachement via e mail

    Hello all:
    I have configured PPF actions to send smartforms as PDF attchment via e mail it works fine in one client.
    But when I copied the transport to another client, the entries in field 'Recipient' in the configuration step 'Define Conditions and Output Parameters for Comm. of Cust.Shipm. & Cust.Dcl'  are not copied to the new client. I had maintained the name of the inbox folder that has e mail addresses in this field. Any one has a similar issue ? Or is this similar to the number ranges and not transportable and we have to maintain them in every client. Any insight into this very much appreciated.

    Hello:
    If you want to send the smartform as a PDF attachment, configure your PPF action as described below:
    Step 1: Define Techn. Medium for Msgs (PPF Actions) f. Cust. Shipm. and Cust. Decl.
                In the action definition, choose processing type as 'External Communication'
                                                             form type:  'Smart Forms'
                                                             format: /SAPSLL/FORM_PROC
                                                             personalization type: 2 object specific....
                Make this action definition partner function dependent and create a Z partner function. Maintain that  
                partner function in this definition.
    Step 2: Define Conditions and Output Parameters for Comm. of Cust.Shipm. & Cust.Dcl
                Select Communication Method: Internet Mail
                          Mail Settings: send status: 3
    Configure the reamaining PFF actions as usual.
    This will work if that configured partner function is maintained in the customs declaration. And for that business partner, maintain the e mail address in the address dependent section via txn BP.

  • How to send smartforms as pdf attachments with e mail

    hi experts,
    how to send smartforms as pdf attachments with e mail???
    nitin

    Hi
    In the FORM Interface put proper parameter. Hope this helps.

  • Send smartforms via email using action profiles

    hi,
    i am trying to send smartforms via email using action profiles and i would like to know if anyone has any document or know any steps to do the same. i have created the smartform and i created the action in an action profile. i selected the option "Smartforms Mail". and i have mentioned my smartform in it.
    I have previously worked with action profiles to trigger workflows which sent a mail. That was relatively easier as i could mention that the mail be sent to my mailbox. But in the smartforms option, i dont know how to give the instruction that it be sent to my mailbox.. is there any place i can set it? The action is not person dependant and is done whenever saving a document.
    Please guide.
    Thanks,
    Nisha

    Hi Nisha,
    As u worked on Action profiles, i recommend u use action profile with permitted Process type as Smart Forms Mail to send the mails which contains the data in Smartform u created.
    Use below mail setting
    Form Name              (u r ZSmartform)
    Processing Class      CL_DOC_PROCESSING_CRM_ORDER
    Processing Method    CRM_ACTIVITY_EXEC_SMART_FORM
    Archive Mode            1 Mail only User
    In Action definition details u can mentioned the Processing time, Partner dependent for action to who u want to send the mail, further in action condition using schedule and start condition u can set the criteria to mail trigger.
    Hope it'll help u.
    Regards,
    Dipesh.

  • Send Smartform Email via Action Profile

    Hello,
    We have an Action Profile with a few actisn athat a workign perfectly.  I have added a new action to send  smartform via email when the the transaction is saved.
    The Action profile is set upfor object type BUS2000115(Quotation) with the context class of CL_DOC_CONTEXT_CRM_ORDER.
    I have set up the Smartform Email action processing as follows:
    Permitted processign type fo Action - Smartform Email
    Mail Settings:
    Form Name                       YC3_SF_CRM_COMM_QUOTATION_V7
    Processing Class              CL_CRM_BP_UM_PROCESSING_PPF
    Processing Method           UM_EXEC_SMART_FORM
    Archive Mode                    Mail only
    there is no schedule or start condition as it is not required.
    When I Save the Quotation nothing is getting triggered.  If in the Quotation I Preview output and select 'Email Quotation; I get the message 'Smartform Error'.  Is there a way to debug the message further ?  I'm assuming this is the SAP standard method of achieving Smartform email as Pdf attachment, are some steps that I have missed ?
    Regards
    Chan

    The Processing class and Processing Method seem to be incorrect.
    Use the below;
    Processing Class  : CL_DOC_PROCESSING_CRM_ORDER
    Processing Method: CRM_ORDER_EXEC_SMART_FORM
    You can always refer to standard action profile for Quotations to see what SAP has delivered.

  • Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.

    Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.

    : Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.The FP-1600 modules automatically send data on-change only. The change threshold is by default 0%. Any change, even a single least significant bit change, is sent back to the computer. If the FP-1600 firmware revision supports deadbanding (firmware revision 3.0.x and later, can be downloaded from ftp://ftp.ni.com/support/fieldpoint/Update/FPEthernet0320.zip ). Then on each analog channel or count channel you can specify a percentage change for deadbanding in FieldPoint Explorer. This is done on a channel by channel basis, by right-clicking on the particular IO module and choosing Edit this Device, then choosing Channel Configuration. Each channel (if it supports deadbanding) will have a deadband entry box on the middle right side of the screen).
    The FP-1000/1001 seri
    al network modules do not support deadbanding. The checkbox in FieldPoint Explorer is simply for how FieldPoint Explorer displays the data to the user and does not effect client programs nor the behavior of the network module itself.
    Regards,
    Aaron

  • Send smartforms as fax and email

    Hi SAP gurus,
    Can you please tell me on how to send smartforms as fax and email?
    I would really appreciate your help.
    Thanks in advance.

    Hi,
    Check the below link.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a5/28d3b9d26211d4b646006094192fe3/content.htm
    Thanks,
    Sankar M

  • Sending Smartform as fax

    Hi All ,
    I have a requirement in which i need to send Smartform output as a Fax . fax number will be filled dynamically in the program in a  internal table .
    Any pointer to will be useful .
    If You can send a sample code it would be best ,
    Regards
    Saurabh Garg

    I don't have any code but this is the notes i've tought it would be helpfull to you. ANd before this your system should be configured for the Fax settings.
    Another important field is DEVICE where in the type of output type device is specified. The possible set of values is PRINTER, TELEFAX and MAIL. The default is PRINTER. If the TELEFAX is chosen it shows a dialog box where in all the fax parameters can be entered. This dialog box can also be suppressed. And the preview option can be enabled. The problem here is it will not give any exception or prompt the user to enter the Fax Number and its parameters even if they are not maintained properly. So take care of maintaining them in the OUTPUT_OPTIONS parameter.
    Key Note: Fax the output.
              TDTELELAND used to refer to the 2 digit country code. The country key                contains information which the system uses to check entries such as the                length of the postal code or bank account number.
       TDTELENUM and TDTELENUME Telecommunication number, as it is       dialed in the receiving country. The country dialing code is      automatically      added. Alternatively an '&' can be used as the first character to disable      number testing and number formatting.  In this case you must enter the      complete number, inclusive of country dialing code but without the      exchange.
         TDFAXUSER SAP: Office user name. Default is user’s name.
         TDSCHEDULE: Using this field the send mode can be set like whether it       is to be send immediately ( Value ‘IMM’)or at night ( Value ‘NIG’).
         TDSENDDATE: This is requested send date.
         TDSENDTIME: This is requested send time.
         BCS_REQST: This contains the mode in which the request status is sent      back. If it is set to ‘N’ no status is to be returned, if ‘E’ only error status is      to be returned and if ‘A’ all statuses are to be returned.
         BCS_STATUS: Setting for Which Statuses Are Reported by Mail. If it is           set to ‘N’ no status is to be returned, if ‘E’ only error status is     to be returned and if ‘A’ all statuses are to be returned.
         BCS_COMMIT: This is a general flag that is specifically does not have any use. This can be used to pass any other flag from the program.

  • Sending Smartform through Fax

    Hai All,
       could anyone help me with the sample code..I want to know the parameters for fax while calling the function module..
    Thanks

    HI LAXMI,
    CHECK THESE THREADS...
    Sending Smartforms through Fax
    Sending SMARTFORM output to FAX gateway
    How to fax a smartform?

Maybe you are looking for