Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sapforms

Former Member
0 Likes
617

Hi everyone,

Sapforms allows to generate documents in PDF format. I would like to know if it was possible to automatically mail these documents with sapforms.

I know it's possible with a WAS but I would like to do it with SAP R3 4.6C.

Thanks,

3 REPLIES 3
Read only

Shivaji16
Active Participant
0 Likes
583

check with the function Module 'SO_NEW_DOCUMENT_ATT_SEND_API1'.

For the tables parameters, Packing List

set doc_type field as 'PDF' and try.

Hope it will work..

please get back if not..

Read only

Former Member
0 Likes
583

U can make use of the following code.

FORM send_mail USING p_y16m_rcp_par STRUCTURE y16m_rcp_par.

  • Have a subject for the mail

g_s_document_data-obj_name = text-t02.

g_s_document_data-obj_descr = text-t03.

  • Fill receiver information

g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.

g_s_receivers-rec_id = p_y16m_rcp_par-rec_id.

g_s_receivers-express = 'X'.

APPEND g_s_receivers TO g_t_receivers.

  • Call function to send mail

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = g_s_document_data

document_type = 'RAW'

  • PUT_IN_OUTBOX = ' '

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

TABLES

  • OBJECT_HEADER =

object_content = g_t_object_content

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = g_t_receivers

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.

ENDIF.

ENDFORM. " SEND_MAIL

Regards

Read only

0 Likes
583

Thanks for the solutions.

I would like to know if these solutions are concerning a smtp host that will be configured somewhere in SAP or the internal SAP mailing service (workplace). It's the first case that would be interessant for me.

Regards,