cancel
Showing results for 
Search instead for 
Did you mean: 

mail smartform Layout

Former Member
0 Kudos

My objective is to mail smartform layout.

at the time of calling smart function module i have specified control_parameter, mail_recipent,

mail_sender, output_option.

at the time of execution i am getting message

Mail request 000000000092 created successfully

but mail is not going to recipent mail id.

SMTP config is ok, its working in other case. i have used the follwing code.

REPORT yrrm_mail_smartform_output .

TABLES: soud.

DATA: w_form_name TYPE tdsfname VALUE 'ZSD_CUST_COMPLAINT_LAYOUT',

w_fmodule TYPE rs38l_fnam,

w_ctrl TYPE ssfctrlop,

w_output TYPE ssfcompop.

  • Internal tables declaration

DATA: it_mailbody TYPE STANDARD TABLE OF soli

WITH HEADER LINE,

it_recipent TYPE TABLE OF string

WITH HEADER LINE.

DATA: g_mail_rec_obj TYPE swotobjid,

g_mail_sen_obj TYPE swotobjid,

g_mail_app_obj TYPE swotobjid.

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

  • This function module call is used to retrieve the name of the Function

  • module generated when the SMARTFORM is activated

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_form_name

IMPORTING

fm_name = w_fmodule

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_ctrl-device = 'MAIL'.

  • call smartforms

CALL FUNCTION w_fmodule

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = w_ctrl

  • mail_appl_obj = g_mail_app_obj

mail_recipient = g_mail_rec_obj

mail_sender = g_mail_sen_obj

output_options = w_output

user_settings = ' '

p_cno = 'PCBLC00001'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

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

&----


*& 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 = 'xxxx' "g_mail "g_mail type

ip_type_id = 'U'

IMPORTING

ep_recipient_id = p_mail_rec_obj

  • EP_ADDRESS =

  • ET_RECIPIENT =

EXCEPTIONS

invalid_recipient = 1

OTHERS = 2.

IF sy-subrc NE 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 NE 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

Accepted Solutions (0)

Answers (2)

Answers (2)

matt
Active Contributor
0 Kudos

Moderator message

Duplicate deleted from "Scripting, General"

Former Member
0 Kudos

Hi RasmiRanjanMishra ,

You need to send smartform with PDF or directly send ?

Can you please eloborate your question

Former Member
0 Kudos

I want to send directly.

At the time of calling smartform function module, there is provision for mail,

i want to use that option.

i don't to convert smartform layout to PDF and then mail.

Former Member
0 Kudos

I solved the issue by myself.

Steps:

1. I catch the OTF data into itab

2. Using CONVERT_OTF function module i convert it into PDF file

3. SX_TABLE_LINE_WIDTH_CHANGE using this function module

i convert the data into required itab format.

4. Then using function module SO_NEW_DOCUMENT_ATT_SEND_API1

i send file as an attachment.