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

SO_DOCUMENT_SEND_API1 SAPoffice: Send Document with Attachments

Sends a new SAPoffice document with attachments like SO_NEW_DOCUMENT_ATT_SEND_API1, but additionally lets you set a sender address and request encryption or signature. It is used in custom programs that must send e-mails from a specific address, for example a shared mailbox. Fill PACKING_LIST, RECEIVERS and the content tables, set COMMIT_WORK, and check the result in SOST; for new code prefer CL_BCS.

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—
SENDER_ADDRESSSOEXTRECI1-RECEIVERSender address—
SENDER_ADDRESS_TYPESOEXTRECI1-ADR_TYPSender address type—
COMMIT_WORKSONV-FLAGExecute COMMIT WORK at the end—
IP_ENCRYPTBCSD_ENCREncryption required—
IP_SIGNBCSD_SIGNSignature required—
IV_VSI_PROFILEVSCAN_PROFILEVirus scan profile—

Exporting parameters

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

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—
RECEIVERSSOMLRECI1RecipientsYes
ET_VSI_ERRORBAPIRET2Virus scan messages—

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_DOCUMENT_SEND_API1'
  EXPORTING
    document_data = lv_document_data
  IMPORTING
    sent_to_all = lv_sent_to_all
    new_object_id = lv_new_object_id
    sender_id = lv_sender_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
    receivers = lt_receivers
    et_vsi_error = lt_et_vsi_error
  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