7.26.2008

Understanding the Function Module - SO_OBJECT_Send

Import Parameters Name and Description Field name Field function
Object_hd_change (structure)Contains the process to be done when SAP mail is marked for execution. When the Execute Icon in the SAP mail is clicked the corresponding object is executed vmtyp ‘D’ for dialog module‘F’ for function module ‘R’ for report

‘T’ for transaction

‘U’ for transaction with export

Acnam Name of the object which is to be executed, like name of transaction/report
Skips ‘X’ to execute first screen in background
Objsns Indicates sensitivity of the object.‘P’ for private object ‘F’ for functional object

‘O’ for confidential object

‘C’ for company confidential object

Sensitivity level is restricted to ‘O’ for documents in shared folders

Objla Language of the document‘E’ for English sy-langu for system language
Objnam Name of the document
Objdes Short description (Title) of the document
Objsrt Name of the sort field. This is used to group documents based on certain criteria
Object_type Type of document to be sent with mail ‘RAW’ for raw text (default)‘DOC’ for word file ‘XLS’ for excel file

All classes can be used except for folders (‘FOL’) and distribution lists (‘DLI’)

Outbox_flag ‘X’ to indicate that mail should also be stored in outbox of the user after sending (default ‘ ‘)
Owner Sap login of the user responsible for transmission

Table Parameters Name and Description Field Name Field function
Objcont Table to hold the body of the mail Line Text lines up to 255 characters
Objhead Table to hold number of lines in the body of the mail, i.e size of the table in lines Line Text lines up to 255 characters
Objpara Table to hold the set/get parameters to be transferred to the processing element Name Name of the parameter. Only first three characters are used
Option Not used
Low Value of the parameter in name
High Not used
Objparb Table to hold information for mails to which a certain processing type is assigned. For a report or transaction with transfer of values to global memory, the table has to contain the parameters with relevant values. The memory id is taken from the first row. For a FM or dialog module, data in table will be transferred as table parameter msgdial Name For report or transaction with transfer of values to global memory, the field for first row should hold the name of the memory id used for export and the other rows should hold the parameter names. For FM or dialog module this field should hold the values as per the usage of the module
Value For report or transaction with transfer of values to global memory, the field for first row should remain empty and the other rows should hold values of the parameters. For FM or dialog module this field should hold the values as per the usage of the module
ReceiversTable to hold recipient details Recnam SAP login of the recipient. Append all the recipients to this table
Sndcp X for sending mail as a copy
Sndex X for sending as express document. This will prompt a logged on recipient saying that he or she has received an express mail
Recesc ‘B’ for SAP user ‘E’ for external email address ‘U’ for unix address

Export Parameters Name and Description Field name Field function
Object_id_new Contains object id of document created during send process
Sent_to_all X indicates that document was sent to all recipients. Flag is not activated if sending fails in one or more cases

Main Exceptions Name and Description Description
Too_much_receivers Number of recipients is greater than number for which sender is authorised to send
Object_not_sent Document was not delivered to any of the recipients
Object_not_exist Document class specified does not exist or cannot be sent
Object_no_authorisation Document could not be sent as one of the required authorisations does not exist
Parameter_error Invalid combination of parameter values transferred to FM
X_error Internal error occurred

Once all the parameters and table interfaces are properly filled, call the function module to send the SAP mail to the recipient inbox.

Care should be taken to report the status of execution of the function module to the user using one of the exceptions defined (refer function module pattern above)

Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly. The next article covers sending E-mails using ABAP.


For Further Clarifications, Leave a Comment............


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl