SAP RSEC_RUN_MIGRATION Function Module for Executes Migration
RSEC_RUN_MIGRATION is a standard rsec run migration SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Executes Migration 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 rsec run migration FM, simply by entering the name RSEC_RUN_MIGRATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: RSEC_MIGRATION
Program Name: SAPLRSEC_MIGRATION
Main Program: SAPLRSEC_MIGRATION
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RSEC_RUN_MIGRATION 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 'RSEC_RUN_MIGRATION'"Executes Migration.
EXPORTING
I_T_USERS = "User Master Authorizations
* I_INSERT_SPECIALS = RS_C_TRUE "Insert Special Characteristics into Authorizations
* I_INSERT_AGGR = ':' "Also Insert 'Everything' (Asterisk) or Aggr. Authorization (Colon)
* I_USERS = G_C_USERS-ALL "All Users in List (ALL) or Selected Users Only (F4)
I_T_AUTHOBJECTS = "Authorization Objects for Migration
* I_METHOD = G_C_METHOD-DIRECT "Assignment Method: Direct or Using Roles/Profiles
* I_S_AFFECTED_CHARS = "Structure for the Characteristics to Be Migrated
* I_APPL_LOG_TITLE = "Application Log: External ID
* I_DETLEVEL = '1' "Application Log: Level of Detail
* I_DISPLAY_LOG = RS_C_TRUE "Display log immediately?
* I_INTERACTIVE = RS_C_FALSE "Issue messages (popups) or not
EXCEPTIONS
MIGRATION_FAILED = 1 NOTHING_TO_DO = 2 NOT_AUTHORIZED = 3
IMPORTING Parameters details for RSEC_RUN_MIGRATION
I_T_USERS - User Master Authorizations
Data type: RSEC_T_USERSOptional: No
Call by Reference: Yes
I_INSERT_SPECIALS - Insert Special Characteristics into Authorizations
Data type: RS_BOOLDefault: RS_C_TRUE
Optional: Yes
Call by Reference: Yes
I_INSERT_AGGR - Also Insert 'Everything' (Asterisk) or Aggr. Authorization (Colon)
Data type: CDefault: ':'
Optional: Yes
Call by Reference: Yes
I_USERS - All Users in List (ALL) or Selected Users Only (F4)
Data type: CDefault: G_C_USERS-ALL
Optional: Yes
Call by Reference: Yes
I_T_AUTHOBJECTS - Authorization Objects for Migration
Data type: RSEC_T_RSROBJECTOptional: No
Call by Reference: Yes
I_METHOD - Assignment Method: Direct or Using Roles/Profiles
Data type: CDefault: G_C_METHOD-DIRECT
Optional: Yes
Call by Reference: Yes
I_S_AFFECTED_CHARS - Structure for the Characteristics to Be Migrated
Data type: RSEC_S_A__BOptional: Yes
Call by Reference: Yes
I_APPL_LOG_TITLE - Application Log: External ID
Data type: BAL_S_LOG-EXTNUMBEROptional: Yes
Call by Reference: Yes
I_DETLEVEL - Application Log: Level of Detail
Data type: BAL_S_MSG-DETLEVELDefault: '1'
Optional: Yes
Call by Reference: Yes
I_DISPLAY_LOG - Display log immediately?
Data type: RS_BOOLDefault: RS_C_TRUE
Optional: Yes
Call by Reference: Yes
I_INTERACTIVE - Issue messages (popups) or not
Data type: RS_BOOLDefault: RS_C_FALSE
Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
MIGRATION_FAILED - Migration Failed
Data type:Optional: No
Call by Reference: Yes
NOTHING_TO_DO - No relevant data found for migration
Data type:Optional: No
Call by Reference: Yes
NOT_AUTHORIZED - Insufficient authorization for all users, profiles, and so on
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RSEC_RUN_MIGRATION 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_t_users | TYPE RSEC_T_USERS, " | |||
| lv_migration_failed | TYPE RSEC_T_USERS, " | |||
| lv_i_insert_specials | TYPE RS_BOOL, " RS_C_TRUE | |||
| lv_i_insert_aggr | TYPE C, " ':' | |||
| lv_i_users | TYPE C, " G_C_USERS-ALL | |||
| lv_nothing_to_do | TYPE C, " | |||
| lv_not_authorized | TYPE C, " | |||
| lv_i_t_authobjects | TYPE RSEC_T_RSROBJECT, " | |||
| lv_i_method | TYPE C, " G_C_METHOD-DIRECT | |||
| lv_i_s_affected_chars | TYPE RSEC_S_A__B, " | |||
| lv_i_appl_log_title | TYPE BAL_S_LOG-EXTNUMBER, " | |||
| lv_i_detlevel | TYPE BAL_S_MSG-DETLEVEL, " '1' | |||
| lv_i_display_log | TYPE RS_BOOL, " RS_C_TRUE | |||
| lv_i_interactive | TYPE RS_BOOL. " RS_C_FALSE |
|   CALL FUNCTION 'RSEC_RUN_MIGRATION' "Executes Migration |
| EXPORTING | ||
| I_T_USERS | = lv_i_t_users | |
| I_INSERT_SPECIALS | = lv_i_insert_specials | |
| I_INSERT_AGGR | = lv_i_insert_aggr | |
| I_USERS | = lv_i_users | |
| I_T_AUTHOBJECTS | = lv_i_t_authobjects | |
| I_METHOD | = lv_i_method | |
| I_S_AFFECTED_CHARS | = lv_i_s_affected_chars | |
| I_APPL_LOG_TITLE | = lv_i_appl_log_title | |
| I_DETLEVEL | = lv_i_detlevel | |
| I_DISPLAY_LOG | = lv_i_display_log | |
| I_INTERACTIVE | = lv_i_interactive | |
| EXCEPTIONS | ||
| MIGRATION_FAILED = 1 | ||
| NOTHING_TO_DO = 2 | ||
| NOT_AUTHORIZED = 3 | ||
| . " RSEC_RUN_MIGRATION | ||
ABAP code using 7.40 inline data declarations to call FM RSEC_RUN_MIGRATION
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_i_insert_specials) | = RS_C_TRUE. | |||
| DATA(ld_i_insert_aggr) | = ':'. | |||
| DATA(ld_i_users) | = G_C_USERS-ALL. | |||
| DATA(ld_i_method) | = G_C_METHOD-DIRECT. | |||
| "SELECT single EXTNUMBER FROM BAL_S_LOG INTO @DATA(ld_i_appl_log_title). | ||||
| "SELECT single DETLEVEL FROM BAL_S_MSG INTO @DATA(ld_i_detlevel). | ||||
| DATA(ld_i_detlevel) | = '1'. | |||
| DATA(ld_i_display_log) | = RS_C_TRUE. | |||
| DATA(ld_i_interactive) | = RS_C_FALSE. | |||
Search for further information about these or an SAP related objects