SAP FARR_RAI_SAMPLE_CREATE Function Module for Create Test Data
FARR_RAI_SAMPLE_CREATE is a standard farr rai sample create 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 Test Data 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 farr rai sample create FM, simply by entering the name FARR_RAI_SAMPLE_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: FARR_RAI_SAMPLE
Program Name: SAPLFARR_RAI_SAMPLE
Main Program: SAPLFARR_RAI_SAMPLE
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FARR_RAI_SAMPLE_CREATE 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 'FARR_RAI_SAMPLE_CREATE'"Create Test Data.
EXPORTING
* I_DIALOG = ' ' "Checkbox
* I_CREATE_LOG = 'X' "Checkbox
* I_DEBUG = ' ' "Checkbox
* I_TESTRUN = ' ' "Switch to Simulation Session for Write BAPIs
* I_SAMPLE_PARAMS = "Parameter for sample items
* I_PACKAGE_SIZE = 1000 "Natural Number
* I_PRBCL = '4' "Application log: Message problem class
IMPORTING
ET_RAI0_MI = "Table Type for FARR_S_RAI0_IT_ALL
ET_RAI0_CO = "Table Type for FARR_S_RAI0_CO_ALL
ET_RAI2_MI = "Table Type for FARR_S_RAI0_IT_ALL
ET_RAI2_CO = "Table Type for FARR_S_RAI0_CO_ALL
EXCEPTIONS
NO_CREATION = 1 CX_FARR_MESSAGE = 2
IMPORTING Parameters details for FARR_RAI_SAMPLE_CREATE
I_DIALOG - Checkbox
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CREATE_LOG - Checkbox
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: Yes
I_DEBUG - Checkbox
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_TESTRUN - Switch to Simulation Session for Write BAPIs
Data type: TESTRUNDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_SAMPLE_PARAMS - Parameter for sample items
Data type: FARR_S_RAI_SAMPLE_PARAMSOptional: Yes
Call by Reference: Yes
I_PACKAGE_SIZE - Natural Number
Data type: INT4Default: 1000
Optional: Yes
Call by Reference: Yes
I_PRBCL - Application log: Message problem class
Data type: BALPROBCLDefault: '4'
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for FARR_RAI_SAMPLE_CREATE
ET_RAI0_MI - Table Type for FARR_S_RAI0_IT_ALL
Data type: FARR_TT_RAI0_MI_ALLOptional: No
Call by Reference: Yes
ET_RAI0_CO - Table Type for FARR_S_RAI0_CO_ALL
Data type: FARR_TT_RAI0_CO_ALLOptional: No
Call by Reference: Yes
ET_RAI2_MI - Table Type for FARR_S_RAI0_IT_ALL
Data type: FARR_TT_RAI2_MI_ALLOptional: No
Call by Reference: Yes
ET_RAI2_CO - Table Type for FARR_S_RAI0_CO_ALL
Data type: FARR_TT_RAI2_CO_ALLOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_CREATION -
Data type:Optional: No
Call by Reference: Yes
CX_FARR_MESSAGE -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FARR_RAI_SAMPLE_CREATE 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_dialog | TYPE XFELD, " SPACE | |||
| lv_et_rai0_mi | TYPE FARR_TT_RAI0_MI_ALL, " | |||
| lv_no_creation | TYPE FARR_TT_RAI0_MI_ALL, " | |||
| lv_et_rai0_co | TYPE FARR_TT_RAI0_CO_ALL, " | |||
| lv_i_create_log | TYPE XFELD, " 'X' | |||
| lv_cx_farr_message | TYPE XFELD, " | |||
| lv_i_debug | TYPE XFELD, " SPACE | |||
| lv_et_rai2_mi | TYPE FARR_TT_RAI2_MI_ALL, " | |||
| lv_i_testrun | TYPE TESTRUN, " SPACE | |||
| lv_et_rai2_co | TYPE FARR_TT_RAI2_CO_ALL, " | |||
| lv_i_sample_params | TYPE FARR_S_RAI_SAMPLE_PARAMS, " | |||
| lv_i_package_size | TYPE INT4, " 1000 | |||
| lv_i_prbcl | TYPE BALPROBCL. " '4' |
|   CALL FUNCTION 'FARR_RAI_SAMPLE_CREATE' "Create Test Data |
| EXPORTING | ||
| I_DIALOG | = lv_i_dialog | |
| I_CREATE_LOG | = lv_i_create_log | |
| I_DEBUG | = lv_i_debug | |
| I_TESTRUN | = lv_i_testrun | |
| I_SAMPLE_PARAMS | = lv_i_sample_params | |
| I_PACKAGE_SIZE | = lv_i_package_size | |
| I_PRBCL | = lv_i_prbcl | |
| IMPORTING | ||
| ET_RAI0_MI | = lv_et_rai0_mi | |
| ET_RAI0_CO | = lv_et_rai0_co | |
| ET_RAI2_MI | = lv_et_rai2_mi | |
| ET_RAI2_CO | = lv_et_rai2_co | |
| EXCEPTIONS | ||
| NO_CREATION = 1 | ||
| CX_FARR_MESSAGE = 2 | ||
| . " FARR_RAI_SAMPLE_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM FARR_RAI_SAMPLE_CREATE
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_dialog) | = ' '. | |||
| DATA(ld_i_create_log) | = 'X'. | |||
| DATA(ld_i_debug) | = ' '. | |||
| DATA(ld_i_testrun) | = ' '. | |||
| DATA(ld_i_package_size) | = 1000. | |||
| DATA(ld_i_prbcl) | = '4'. | |||
Search for further information about these or an SAP related objects