cancel
Showing results for 
Search instead for 
Did you mean: 

Create Smartform and Email it

Former Member
0 Kudos

Hi all,

I have created a Smartform and I need to email it to an external email. Is there a way to do this?

Thanks in advance,

Scott

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

Go through this link it will help to close your thread.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9">Sample</a>

Regards,

Sairam

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

good

g_cont_par-device = 'MAIL'.

  • Get BOR-Objects for Recipient, Sender und Applikation

PERFORM mail_recipient_object CHANGING g_mail_rec_obj.

PERFORM mail_sender_object CHANGING g_mail_sen_obj.

PERFORM mail_appl_object CHANGING g_mail_app_obj.

  • Calling Smartform

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = g_cont_par

mail_appl_obj = g_mail_app_obj

mail_recipient = g_mail_rec_obj

mail_sender = g_mail_sen_obj

output_options = g_output

user_settings = ' '

IMPORTING

... rest of function ...

Here are the Forms:

&----


*& Form mail_recipient_object

&----


  • text

----


  • <--P_G_MAIL_REC_OBJ text

----


FORM mail_recipient_object CHANGING p_mail_rec_obj.

CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'

EXPORTING

  • IP_COUNTRY =

  • IP_FAXNO =

ip_mailaddr = g_mail "g_mail type

"SO_NAME.

ip_type_id = g_rectype " 'U'

IMPORTING

ep_recipient_id = p_mail_rec_obj

  • 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

----


  • <--P_G_MAIL_SEN_OBJ text

----


FORM mail_sender_object CHANGING p_mail_sen_obj.

CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'

EXPORTING

ip_sender = sy-uname

IMPORTING

ep_sender_id = p_mail_sen_obj

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_mail_app_obj.

SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.

ENDSELECT.

IF sy-subrc NE 0.

CALL FUNCTION 'SO_USER_AUTOMATIC_INSERT'

EXPORTING

sapname = sy-uname

EXCEPTIONS

no_insert = 1

sap_name_exist = 2

x_error = 3

OTHERS = 4.

IF sy-subrc NE 0.

CLEAR soud.

ELSE.

SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.

ENDSELECT.

ENDIF.

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 p_mail_app_obj.

IF sy-subrc NE 0.

CLEAR p_mail_app_obj.

ENDIF.

ENDIF.

ELSE.

CLEAR p_mail_app_obj.

ENDIF.

ENDFORM. " mail_appl_object

Please also search for "email" in this forum concerning the connection from SAP to a mailsystem.

thanks

mrutyun^

Former Member
0 Kudos

Hi,

Try this. Copy the code and check.

&----


*& Report ZEMAIL_GM

*&

&----


REPORT zemail_gm.

*********Variable Declarations *****************************

DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform

gv_bin_filesize TYPE i, " Store the file size

gv_pos TYPE i,

gv_len TYPE i,

gv_tab_lines TYPE i.

********Constants *******************************************

Data : gc_text(11) type c value 'Form Output',

gc_tst(3) type c value 'TST',

gc_testing(7) type c value 'Testing'.

*********Work Area Declarations *****************************

DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed

gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure

gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options

gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing

gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List

gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines

gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255

gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components

*********Internal tables Declarations *****************************

DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List

gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines

gt_otf TYPE TABLE OF itcoo, " OTF Structure

gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255

gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components

CLEAR : gv_form_name,

gs_ctrlop,

gs_outopt,

gs_otfdata,

gv_bin_filesize,

gv_pos,

gv_len,

gv_tab_lines.

START-OF-SELECTION.

  • Generate Function Module name

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZPDF_G'

IMPORTING

fm_name = gv_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.

  • Assigning values to Form Control Structure and Form Composer

gs_ctrlop-getotf = 'X'.

gs_ctrlop-no_dialog = 'X'.

gs_outopt-tdnoprev = 'X'.

  • Getting the OTFDATA

CALL FUNCTION gv_form_name

EXPORTING

control_parameters = gs_ctrlop

output_options = gs_outopt

user_settings = 'X'

IMPORTING

job_output_info = gs_otfdata

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.

  • Assigning the OTFDATA to OTF Structure table

CLEAR gt_otf.

gt_otf[] = gs_otfdata-otfdata[].

  • Convert the OTF DATA to SAP Script Text lines

CLEAR gt_pdf_tab.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = gv_bin_filesize

TABLES

otf = gt_otf

lines = gt_pdf_tab

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.

  • Assigning the Description of the object sent in the mail

CLEAR gs_docdata.

gs_docdata-obj_name = gc_tst.

gs_docdata-obj_descr = gc_testing.

  • Assigning the email id to Structure of the API Recipient List table

CLEAR : gt_reclist, gs_reclist.

gs_reclist-receiver = 'minal.nampalliwar@wipro.com'.

gs_reclist-rec_type = 'U'.

APPEND gs_reclist TO gt_reclist.

  • Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table

CLEAR : gs_objbin, gs_pdf_tab.

LOOP AT gt_pdf_tab INTO gs_pdf_tab.

gv_pos = 255 - gv_len.

