SAP CLFC_BATCH_ALLOCATION_TO_CLASS Function Module for NOTRANSL: Stellt die Klasse zur Verfügung, die verwendet werden 'muß'
CLFC_BATCH_ALLOCATION_TO_CLASS is a standard clfc batch allocation to class SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Stellt die Klasse zur Verfügung, die verwendet werden 'muß' 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 clfc batch allocation to class FM, simply by entering the name CLFC_BATCH_ALLOCATION_TO_CLASS into the relevant SAP transaction such as SE37 or SE38.
Function Group: CLFC
Program Name: SAPLCLFC
Main Program: SAPLCLFC
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CLFC_BATCH_ALLOCATION_TO_CLASS 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 'CLFC_BATCH_ALLOCATION_TO_CLASS'"NOTRANSL: Stellt die Klasse zur Verfügung, die verwendet werden 'muß'.
EXPORTING
MATERIAL = "Material Number
* PLANT = "Plant
* CLASSTYPE = "Class Type
* I_IGNORE_MATMASTER = ' ' "Checkbox
* I_BATCHES_ONLY = "Checkbox
* I_IGNORE_BUFFER = ' ' "Checkbox
IMPORTING
CLASSTYPE = "Class Type
CLASS = "Class number
EXCEPTIONS
NO_CLASS_FOUND = 1 NO_CLASSTYPE_FOUND = 2
IMPORTING Parameters details for CLFC_BATCH_ALLOCATION_TO_CLASS
MATERIAL - Material Number
Data type: MCHA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
PLANT - Plant
Data type: MCHA-WERKSOptional: Yes
Call by Reference: No ( called with pass by value option)
CLASSTYPE - Class Type
Data type: KLAH-KLARTOptional: Yes
Call by Reference: No ( called with pass by value option)
I_IGNORE_MATMASTER - Checkbox
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_BATCHES_ONLY - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: Yes
I_IGNORE_BUFFER - Checkbox
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CLFC_BATCH_ALLOCATION_TO_CLASS
CLASSTYPE - Class Type
Data type: KLAH-KLARTOptional: No
Call by Reference: No ( called with pass by value option)
CLASS - Class number
Data type: KLAH-CLASSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_CLASS_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_CLASSTYPE_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CLFC_BATCH_ALLOCATION_TO_CLASS 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_material | TYPE MCHA-MATNR, " | |||
| lv_classtype | TYPE KLAH-KLART, " | |||
| lv_no_class_found | TYPE KLAH, " | |||
| lv_class | TYPE KLAH-CLASS, " | |||
| lv_plant | TYPE MCHA-WERKS, " | |||
| lv_no_classtype_found | TYPE MCHA, " | |||
| lv_classtype | TYPE KLAH-KLART, " | |||
| lv_i_ignore_matmaster | TYPE XFELD, " SPACE | |||
| lv_i_batches_only | TYPE XFELD, " | |||
| lv_i_ignore_buffer | TYPE XFELD. " SPACE |
|   CALL FUNCTION 'CLFC_BATCH_ALLOCATION_TO_CLASS' "NOTRANSL: Stellt die Klasse zur Verfügung, die verwendet werden 'muß' |
| EXPORTING | ||
| MATERIAL | = lv_material | |
| PLANT | = lv_plant | |
| CLASSTYPE | = lv_classtype | |
| I_IGNORE_MATMASTER | = lv_i_ignore_matmaster | |
| I_BATCHES_ONLY | = lv_i_batches_only | |
| I_IGNORE_BUFFER | = lv_i_ignore_buffer | |
| IMPORTING | ||
| CLASSTYPE | = lv_classtype | |
| CLASS | = lv_class | |
| EXCEPTIONS | ||
| NO_CLASS_FOUND = 1 | ||
| NO_CLASSTYPE_FOUND = 2 | ||
| . " CLFC_BATCH_ALLOCATION_TO_CLASS | ||
ABAP code using 7.40 inline data declarations to call FM CLFC_BATCH_ALLOCATION_TO_CLASS
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 MATNR FROM MCHA INTO @DATA(ld_material). | ||||
| "SELECT single KLART FROM KLAH INTO @DATA(ld_classtype). | ||||
| "SELECT single CLASS FROM KLAH INTO @DATA(ld_class). | ||||
| "SELECT single WERKS FROM MCHA INTO @DATA(ld_plant). | ||||
| "SELECT single KLART FROM KLAH INTO @DATA(ld_classtype). | ||||
| DATA(ld_i_ignore_matmaster) | = ' '. | |||
| DATA(ld_i_ignore_buffer) | = ' '. | |||
Search for further information about these or an SAP related objects