0% found this document useful (0 votes)
241 views2 pages

So New Document Send Api1

The document summarizes the process of sending an approval notification email for a document. It defines variables to store document data, content, receivers and uses the SO_NEW_DOCUMENT_SEND_API1 function to send the document as a RAW type to the receivers, trapping any errors. The document number is appended to the description and a single content of "Approval Notification" is added. Receivers are looped from an email table and added.

Uploaded by

juni0001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
241 views2 pages

So New Document Send Api1

The document summarizes the process of sending an approval notification email for a document. It defines variables to store document data, content, receivers and uses the SO_NEW_DOCUMENT_SEND_API1 function to send the document as a RAW type to the receivers, trapping any errors. The document number is appended to the description and a single content of "Approval Notification" is added. Receivers are looped from an email table and added.

Uploaded by

juni0001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

DATA : ls_document_data TYPE sodocchgi1,

document_type TYPE soodk-objtp,


put_in_outbox TYPE sonv-flag,
commit_work TYPE sonv-flag,
ip_encrypt TYPE bcsd_encr,
ip_sign TYPE bcsd_sign,
sent_to_all TYPE sonv-flag,
new_object_id TYPE sofolenti1-object_id,
lt_object_header TYPE STANDARD TABLE OF solisti1,
lt_object_content TYPE STANDARD TABLE OF solisti1,
ls_object_content TYPE solisti1,
lt_contents_hex TYPE STANDARD TABLE OF solix,
lt_object_para TYPE STANDARD TABLE OF soparai1,
lt_object_parb TYPE STANDARD TABLE OF soparbi1,
lt_receivers TYPE STANDARD TABLE OF somlreci1,
ls_receivers TYPE somlreci1.

ls_document_data-obj_name = 'URGENT'.
ls_document_data-obj_descr = 'APPROVAL NOTIFICATION FOR THE DOCUMENT'.
CONCATENATE ls_document_data-obj_descr im_belnr INTO ls_document_data-obj_descr
SEPARATED BY space.
ls_document_data-sensitivty = 'P'.
ls_document_data-proc_syst = 'TST'.
ls_document_data-proc_clint = sy-mandt.
*receivers
DATA : wa_email TYPE zst_wf_agent.
LOOP AT im_email INTO wa_email.
ls_receivers-receiver = wa_email-email.
ls_receivers-rec_type = gc_u.
ls_receivers-com_type = gc_int.
APPEND ls_receivers TO lt_receivers.
ENDLOOP.
*content of mail
ls_object_content = 'Approval Notificaiton'.
APPEND ls_object_content TO lt_object_content.

* sending approval notification


CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_document_data
document_type = 'RAW'
commit_work = 'X'
TABLES
object_content = lt_object_content
receivers = lt_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.
IF sy-subrc NE 0.
ev_error = gc_email_not_sent.
ELSE.
ev_error = gc_email_sent.
ENDIF.
im_belnr type vbkpf-belnr,
im_email type zty_wf_agent
ev_error type teext50

You might also like