Comments

Restrict access to sent emails in SOST SAP transaction




If you are sending emails out of SAP which contains sensitive data such as usernames and passwords, you may not want any user with access to the sap transaction SOST to view these details. In order to do this you could possibly delete the entries out of the SAP table where these are stored. A better method would be to change the abap code in the program which sends the email so that it sets the emails as private or confidential. If this is done anyone who tries to view the emails via SAP tcode SOST will get a restricted access message, saying that the email can not be viewed as it is confidential.

In-order to do this you simply have to set the SENSITIVTY field within the document_data parameter to the correct value.

document-SENSITIVTY = 'P'. "P equals Confidential
document-SENSITIVTY = 'E'. "E equals Private

* Populate the subject/generic message attributes
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name  = 'SAPRPT'.
  w_doc_data-obj_descr = 'Email Subject'.
  w_doc_data-sensitivty = 'P'.

* Call the FM to post the message to SAPMAIL
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
            document_data              = w_doc_data
            put_in_outbox              = 'X'
            sender_address             = ld_sender_address
            sender_address_type        = ld_sender_address_type
            commit_work                = 'X'
       IMPORTING
            sent_to_all                = w_sent_all
       TABLES
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            receivers                  = t_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.


<--SAP Email processing Home




sapdev logo background
sapdev logo sapdev logo


Can't find something on ERPWorkbench? A quick search should fix that: