SAP K_ALLOCATIONS_BATCH Function Module for
K_ALLOCATIONS_BATCH is a standard k allocations batch 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 k allocations batch FM, simply by entering the name K_ALLOCATIONS_BATCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: KGA2
Program Name: SAPLKGA2
Main Program: SAPLKGA2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_ALLOCATIONS_BATCH 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 'K_ALLOCATIONS_BATCH'".
EXPORTING
IRKGA2U = "Transfer structure processing para
PAR_PNAME = "
* IRKGA2P = "
IRKGA2U2 = "
IRKGA2VAR = "
IRKGA2EXT = "
IRKGA2WF = "
* JOBNAME = ' ' "Name of the batch job
* REPORT = 'RKGAL000' "Name of the report to be planned
* REVERSE = ' ' "
* TITLE = "Heading text
TABLES
IT811CT = "Table of the cycles incl. text
IT811S_SEL = "
ITRKGA2H = "
* BPL = "
EXCEPTIONS
NO_CYCLE = 1
IMPORTING Parameters details for K_ALLOCATIONS_BATCH
IRKGA2U - Transfer structure processing para
Data type: RKGA2UOptional: No
Call by Reference: No ( called with pass by value option)
PAR_PNAME -
Data type: TBTCJOB-INTREPORTOptional: No
Call by Reference: No ( called with pass by value option)
IRKGA2P -
Data type: RKGA2POptional: Yes
Call by Reference: No ( called with pass by value option)
IRKGA2U2 -
Data type: RKGA2U2Optional: No
Call by Reference: No ( called with pass by value option)
IRKGA2VAR -
Data type: RKGA2VAROptional: No
Call by Reference: No ( called with pass by value option)
IRKGA2EXT -
Data type: RKGA2EXTOptional: No
Call by Reference: No ( called with pass by value option)
IRKGA2WF -
Data type: RKGA2WFOptional: No
Call by Reference: No ( called with pass by value option)
JOBNAME - Name of the batch job
Data type: TBTCO-JOBNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPORT - Name of the report to be planned
Data type: SY-REPIDDefault: 'RKGAL000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
REVERSE -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TITLE - Heading text
Data type: SY-REPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_ALLOCATIONS_BATCH
IT811CT - Table of the cycles incl. text
Data type: T811CTOptional: No
Call by Reference: No ( called with pass by value option)
IT811S_SEL -
Data type: T811S_SELOptional: No
Call by Reference: No ( called with pass by value option)
ITRKGA2H -
Data type: RKGA2HOptional: No
Call by Reference: No ( called with pass by value option)
BPL -
Data type: RKGABPLOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_CYCLE - Cycle table is empty
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_ALLOCATIONS_BATCH 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_irkga2u | TYPE RKGA2U, " | |||
| lt_it811ct | TYPE STANDARD TABLE OF T811CT, " | |||
| lv_no_cycle | TYPE T811CT, " | |||
| lv_par_pname | TYPE TBTCJOB-INTREPORT, " | |||
| lv_irkga2p | TYPE RKGA2P, " | |||
| lv_irkga2u2 | TYPE RKGA2U2, " | |||
| lt_it811s_sel | TYPE STANDARD TABLE OF T811S_SEL, " | |||
| lt_itrkga2h | TYPE STANDARD TABLE OF RKGA2H, " | |||
| lv_irkga2var | TYPE RKGA2VAR, " | |||
| lt_bpl | TYPE STANDARD TABLE OF RKGABPL, " | |||
| lv_irkga2ext | TYPE RKGA2EXT, " | |||
| lv_irkga2wf | TYPE RKGA2WF, " | |||
| lv_jobname | TYPE TBTCO-JOBNAME, " SPACE | |||
| lv_report | TYPE SY-REPID, " 'RKGAL000' | |||
| lv_reverse | TYPE SY, " SPACE | |||
| lv_title | TYPE SY-REPID. " |
|   CALL FUNCTION 'K_ALLOCATIONS_BATCH' " |
| EXPORTING | ||
| IRKGA2U | = lv_irkga2u | |
| PAR_PNAME | = lv_par_pname | |
| IRKGA2P | = lv_irkga2p | |
| IRKGA2U2 | = lv_irkga2u2 | |
| IRKGA2VAR | = lv_irkga2var | |
| IRKGA2EXT | = lv_irkga2ext | |
| IRKGA2WF | = lv_irkga2wf | |
| JOBNAME | = lv_jobname | |
| REPORT | = lv_report | |
| REVERSE | = lv_reverse | |
| TITLE | = lv_title | |
| TABLES | ||
| IT811CT | = lt_it811ct | |
| IT811S_SEL | = lt_it811s_sel | |
| ITRKGA2H | = lt_itrkga2h | |
| BPL | = lt_bpl | |
| EXCEPTIONS | ||
| NO_CYCLE = 1 | ||
| . " K_ALLOCATIONS_BATCH | ||
ABAP code using 7.40 inline data declarations to call FM K_ALLOCATIONS_BATCH
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 INTREPORT FROM TBTCJOB INTO @DATA(ld_par_pname). | ||||
| "SELECT single JOBNAME FROM TBTCO INTO @DATA(ld_jobname). | ||||
| DATA(ld_jobname) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_report). | ||||
| DATA(ld_report) | = 'RKGAL000'. | |||
| DATA(ld_reverse) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_title). | ||||
Search for further information about these or an SAP related objects