IF gv_pos > 134. "length of pdf_table

gv_pos = 134.

ENDIF.

gs_objbin+gv_len = gs_pdf_tab(gv_pos).

gv_len = gv_len + gv_pos.

IF gv_len = 255. "length of out (contents_bin)

APPEND gs_objbin TO gt_objbin.

CLEAR: gs_objbin, gv_len.

IF gv_pos < 134.

gs_objbin = gs_pdf_tab+gv_pos.

gv_len = 134 - gv_pos.

ENDIF.

ENDIF.

ENDLOOP.

IF gv_len > 0.

APPEND gs_objbin TO gt_objbin.

ENDIF.

  • Filling the details in SAPoffice: Description of Imported Object Components table

DESCRIBE TABLE gt_objbin LINES gv_tab_lines.

CLEAR gs_objbin.

READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.

IF sy-subrc = 0.

gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).

gs_objpack-transf_bin = 'X'.

gs_objpack-head_start = 1.

gs_objpack-head_num = 0.

gs_objpack-body_start = 1.

gs_objpack-body_num = gv_tab_lines.

gs_objpack-doc_type = 'PDF'.

gs_objpack-obj_name = 'ATTACHMENT'.

gs_objpack-obj_descr = 'test'.

APPEND gs_objpack TO gt_objpack.

ENDIF.

  • Sending the Form Output in the PDF format to email

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = gs_docdata

put_in_outbox = 'X'

commit_work = 'X'

TABLES

packing_list = gt_objpack

contents_bin = gt_objbin

receivers = gt_reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

WRITE 'Sent Successfully'.

ENDIF.

SUBMIT rsconn01

WITH mode EQ 'INT'

AND RETURN.

END-OF-SELECTION.

Reward if useful.........

Former Member
0 Kudos

Hi Scott,

Local data:

DATA:

ls_control_param TYPE ssfctrlop, "Control paramters

ls_output_options TYPE ssfcompop. "Output options

  • Data for email smart form:

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:

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.

  • error handling

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.

  • error handling

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.

  • error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

  • Control parameters.

  • For Print output:

IF nast-nacha = '1'. "Print output

ls_control_param-preview = 'X'.

ls_control_param-no_dialog = 'X'.

ENDIF.

  • For fax/email output.

IF nast-nacha = '2'. "Fax/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.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

IF NAST-NACHA = '2'.

ls_control_param-device = 'TELEFAX'.

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.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

ENDIF.

Local data:

DATA:

ls_control_param TYPE ssfctrlop, "Control paramters

ls_output_options TYPE ssfcompop. "Output options

  • Data for email smart form:

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:

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.

  • error handling

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.

  • error handling

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.

  • error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

  • Control parameters.

  • For Print output:

IF nast-nacha = '1'. "Print output

ls_control_param-preview = 'X'.

ls_control_param-no_dialog = 'X'.

ENDIF.

  • For fax/email output.

IF nast-nacha = '2'. "Fax/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.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

IF NAST-NACHA = '2'.

ls_control_param-device = 'TELEFAX'.

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.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

ENDIF.

-


Look at this blog, this is well explained about the Smartforms to send as a Fax and email ..

/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp

and also look at this thread

Regards,

KK

Former Member
0 Kudos

Kishore,

Thanks for the reply. I copied your code but I recieve and error when I run it. Looks like a formatting error. Any suggestions?

Here is my program...

report ztestmail.

TABLES: NAST.

DATA:

IT_BOOK TYPE PPFTBOOK,

cf_retcode TYPE sy-subrc,

fm_name TYPE rs38l_fnam,

ls_control_param TYPE ssfctrlop, "Control paramters

ls_output_options TYPE ssfcompop. "Output options

  • Data for email smart form:

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:

CONSTANTS:

lc_ip_type_id TYPE so_escape VALUE 'U', "For internet address.

lc_smartform TYPE tdsfname VALUE 'SPPFDEMO_BOOK',"'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_mailaddr = 'SMILLER'.

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.

  • error handling

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.

  • error handling

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 = lc_smartform

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

  • Control parameters.

  • For Print output:

IF nast-nacha = '1'. "Print output

ls_control_param-preview = 'X'.

ls_control_param-no_dialog = 'X'.

ENDIF.

  • For fax/email output.

IF nast-nacha = '2'. "Fax/Email

  • Output options

ls_output_options-tdteleland = 'US'."gs_kna1-land1.

ls_output_options-tdtelenum = '123-456-7890'."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 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 = ' '

IS_BOOK = IT_BOOK

*TABLES

*delivery = gt_delivery

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

IF NAST-NACHA = '2'.

ls_control_param-device = 'TELEFAX'.

CALL FUNCTION 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.

  • Error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

ENDIF.

ENDIF.

&----


*& Form protocol_update

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form protocol_update .

WRITE: cf_retcode.

endform. " protocol_update

former_member189629
Active Contributor
0 Kudos

Scott,

Refer to the program BCS_EXAMPLE_6 and the below link

/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp

http://help.sap.com/saphelp_47x200/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm

http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_SEND_SPOOL_MAIL_...

reward if helpful.

K