SAP KMC_SECURITY_CALLBACK Function Module for Security callback for attachment security manager
KMC_SECURITY_CALLBACK is a standard kmc security callback SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Security callback for attachment security manager processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for kmc security callback FM, simply by entering the name KMC_SECURITY_CALLBACK into the relevant SAP transaction such as SE37 or SE38.
Function Group: KMC_BC
Program Name: SAPLKMC_BC
Main Program: SAPLKMC_BC
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function KMC_SECURITY_CALLBACK pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'KMC_SECURITY_CALLBACK'"Security callback for attachment security manager.
EXPORTING
I_RID = "RID der zu prüfenden Resource
I_PERMISSION = "Die zu überprüfende Aktion (lesen, schreiben, ...)
I_BO_TYPE = "Business Object Type
I_BO_NODE = "Business Object Node
I_BO_ID = "Business Object Id
I_CONTAINER = "Name des Attachment Containers
I_KTP_DOC_TYPE = "KTP Document Type
IMPORTING
E_IS_ALLOWED = "Returns true if user is allowed to access resource
E_TTL = "Returns time to live to cache entry
E_DEBUG_VALUE = "Returns debug information
E_DEBUG_CALLBACK = "Returns parameters for call back check
EXCEPTIONS
KMC_CALLBACK_EXCEPTION = 1
IMPORTING Parameters details for KMC_SECURITY_CALLBACK
I_RID - RID der zu prüfenden Resource
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_PERMISSION - Die zu überprüfende Aktion (lesen, schreiben, ...)
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_BO_TYPE - Business Object Type
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_BO_NODE - Business Object Node
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_BO_ID - Business Object Id
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_CONTAINER - Name des Attachment Containers
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
I_KTP_DOC_TYPE - KTP Document Type
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for KMC_SECURITY_CALLBACK
E_IS_ALLOWED - Returns true if user is allowed to access resource
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
E_TTL - Returns time to live to cache entry
Data type: INT4Optional: No
Call by Reference: No ( called with pass by value option)
E_DEBUG_VALUE - Returns debug information
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
E_DEBUG_CALLBACK - Returns parameters for call back check
Data type: STRINGOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
KMC_CALLBACK_EXCEPTION - Is thrown in error situation
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for KMC_SECURITY_CALLBACK Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_i_rid | TYPE STRING, " | |||
| lv_e_is_allowed | TYPE STRING, " | |||
| lv_kmc_callback_exception | TYPE STRING, " | |||
| lv_e_ttl | TYPE INT4, " | |||
| lv_i_permission | TYPE STRING, " | |||
| lv_i_bo_type | TYPE STRING, " | |||
| lv_e_debug_value | TYPE STRING, " | |||
| lv_i_bo_node | TYPE STRING, " | |||
| lv_e_debug_callback | TYPE STRING, " | |||
| lv_i_bo_id | TYPE STRING, " | |||
| lv_i_container | TYPE STRING, " | |||
| lv_i_ktp_doc_type | TYPE STRING. " |
|   CALL FUNCTION 'KMC_SECURITY_CALLBACK' "Security callback for attachment security manager |
| EXPORTING | ||
| I_RID | = lv_i_rid | |
| I_PERMISSION | = lv_i_permission | |
| I_BO_TYPE | = lv_i_bo_type | |
| I_BO_NODE | = lv_i_bo_node | |
| I_BO_ID | = lv_i_bo_id | |
| I_CONTAINER | = lv_i_container | |
| I_KTP_DOC_TYPE | = lv_i_ktp_doc_type | |
| IMPORTING | ||
| E_IS_ALLOWED | = lv_e_is_allowed | |
| E_TTL | = lv_e_ttl | |
| E_DEBUG_VALUE | = lv_e_debug_value | |
| E_DEBUG_CALLBACK | = lv_e_debug_callback | |
| EXCEPTIONS | ||
| KMC_CALLBACK_EXCEPTION = 1 | ||
| . " KMC_SECURITY_CALLBACK | ||
ABAP code using 7.40 inline data declarations to call FM KMC_SECURITY_CALLBACK
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.Search for further information about these or an SAP related objects