SAP KCR02_POST_ACTIVITY_ALLOCATION Function Module for NOTRANSL: Leistungsverrechnung buchen
KCR02_POST_ACTIVITY_ALLOCATION is a standard kcr02 post activity allocation 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: Leistungsverrechnung buchen 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 kcr02 post activity allocation FM, simply by entering the name KCR02_POST_ACTIVITY_ALLOCATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: KCR02
Program Name: SAPLKCR02
Main Program: SAPLKCR02
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function KCR02_POST_ACTIVITY_ALLOCATION 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 'KCR02_POST_ACTIVITY_ALLOCATION'"NOTRANSL: Leistungsverrechnung buchen.
EXPORTING
I_RESOURCE_GUID = "Internal Description (Company ID Number) of Resource
I_MODE_GUID = "GUID for a Mode
I_MODE_CHANGE_NUMBER = "Change Number
I_MODE_COUNT = "Counter for a Mode
I_ORDER = "Order Number
I_POST_DATE = "Posting Date
I_QUANTITY = "Activity Quantity
I_UNIT = "Activity unit
IMPORTING
E_DOCUMENT_NUMBER = "Document Number
TABLES
E_RETURN = "Return Parameter
EXCEPTIONS
MESSAGE_OCCURED = 1
IMPORTING Parameters details for KCR02_POST_ACTIVITY_ALLOCATION
I_RESOURCE_GUID - Internal Description (Company ID Number) of Resource
Data type: PPC_RESGUIDOptional: No
Call by Reference: No ( called with pass by value option)
I_MODE_GUID - GUID for a Mode
Data type: PPC_MODE_GUIDOptional: No
Call by Reference: No ( called with pass by value option)
I_MODE_CHANGE_NUMBER - Change Number
Data type: AENNROptional: No
Call by Reference: No ( called with pass by value option)
I_MODE_COUNT - Counter for a Mode
Data type: PPC_MODE_COUNTOptional: No
Call by Reference: No ( called with pass by value option)
I_ORDER - Order Number
Data type: AUFNROptional: No
Call by Reference: No ( called with pass by value option)
I_POST_DATE - Posting Date
Data type: CO_BUDATOptional: No
Call by Reference: No ( called with pass by value option)
I_QUANTITY - Activity Quantity
Data type: LSTXXOptional: No
Call by Reference: No ( called with pass by value option)
I_UNIT - Activity unit
Data type: CO_MEINH_LOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for KCR02_POST_ACTIVITY_ALLOCATION
E_DOCUMENT_NUMBER - Document Number
Data type: CO_BELNROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for KCR02_POST_ACTIVITY_ALLOCATION
E_RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: Yes
EXCEPTIONS details
MESSAGE_OCCURED - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for KCR02_POST_ACTIVITY_ALLOCATION 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: | ||||
| lt_e_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_i_resource_guid | TYPE PPC_RESGUID, " | |||
| lv_message_occured | TYPE PPC_RESGUID, " | |||
| lv_e_document_number | TYPE CO_BELNR, " | |||
| lv_i_mode_guid | TYPE PPC_MODE_GUID, " | |||
| lv_i_mode_change_number | TYPE AENNR, " | |||
| lv_i_mode_count | TYPE PPC_MODE_COUNT, " | |||
| lv_i_order | TYPE AUFNR, " | |||
| lv_i_post_date | TYPE CO_BUDAT, " | |||
| lv_i_quantity | TYPE LSTXX, " | |||
| lv_i_unit | TYPE CO_MEINH_L. " |
|   CALL FUNCTION 'KCR02_POST_ACTIVITY_ALLOCATION' "NOTRANSL: Leistungsverrechnung buchen |
| EXPORTING | ||
| I_RESOURCE_GUID | = lv_i_resource_guid | |
| I_MODE_GUID | = lv_i_mode_guid | |
| I_MODE_CHANGE_NUMBER | = lv_i_mode_change_number | |
| I_MODE_COUNT | = lv_i_mode_count | |
| I_ORDER | = lv_i_order | |
| I_POST_DATE | = lv_i_post_date | |
| I_QUANTITY | = lv_i_quantity | |
| I_UNIT | = lv_i_unit | |
| IMPORTING | ||
| E_DOCUMENT_NUMBER | = lv_e_document_number | |
| TABLES | ||
| E_RETURN | = lt_e_return | |
| EXCEPTIONS | ||
| MESSAGE_OCCURED = 1 | ||
| . " KCR02_POST_ACTIVITY_ALLOCATION | ||
ABAP code using 7.40 inline data declarations to call FM KCR02_POST_ACTIVITY_ALLOCATION
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.Search for further information about these or an SAP related objects