Ansicht
Dokumentation
SO_OLD_DOCUMENT_SEND_API1 - SAPoffice: Send existing document using RFC
RFUMSV00 - Advance Return for Tax on Sales/Purchases PERFORM Short ReferenceThis documentation is copyright by SAP AG.
Functionality
This function module allows a document which already exists to be sent internally and externally.
Import parameters
- DOCUMENT_ID
- ID of the folder entry of the document to be sent. This is the connection between the document and the folder in which it is located.
- PUT_IN_OUTBOX
- Default = ' '.
- If this flag is set ('X'), the document is also placed in the outbox of the active user when it is sent.
Export parameters
- SENT_TO_ALL
- If this flag is set ('X'), the document could be sent to all specified recipients or the appropriate send requests made to a subsystem in the case of external forwarding. If the document could not be sent to at least one participant, the flag is not set.
Table parameters
- RECEIVERS
- This table must contain the recipients of the document.
- RECEIVER
- Name of the recipient.
- The following entry types are possible:
- the SAP user name of the recipient
- the SAPoffice name of the recipient
- a shared distribution list
- a fax number in the form of the stucture SADRFD
- an Internet address in the form of the structure SADRUD
- a remote SAP name in the form of the structure SADR7D
- an X.400 address in the form of the structure SADR8D
- ADR_TYPE
- Type of RECEIVER entry.
- The following values are allowed:
- 'B' : SAP user name
- ' ' : SAPoffice name
- 'C' : shared distribution list
- 'F' : fax number
- 'U' : Internet address
- 'R ' : remote SAP name
- 'X' : X.400 address
- REC_ID
- If the recipient is a SAPoffice user, the ID of the user can be specified in this field instead of the recipient name in RECEIVER.
- REPLY_DOC
- If this field is filled, the document sent is regarded as a reply to the folder entry identified by the ID specified. A correspondence history is set up and recorded automatically.
- REC_DATE
- Date on which the document is to reach the recipient. It is not possible to guarantee that the document will be received on this date in the case of external recipients since this depends on the behaviour of the products connected.
- PROXY_ID
- If automatic forwarding is active for the recipient of the document, this field contains the SAP user ID or the address ID of the external address to which the document was finally sent.
- RETRN_CODE
- If the recipient has received the document, this field is filled by the function module with the value '0', otherwise a value which is not equal to '0' is entered.
- EXPRESS
- If this flag is set ('X'), the document is sent with the attribute 'Express'. If the recipient is a logged on SAPoffice user, he/she receives a message immediately stating that an express mail has been received.
- COPY
- If this flag is set ('X'), the document is sent with the attribute 'Copy'.
- BLIND_COPY
- If this flag is set ('X'), the document is sent with the attribute 'Blind copy'. If the recipient is a SAPoffice user, he/she cannot print nor forward the document.
- NO_FORWARD
- If this flag is set ('X') and the recipient is a SAPoffice user, he/she cannot forward the document.
- NO_PRINT
- If this flag is set ('X') and the recipient is a SAPoffice user, he/she cannot print the document.
- TO_ANSWER
- If this flag is set ('X') and the recipient is a SAPoffice user, he/she must send a reply to the document before it can be removed from the inbox.
- TO_DO_EXPL
- If this flag is set ('X') and the recipient is a SAPoffice user, he/she must act upon the document before it can be removed from the inbox.
- TO_DO_GRP
- If this field has a value between '1' and '9', a SAPoffice user from the recipient group formed by this number must take action on the document before it can be removed from the inbox by the persons involved. If the value '0' is entered, it is not necessary to take action.
- COM_TYPE
- Communication method with which the document is to be sent. This field is only taken into account if the recipient is an address number, that is if the document is sent externally via the address management. If the field is not filled, the standard communication method specified in the address management is used.
- The following values are allowed:
- 'INT' : Send via Internet
- 'FAX' : Send as fax
- 'X40' : Send via X.400
- 'RML' : Send to another SAP System
- LFDNR
- Sequential number from the address management. This field is only taken into account if the recipient is an address number, that is if the document is sent via the address management. If the field is not filled, the sequential number specified in the address management is used.
- FAX
- This field is not used.
- COUNTRY
- This field is not used.
- SPOOL_ID
- This field is not used.
- NOTIF_DEL
- If this flag is set ('X'), the sender receives a confirmation as soon as the document has been delivered to the recipient. He/she also receives a message if the document could not be delivered. This flag should only be set if documents are sent externally since the process is carried out synchronously if documents are sent internally. However, the confirmation is only supported by a few mail systems such as X.400 and SAP SAP.
- NOTIF_READ
- If this flag is set ('X'), the sender is notified as soon as the recipient has read the document. This flag should only be set if documents are sent externally since the process is carried out synchronously if documents are sent internally. However, the read confirmation is only supported by a few mail systems such as X.400 and SAP SAP.
- NOTIF_NDEL
- If this flag is set ('X'), the recipient receives a message if the document could not be delivered to the recipient. This flag should only be set if documents are sent externally since the process is carried out synchronously when documents are sent internally. However, the message is only supported by a few mail systems such as X.400 and SAP SAP.
- SAP_BODY
- If this flag is set ('X'), the SAP-specific data is also sent in an external bodypart when the document is sent via X.400. However, this should only be done if the target system is an SAP System.
Exceptions
- TOO_MANY_RECEIVERS
- Too many recipients were specified. The active user is not authorized to send to this number of recipients.
- DOCUMENT_NOT_SENT
- The document could not be sent. It was not delivered to any of the specified recipients.
- DOCUMENT_NOT_EXIST
- The folder entry specified does not exist. An incorrect ID was probably passed or the relevant folder entry has been deleted.
- OPERATION_NO_AUTHORIZATION
- The document could not be sent. One of the authorizations required is missing.
- PARAMETER_ERROR
- An invalid combination of parameter values was passed to the function module.
- X_ERROR
- An internal error or database inconsistency occurred.
- ENQUEUE_ERROR
- A lock required for the send operation could not be set. Processing is probably being carried out by another user.
Example
Sending documents in the inbox of the active user to a specified Internet address. Documents with the attribute 'no forwarding' are not included. To determine the ID of the inbox, the function module SO_USER_READ_API1 is used, the contents of the inbox are read using the function module SO_FOLDER_READ_API1.
- PARAMETERS: RECEIVER LIKE SOMLRECI1-RECEIVER.
- DATA: FOL_CONT LIKE SOFOLENTI1 OCCURS 20 WITH HEADER LINE.
- DATA: RECLIST LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
- DATA: USER_DATA LIKE SOUDATAI1.
- CALL FUNCTION 'SO_USER_READ_API1'
- IMPORTING
- USER_DATA = USER_DATA
- EXCEPTIONS
- OTHERS = 1.
- IF SY-SUBRC <> 0.
- WRITE: / 'User data could not be read !'.
- EXIT.
- ENDIF.
- CALL FUNCTION 'SO_FOLDER_READ_API1'
- EXPORTING
- FOLDER_ID = USER_DATA-INBOXFOL
- TABLES
- FOLDER_CONTENT = FOL_CONT
- EXCEPTIONS
- OTHERS = 1.
- IF SY-SUBRC <> 0.
- WRITE: / 'Inbox could not be read !'.
- EXIT.
- ENDIF.
- LOOP AT FOL_CONT WHERE BLIND_COPY IS INITIAL
- AND NO_FORWARD IS INITIAL.
- CLEAR RECLIST.
- REFRESH RECLIST.
- RECLIST-RECEIVER = RECEIVER.
- RECLIST-REC_TYPE = 'U'.
- APPEND RECLIST.
- CALL FUNCTION 'SO_OLD_DOCUMENT_SEND_API1'
- EXPORTING
- DOCUMENT_ID = FOL_CONT-DOC_ID
- TABLES
- RECEIVERS = RECLIST
- EXCEPTIONS
- TOO_MANY_RECEIVERS = 1
- DOCUMENT_NOT_SENT = 2
- OPERATION_NO_AUTHORIZATION = 4
- OTHERS = 99.
- CASE SY-SUBRC.
- WHEN 0.
- WRITE: / 'Document', FOL_CONT-OBJ_DESCR, 'sent.'.
- WHEN 1.
- WRITE: / 'Too many recipients, document cannot be sent !'.
- EXIT.
- WHEN 2.
- WRITE: / 'Document', FOL_CONT-OBJ_DESCR, 'not sent !'.
- WHEN 4.
- WRITE: / 'No authorization to send via Internet !'.
- EXIT.
- WHEN OTHERS.
- WRITE: / 'Unexpected error occurred !'.
- EXIT.
- ENDCASE.
- ENDLOOP.
Notes
To send a document which has not yet been created, the function module SO_NEW_DOCUMENT_SEND_API1 must be used.
It is not possible to use the address name of a user as the recipient since it is not necessarily unique. To avoid this problem, the function module SO_NAME_CONVERT_API1 can be used. It returns a hit list for a specified name, which is followed by a dialog when the value required is selected.
Further information
Information on calling the function modules SO_USER_READ_API1 and SO_FOLDER_READ_API1 can be found in the documentation of the respective function modules.
Parameters
DOCUMENT_IDIP_ENCRYPT
IP_SIGN
PUT_IN_OUTBOX
RECEIVERS
SENT_TO_ALL
Exceptions
DOCUMENT_NOT_EXISTDOCUMENT_NOT_SENT
ENQUEUE_ERROR
OPERATION_NO_AUTHORIZATION
PARAMETER_ERROR
TOO_MANY_RECEIVER
X_ERROR
Function Group
SOI1rdisp/max_wprun_time - Maximum work process run time General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 14139 Date: 20240523 Time: 090117 sap01-206 ( 168 ms )