CA Function module RFC Used the same way in S/4HANA

SO_NEW_DOCUMENT_ATT_SEND_API1 SAPoffice: Send New Document with Attachments

Creates a SAPoffice document with optional attachments and sends it to internal users, e-mail addresses or other recipient types through SAPconnect. Older custom reports use it to e-mail lists, spool output or files as attachments. Describe body and attachments in PACKING_LIST, set COMMIT_WORK or commit yourself, and check the send status in SOST; for new developments the BCS classes (CL_BCS) are recommended.

Function group
SOI1
Remote-enabled (RFC)
Yes
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
DOCUMENT_DATASODOCCHGI1Attributes of the new documentYes
PUT_IN_OUTBOXSONV-FLAGPut document in outbox after sending—
COMMIT_WORKSONV-FLAGExecute COMMIT WORK at the end—

Exporting parameters

ParameterTypeDescription
SENT_TO_ALLSONV-FLAGDocument sent to all recipients
NEW_OBJECT_IDSOFOLENTI1-OBJECT_IDID of the created object

Tables parameters

ParameterTypeDescriptionRequired
PACKING_LISTSOPCKLSTI1Structure of body and attachmentsYes
OBJECT_HEADERSOLISTI1Document header data—
CONTENTS_BINSOLISTI1Binary contents (obsolete, use CONTENTS_HEX)—
CONTENTS_TXTSOLISTI1Text contents—
CONTENTS_HEXSOLIXBinary contents of document and attachments—
OBJECT_PARASOPARAI1SET/GET parameters for processing—
OBJECT_PARBSOPARBI1Fields and values for processing—
RECEIVERSSOMLRECI1RecipientsYes

Exceptions

  • TOO_MANY_RECEIVERS — Too many recipients
  • DOCUMENT_NOT_SENT — Document was not sent
  • DOCUMENT_TYPE_NOT_EXIST — Document or attachment type does not exist
  • OPERATION_NO_AUTHORIZATION — No authorization to send
  • PARAMETER_ERROR — Invalid parameter combination
  • X_ERROR — Internal error
  • ENQUEUE_ERROR — Locks could not be set

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data = lv_document_data
  IMPORTING
    sent_to_all = lv_sent_to_all
    new_object_id = lv_new_object_id
  TABLES
    packing_list = lt_packing_list
    object_header = lt_object_header
    contents_bin = lt_contents_bin
    contents_txt = lt_contents_txt
    contents_hex = lt_contents_hex
    object_para = lt_object_para
    object_parb = lt_object_parb
    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
    OTHERS = 8.

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report