SAP K_ITERATION_GENERATE Function Module for _









K_ITERATION_GENERATE is a standard k iteration generate SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for _ 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 k iteration generate FM, simply by entering the name K_ITERATION_GENERATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: KAIT
Program Name: SAPLKAIT
Main Program:
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function K_ITERATION_GENERATE 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_ITERATION_GENERATE'"_
EXPORTING
* COUNT_BASGR = 1 "
* DECIMALS = ' ' "
* WITH_TRANSPORT = ' ' "
* COUNT_FLDGR = 1 "Number of field groups to be processed in parallel
* COUNT_PERIO = 1 "Number of periods
INCLUDE_DATA = "Name of the include to be generated for data
* LENGTH_BASE = '16' "Length of the sender base fields (for type P)
* LENGTH_VALUE = '8' "Length of the value fields (for type P)
* OCCURS_ITTAB1 = '0' "Occurs parameter table 1
* OCCURS_ITTAB2 = '0' "Occurs parameter table 2
* TYPE = 'P' "ABAP type of the value field (P,F,I)
.



IMPORTING Parameters details for K_ITERATION_GENERATE

COUNT_BASGR -

Data type: SY-INDEX
Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)

DECIMALS -

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_TRANSPORT -

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

COUNT_FLDGR - Number of field groups to be processed in parallel

Data type: SY-INDEX
Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)

COUNT_PERIO - Number of periods

Data type: SY-INDEX
Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)

INCLUDE_DATA - Name of the include to be generated for data

Data type: SY-REPID
Optional: No
Call by Reference: No ( called with pass by value option)

LENGTH_BASE - Length of the sender base fields (for type P)

Data type:
Default: '16'
Optional: Yes
Call by Reference: No ( called with pass by value option)

LENGTH_VALUE - Length of the value fields (for type P)

Data type:
Default: '8'
Optional: Yes
Call by Reference: No ( called with pass by value option)

OCCURS_ITTAB1 - Occurs parameter table 1

Data type:
Default: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)

OCCURS_ITTAB2 - Occurs parameter table 2

Data type:
Default: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TYPE - ABAP type of the value field (P,F,I)

Data type:
Default: 'P'
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for K_ITERATION_GENERATE 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_count_basgr  TYPE SY-INDEX, "   1
lv_decimals  TYPE SY, "   ' '
lv_with_transport  TYPE SY, "   ' '
lv_count_fldgr  TYPE SY-INDEX, "   1
lv_count_perio  TYPE SY-INDEX, "   1
lv_include_data  TYPE SY-REPID, "   
lv_length_base  TYPE SY, "   '16'
lv_length_value  TYPE SY, "   '8'
lv_occurs_ittab1  TYPE SY, "   '0'
lv_occurs_ittab2  TYPE SY, "   '0'
lv_type  TYPE SY. "   'P'

  CALL FUNCTION 'K_ITERATION_GENERATE'  "_
    EXPORTING
         COUNT_BASGR = lv_count_basgr
         DECIMALS = lv_decimals
         WITH_TRANSPORT = lv_with_transport
         COUNT_FLDGR = lv_count_fldgr
         COUNT_PERIO = lv_count_perio
         INCLUDE_DATA = lv_include_data
         LENGTH_BASE = lv_length_base
         LENGTH_VALUE = lv_length_value
         OCCURS_ITTAB1 = lv_occurs_ittab1
         OCCURS_ITTAB2 = lv_occurs_ittab2
         TYPE = lv_type
. " K_ITERATION_GENERATE




ABAP code using 7.40 inline data declarations to call FM K_ITERATION_GENERATE

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 INDEX FROM SY INTO @DATA(ld_count_basgr).
DATA(ld_count_basgr) = 1.
 
DATA(ld_decimals) = ' '.
 
DATA(ld_with_transport) = ' '.
 
"SELECT single INDEX FROM SY INTO @DATA(ld_count_fldgr).
DATA(ld_count_fldgr) = 1.
 
"SELECT single INDEX FROM SY INTO @DATA(ld_count_perio).
DATA(ld_count_perio) = 1.
 
"SELECT single REPID FROM SY INTO @DATA(ld_include_data).
 
DATA(ld_length_base) = '16'.
 
DATA(ld_length_value) = '8'.
 
DATA(ld_occurs_ittab1) = '0'.
 
DATA(ld_occurs_ittab2) = '0'.
 
DATA(ld_type) = 'P'.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!