SAP CLAF_ALLOCATIONS Function Module for Check Whether Objects or Classes are Assigned to Class
CLAF_ALLOCATIONS is a standard claf allocations SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check Whether Objects or Classes are Assigned to Class 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 claf allocations FM, simply by entering the name CLAF_ALLOCATIONS into the relevant SAP transaction such as SE37 or SE38.
Function Group: CLAF1
Program Name: SAPLCLAF1
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CLAF_ALLOCATIONS 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 'CLAF_ALLOCATIONS'"Check Whether Objects or Classes are Assigned to Class.
EXPORTING
* CLASSNAME = ' ' "Class
* CLASSNUMBER = 0 "Internal Class Number
* CLASSTYPE = "Class Type
* KEY_DATE = SY-DATUM "Valid-From Date
* CHANGE_SERVICE_CLF = 'X' "Classification with Engineering Change Management
* CHANGE_NUMBER = "
* QUICK = "Assignment Check: Quick and Approximate
IMPORTING
ALLOCATION_EXIST = "Assignment Exists
IMPORTING Parameters details for CLAF_ALLOCATIONS
CLASSNAME - Class
Data type: KLAH-CLASSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CLASSNUMBER - Internal Class Number
Data type: KSSK-CLINTOptional: Yes
Call by Reference: No ( called with pass by value option)
CLASSTYPE - Class Type
Data type: KSSK-KLARTOptional: Yes
Call by Reference: No ( called with pass by value option)
KEY_DATE - Valid-From Date
Data type: KSSK-DATUVDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE_SERVICE_CLF - Classification with Engineering Change Management
Data type: TCLA-AEDIEZUORDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE_NUMBER -
Data type: KSSK-AENNROptional: Yes
Call by Reference: No ( called with pass by value option)
QUICK - Assignment Check: Quick and Approximate
Data type: SY-BATCHOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CLAF_ALLOCATIONS
ALLOCATION_EXIST - Assignment Exists
Data type: RMCLM-BASISDOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for CLAF_ALLOCATIONS 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_classname | TYPE KLAH-CLASS, " SPACE | |||
| lv_allocation_exist | TYPE RMCLM-BASISD, " | |||
| lv_classnumber | TYPE KSSK-CLINT, " 0 | |||
| lv_classtype | TYPE KSSK-KLART, " | |||
| lv_key_date | TYPE KSSK-DATUV, " SY-DATUM | |||
| lv_change_service_clf | TYPE TCLA-AEDIEZUORD, " 'X' | |||
| lv_change_number | TYPE KSSK-AENNR, " | |||
| lv_quick | TYPE SY-BATCH. " |
|   CALL FUNCTION 'CLAF_ALLOCATIONS' "Check Whether Objects or Classes are Assigned to Class |
| EXPORTING | ||
| CLASSNAME | = lv_classname | |
| CLASSNUMBER | = lv_classnumber | |
| CLASSTYPE | = lv_classtype | |
| KEY_DATE | = lv_key_date | |
| CHANGE_SERVICE_CLF | = lv_change_service_clf | |
| CHANGE_NUMBER | = lv_change_number | |
| QUICK | = lv_quick | |
| IMPORTING | ||
| ALLOCATION_EXIST | = lv_allocation_exist | |
| . " CLAF_ALLOCATIONS | ||
ABAP code using 7.40 inline data declarations to call FM CLAF_ALLOCATIONS
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 CLASS FROM KLAH INTO @DATA(ld_classname). | ||||
| DATA(ld_classname) | = ' '. | |||
| "SELECT single BASISD FROM RMCLM INTO @DATA(ld_allocation_exist). | ||||
| "SELECT single CLINT FROM KSSK INTO @DATA(ld_classnumber). | ||||
| "SELECT single KLART FROM KSSK INTO @DATA(ld_classtype). | ||||
| "SELECT single DATUV FROM KSSK INTO @DATA(ld_key_date). | ||||
| DATA(ld_key_date) | = SY-DATUM. | |||
| "SELECT single AEDIEZUORD FROM TCLA INTO @DATA(ld_change_service_clf). | ||||
| DATA(ld_change_service_clf) | = 'X'. | |||
| "SELECT single AENNR FROM KSSK INTO @DATA(ld_change_number). | ||||
| "SELECT single BATCH FROM SY INTO @DATA(ld_quick). | ||||
Search for further information about these or an SAP related objects