SAP UJ0_CREATE_SINGLE_ROLE Function Module for Create single active group role
UJ0_CREATE_SINGLE_ROLE is a standard uj0 create single role SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create single active group role 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 uj0 create single role FM, simply by entering the name UJ0_CREATE_SINGLE_ROLE into the relevant SAP transaction such as SE37 or SE38.
Function Group: UJ0_NW_API
Program Name: SAPLUJ0_NW_API
Main Program: SAPLUJ0_NW_API
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function UJ0_CREATE_SINGLE_ROLE 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 'UJ0_CREATE_SINGLE_ROLE'"Create single active group role.
EXPORTING
IV_PREF_AGR_NAME = "Abgekürzter Rollenname
* IV_NAME_PREFIX = '' "Rolle: Namenspräfix
IT_ROLE_AUTHS = "Rollenberechtigungen
* IF_SERVICE_USER = ABAP_TRUE "BPC: Generic indicator
* IV_COMMENT_TEXT_1 = ' ' "Role name
* IV_COMMENT_TEXT_2 = ' ' "Role name
* IV_COMMENT_TEXT_3 = ' ' "Role name
* IV_COMMENT_TEXT_4 = ' ' "Role name
IMPORTING
ET_MESSAGES = "Tabelle mit BAPI Return Informationen
IMPORTING Parameters details for UJ0_CREATE_SINGLE_ROLE
IV_PREF_AGR_NAME - Abgekürzter Rollenname
Data type: PREFIXED_AGR_NAMEOptional: No
Call by Reference: No ( called with pass by value option)
IV_NAME_PREFIX - Rolle: Namenspräfix
Data type: AGR_PREFIXDefault: ''
Optional: Yes
Call by Reference: No ( called with pass by value option)
IT_ROLE_AUTHS - Rollenberechtigungen
Data type: ROLE_AUTHORIZATIONSOptional: No
Call by Reference: No ( called with pass by value option)
IF_SERVICE_USER - BPC: Generic indicator
Data type: UJ_FLGDefault: ABAP_TRUE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMENT_TEXT_1 - Role name
Data type: AGR_TEXTS-TEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMENT_TEXT_2 - Role name
Data type: AGR_TEXTS-TEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMENT_TEXT_3 - Role name
Data type: AGR_TEXTS-TEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMENT_TEXT_4 - Role name
Data type: AGR_TEXTS-TEXTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for UJ0_CREATE_SINGLE_ROLE
ET_MESSAGES - Tabelle mit BAPI Return Informationen
Data type: BAPIRETTABOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for UJ0_CREATE_SINGLE_ROLE 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_et_messages | TYPE BAPIRETTAB, " | |||
| lv_iv_pref_agr_name | TYPE PREFIXED_AGR_NAME, " | |||
| lv_iv_name_prefix | TYPE AGR_PREFIX, " '' | |||
| lv_it_role_auths | TYPE ROLE_AUTHORIZATIONS, " | |||
| lv_if_service_user | TYPE UJ_FLG, " ABAP_TRUE | |||
| lv_iv_comment_text_1 | TYPE AGR_TEXTS-TEXT, " SPACE | |||
| lv_iv_comment_text_2 | TYPE AGR_TEXTS-TEXT, " SPACE | |||
| lv_iv_comment_text_3 | TYPE AGR_TEXTS-TEXT, " SPACE | |||
| lv_iv_comment_text_4 | TYPE AGR_TEXTS-TEXT. " SPACE |
|   CALL FUNCTION 'UJ0_CREATE_SINGLE_ROLE' "Create single active group role |
| EXPORTING | ||
| IV_PREF_AGR_NAME | = lv_iv_pref_agr_name | |
| IV_NAME_PREFIX | = lv_iv_name_prefix | |
| IT_ROLE_AUTHS | = lv_it_role_auths | |
| IF_SERVICE_USER | = lv_if_service_user | |
| IV_COMMENT_TEXT_1 | = lv_iv_comment_text_1 | |
| IV_COMMENT_TEXT_2 | = lv_iv_comment_text_2 | |
| IV_COMMENT_TEXT_3 | = lv_iv_comment_text_3 | |
| IV_COMMENT_TEXT_4 | = lv_iv_comment_text_4 | |
| IMPORTING | ||
| ET_MESSAGES | = lv_et_messages | |
| . " UJ0_CREATE_SINGLE_ROLE | ||
ABAP code using 7.40 inline data declarations to call FM UJ0_CREATE_SINGLE_ROLE
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.| DATA(ld_iv_name_prefix) | = ''. | |||
| DATA(ld_if_service_user) | = ABAP_TRUE. | |||
| "SELECT single TEXT FROM AGR_TEXTS INTO @DATA(ld_iv_comment_text_1). | ||||
| DATA(ld_iv_comment_text_1) | = ' '. | |||
| "SELECT single TEXT FROM AGR_TEXTS INTO @DATA(ld_iv_comment_text_2). | ||||
| DATA(ld_iv_comment_text_2) | = ' '. | |||
| "SELECT single TEXT FROM AGR_TEXTS INTO @DATA(ld_iv_comment_text_3). | ||||
| DATA(ld_iv_comment_text_3) | = ' '. | |||
| "SELECT single TEXT FROM AGR_TEXTS INTO @DATA(ld_iv_comment_text_4). | ||||
| DATA(ld_iv_comment_text_4) | = ' '. | |||
Search for further information about these or an SAP related objects