SAP CUFA_FUNCTION_PREPARE Function Module for
CUFA_FUNCTION_PREPARE is a standard cufa function prepare SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 cufa function prepare FM, simply by entering the name CUFA_FUNCTION_PREPARE into the relevant SAP transaction such as SE37 or SE38.
Function Group: CUFA
Program Name: SAPLCUFA
Main Program: SAPLCUFA
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CUFA_FUNCTION_PREPARE 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 'CUFA_FUNCTION_PREPARE'".
EXPORTING
CUFA_FUNCTION_NAME = "Function Name
* CUFA_MAINTAIN_FUNCTION = ' ' "
* CUFA_ENQUEUE_FUNCTION = 'X' "
* CUFA_DATE = SY-DATUM "Date
IMPORTING
CUFA_FUNCTION_EXISTS = "
EXCEPTIONS
ENQUEUE_FAIL = 1 FUNCTION_NAME_INCORRECT = 2 FUNCTION_WORK_COMMITTED = 3 NO_AUTHORITY_VAR_FUNCTIONS = 4 FUNCTION_NO_AUTHORITY = 5 FUNCTION_NOT_FOUND = 6
IMPORTING Parameters details for CUFA_FUNCTION_PREPARE
CUFA_FUNCTION_NAME - Function Name
Data type: RCUFU-FUNCTOptional: No
Call by Reference: No ( called with pass by value option)
CUFA_MAINTAIN_FUNCTION -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CUFA_ENQUEUE_FUNCTION -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
CUFA_DATE - Date
Data type: CABN-DATUVDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CUFA_FUNCTION_PREPARE
CUFA_FUNCTION_EXISTS -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ENQUEUE_FAIL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FUNCTION_NAME_INCORRECT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FUNCTION_WORK_COMMITTED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY_VAR_FUNCTIONS - You are not authorized to maintain functions
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FUNCTION_NO_AUTHORITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FUNCTION_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CUFA_FUNCTION_PREPARE 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_enqueue_fail | TYPE STRING, " | |||
| lv_cufa_function_name | TYPE RCUFU-FUNCT, " | |||
| lv_cufa_function_exists | TYPE C, " | |||
| lv_cufa_maintain_function | TYPE C, " SPACE | |||
| lv_function_name_incorrect | TYPE C, " | |||
| lv_cufa_enqueue_function | TYPE C, " 'X' | |||
| lv_function_work_committed | TYPE C, " | |||
| lv_cufa_date | TYPE CABN-DATUV, " SY-DATUM | |||
| lv_no_authority_var_functions | TYPE CABN, " | |||
| lv_function_no_authority | TYPE CABN, " | |||
| lv_function_not_found | TYPE CABN. " |
|   CALL FUNCTION 'CUFA_FUNCTION_PREPARE' " |
| EXPORTING | ||
| CUFA_FUNCTION_NAME | = lv_cufa_function_name | |
| CUFA_MAINTAIN_FUNCTION | = lv_cufa_maintain_function | |
| CUFA_ENQUEUE_FUNCTION | = lv_cufa_enqueue_function | |
| CUFA_DATE | = lv_cufa_date | |
| IMPORTING | ||
| CUFA_FUNCTION_EXISTS | = lv_cufa_function_exists | |
| EXCEPTIONS | ||
| ENQUEUE_FAIL = 1 | ||
| FUNCTION_NAME_INCORRECT = 2 | ||
| FUNCTION_WORK_COMMITTED = 3 | ||
| NO_AUTHORITY_VAR_FUNCTIONS = 4 | ||
| FUNCTION_NO_AUTHORITY = 5 | ||
| FUNCTION_NOT_FOUND = 6 | ||
| . " CUFA_FUNCTION_PREPARE | ||
ABAP code using 7.40 inline data declarations to call FM CUFA_FUNCTION_PREPARE
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 FUNCT FROM RCUFU INTO @DATA(ld_cufa_function_name). | ||||
| DATA(ld_cufa_maintain_function) | = ' '. | |||
| DATA(ld_cufa_enqueue_function) | = 'X'. | |||
| "SELECT single DATUV FROM CABN INTO @DATA(ld_cufa_date). | ||||
| DATA(ld_cufa_date) | = SY-DATUM. | |||
Search for further information about these or an SAP related objects