SAP CR_CAPACITY_READ Function Module for NOTRANSL: Lesen Kapazität
CR_CAPACITY_READ is a standard cr capacity read 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: Lesen Kapazität 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 cr capacity read FM, simply by entering the name CR_CAPACITY_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: CRK1
Program Name: SAPLCRK1
Main Program: SAPLCRK1
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CR_CAPACITY_READ 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 'CR_CAPACITY_READ'"NOTRANSL: Lesen Kapazität.
EXPORTING
* ARBID = '00000000' "Work center ID
* ARBPL = ' ' "Name of work center
* KAPAR = ' ' "Capacity category
* KAPID = '00000000' "Capacity ID
* MSGTY = 'E' "Message Type
* NAME = ' ' "Capacity name
* REQ_RCRKK = 'X' "request view with structure RCRKK
* WERKS = ' ' "Plant
* TC26D_READ = "
IMPORTING
EKAKO = "Capacity header data
NUMBERS = "No. of individual capacities of standard available capacity
WORKS = "Interface
EXCEPTIONS
MISSING_PARAMETERS = 1 NOT_FOUND = 2
IMPORTING Parameters details for CR_CAPACITY_READ
ARBID - Work center ID
Data type: CRHD-OBJIDDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ARBPL - Name of work center
Data type: CRHD-ARBPLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KAPAR - Capacity category
Data type: KAKO-KAPARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KAPID - Capacity ID
Data type: KAKO-KAPIDDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGTY - Message Type
Data type: SY-MSGTYDefault: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NAME - Capacity name
Data type: KAKO-NAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REQ_RCRKK - request view with structure RCRKK
Data type: FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WERKS - Plant
Data type: KAKO-WERKSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TC26D_READ -
Data type: SY-DATAROptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CR_CAPACITY_READ
EKAKO - Capacity header data
Data type: KAKOOptional: No
Call by Reference: No ( called with pass by value option)
NUMBERS - No. of individual capacities of standard available capacity
Data type: SPLITTANZOptional: No
Call by Reference: No ( called with pass by value option)
WORKS - Interface
Data type: RCRKKOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
MISSING_PARAMETERS - Missing IMPORT parameters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND - Capacity not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CR_CAPACITY_READ 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_arbid | TYPE CRHD-OBJID, " '00000000' | |||
| lv_ekako | TYPE KAKO, " | |||
| lv_missing_parameters | TYPE KAKO, " | |||
| lv_arbpl | TYPE CRHD-ARBPL, " SPACE | |||
| lv_numbers | TYPE SPLITTANZ, " | |||
| lv_not_found | TYPE SPLITTANZ, " | |||
| lv_kapar | TYPE KAKO-KAPAR, " SPACE | |||
| lv_works | TYPE RCRKK, " | |||
| lv_kapid | TYPE KAKO-KAPID, " '00000000' | |||
| lv_msgty | TYPE SY-MSGTY, " 'E' | |||
| lv_name | TYPE KAKO-NAME, " SPACE | |||
| lv_req_rcrkk | TYPE FLAG, " 'X' | |||
| lv_werks | TYPE KAKO-WERKS, " SPACE | |||
| lv_tc26d_read | TYPE SY-DATAR. " |
|   CALL FUNCTION 'CR_CAPACITY_READ' "NOTRANSL: Lesen Kapazität |
| EXPORTING | ||
| ARBID | = lv_arbid | |
| ARBPL | = lv_arbpl | |
| KAPAR | = lv_kapar | |
| KAPID | = lv_kapid | |
| MSGTY | = lv_msgty | |
| NAME | = lv_name | |
| REQ_RCRKK | = lv_req_rcrkk | |
| WERKS | = lv_werks | |
| TC26D_READ | = lv_tc26d_read | |
| IMPORTING | ||
| EKAKO | = lv_ekako | |
| NUMBERS | = lv_numbers | |
| WORKS | = lv_works | |
| EXCEPTIONS | ||
| MISSING_PARAMETERS = 1 | ||
| NOT_FOUND = 2 | ||
| . " CR_CAPACITY_READ | ||
ABAP code using 7.40 inline data declarations to call FM CR_CAPACITY_READ
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 OBJID FROM CRHD INTO @DATA(ld_arbid). | ||||
| DATA(ld_arbid) | = '00000000'. | |||
| "SELECT single ARBPL FROM CRHD INTO @DATA(ld_arbpl). | ||||
| DATA(ld_arbpl) | = ' '. | |||
| "SELECT single KAPAR FROM KAKO INTO @DATA(ld_kapar). | ||||
| DATA(ld_kapar) | = ' '. | |||
| "SELECT single KAPID FROM KAKO INTO @DATA(ld_kapid). | ||||
| DATA(ld_kapid) | = '00000000'. | |||
| "SELECT single MSGTY FROM SY INTO @DATA(ld_msgty). | ||||
| DATA(ld_msgty) | = 'E'. | |||
| "SELECT single NAME FROM KAKO INTO @DATA(ld_name). | ||||
| DATA(ld_name) | = ' '. | |||
| DATA(ld_req_rcrkk) | = 'X'. | |||
| "SELECT single WERKS FROM KAKO INTO @DATA(ld_werks). | ||||
| DATA(ld_werks) | = ' '. | |||
| "SELECT single DATAR FROM SY INTO @DATA(ld_tc26d_read). | ||||
Search for further information about these or an SAP related objects