SAP CNACL_USER_RIGHTS_GET Function Module for Get the rights of teh user for an object
CNACL_USER_RIGHTS_GET is a standard cnacl user rights get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Get the rights of teh user for an object 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 cnacl user rights get FM, simply by entering the name CNACL_USER_RIGHTS_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: CNACL
Program Name: SAPLCNACL
Main Program: SAPLCNACL
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function CNACL_USER_RIGHTS_GET 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 'CNACL_USER_RIGHTS_GET'"Get the rights of teh user for an object.
EXPORTING
I_USER_NAME = "Communication ID/Number
* I_SMSG_ON = "Selection Indicator
* I_SMSG_ZEILE = '000' "Line number
* I_OBJNR1 = "Object number
* I_MLST = "Milestone
* I_PRPS = "WBS (Work Breakdown Structure) Element Master Data
* I_PROJ = "Project definition
* I_AFVGD = "Order: Dialog table for Table AFVG (order operation)
* I_CAUFV = "Generated Table for View CAUFV
* I_MULTI = "if called from CNAU_*_MULTI
* I_MSGTY = "Message Type
CHANGING
* C_DISPLAY = "
* C_CHANGE = "
* C_ACT_TYPE = "PS ACL Authorization Type
EXCEPTIONS
NO_ACL = 1 ACL_INACTIVE = 2 USER_NOT_FOUND = 3
IMPORTING Parameters details for CNACL_USER_RIGHTS_GET
I_USER_NAME - Communication ID/Number
Data type: SY-UNAMEOptional: No
Call by Reference: Yes
I_SMSG_ON - Selection Indicator
Data type: RCJ_MARKL-MARKOptional: Yes
Call by Reference: Yes
I_SMSG_ZEILE - Line number
Data type: MESG-ZEILEDefault: '000'
Optional: Yes
Call by Reference: Yes
I_OBJNR1 - Object number
Data type: J_OBJNROptional: Yes
Call by Reference: Yes
I_MLST - Milestone
Data type: MLSTOptional: Yes
Call by Reference: Yes
I_PRPS - WBS (Work Breakdown Structure) Element Master Data
Data type: PRPSOptional: Yes
Call by Reference: Yes
I_PROJ - Project definition
Data type: PROJOptional: Yes
Call by Reference: Yes
I_AFVGD - Order: Dialog table for Table AFVG (order operation)
Data type: AFVGDOptional: Yes
Call by Reference: Yes
I_CAUFV - Generated Table for View CAUFV
Data type: CAUFVOptional: Yes
Call by Reference: Yes
I_MULTI - if called from CNAU_*_MULTI
Data type: COptional: Yes
Call by Reference: Yes
I_MSGTY - Message Type
Data type: SY-MSGTYOptional: Yes
Call by Reference: Yes
CHANGING Parameters details for CNACL_USER_RIGHTS_GET
C_DISPLAY -
Data type: COptional: Yes
Call by Reference: Yes
C_CHANGE -
Data type: COptional: Yes
Call by Reference: Yes
C_ACT_TYPE - PS ACL Authorization Type
Data type: PS_ACTTYPE_DELEOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_ACL - No ACL was found for the requested OBJNR
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACL_INACTIVE - ACL has not been activated through Customizing
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_NOT_FOUND - User not found
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CNACL_USER_RIGHTS_GET 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_no_acl | TYPE STRING, " | |||
lv_c_display | TYPE C, " | |||
lv_i_user_name | TYPE SY-UNAME, " | |||
lv_i_smsg_on | TYPE RCJ_MARKL-MARK, " | |||
lv_i_smsg_zeile | TYPE MESG-ZEILE, " '000' | |||
lv_c_change | TYPE C, " | |||
lv_i_objnr1 | TYPE J_OBJNR, " | |||
lv_acl_inactive | TYPE J_OBJNR, " | |||
lv_i_mlst | TYPE MLST, " | |||
lv_c_act_type | TYPE PS_ACTTYPE_DELE, " | |||
lv_user_not_found | TYPE PS_ACTTYPE_DELE, " | |||
lv_i_prps | TYPE PRPS, " | |||
lv_i_proj | TYPE PROJ, " | |||
lv_i_afvgd | TYPE AFVGD, " | |||
lv_i_caufv | TYPE CAUFV, " | |||
lv_i_multi | TYPE C, " | |||
lv_i_msgty | TYPE SY-MSGTY. " |
  CALL FUNCTION 'CNACL_USER_RIGHTS_GET' "Get the rights of teh user for an object |
EXPORTING | ||
I_USER_NAME | = lv_i_user_name | |
I_SMSG_ON | = lv_i_smsg_on | |
I_SMSG_ZEILE | = lv_i_smsg_zeile | |
I_OBJNR1 | = lv_i_objnr1 | |
I_MLST | = lv_i_mlst | |
I_PRPS | = lv_i_prps | |
I_PROJ | = lv_i_proj | |
I_AFVGD | = lv_i_afvgd | |
I_CAUFV | = lv_i_caufv | |
I_MULTI | = lv_i_multi | |
I_MSGTY | = lv_i_msgty | |
CHANGING | ||
C_DISPLAY | = lv_c_display | |
C_CHANGE | = lv_c_change | |
C_ACT_TYPE | = lv_c_act_type | |
EXCEPTIONS | ||
NO_ACL = 1 | ||
ACL_INACTIVE = 2 | ||
USER_NOT_FOUND = 3 | ||
. " CNACL_USER_RIGHTS_GET |
ABAP code using 7.40 inline data declarations to call FM CNACL_USER_RIGHTS_GET
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."SELECT single UNAME FROM SY INTO @DATA(ld_i_user_name). | ||||
"SELECT single MARK FROM RCJ_MARKL INTO @DATA(ld_i_smsg_on). | ||||
"SELECT single ZEILE FROM MESG INTO @DATA(ld_i_smsg_zeile). | ||||
DATA(ld_i_smsg_zeile) | = '000'. | |||
"SELECT single MSGTY FROM SY INTO @DATA(ld_i_msgty). | ||||
Search for further information about these or an SAP related objects