SAP K_KKB_OR_REPORT_CALL Function Module for









K_KKB_OR_REPORT_CALL is a standard k kkb or report call 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 kkb or report call FM, simply by entering the name K_KKB_OR_REPORT_CALL into the relevant SAP transaction such as SE37 or SE38.

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



Function K_KKB_OR_REPORT_CALL 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_KKB_OR_REPORT_CALL'"
EXPORTING
* AUFNR = ' ' "Order number
KOKRS = "Controlling area
* KST = ' ' "Cost element layout
* POSID = ' ' "WBS element
* RGJNR = ' ' "Report
* PSPID = ' ' "Project
* NETZPLAN = ' ' "Network
* VORGANG = ' ' "Operation
* PAR_FROM_CUST = ' ' "Control parameters through report list
* KDAUF = ' ' "Sales order
* KDPOS = ' ' "Sales order item
* BATCH = ' ' "Background processing yes/no
* POSNR = "
* NINCL = ' ' "Including suborders
* I_TRSTI = "
* I_PCMNR = ' ' "
* I_RW_FORCED = ' ' "Program running in background
* I_PIVOT = "Control Parameters KKBCS
* CHOICE_J = ' ' "Select report yes/no
* CHOICE_K = ' ' "Select cost element layout yes/no
* CHOICE_P = ' ' "Select report parameters yes/no
* IANW = '1' "Application
* I_WITH_HIERARCHY = 'X' "WBS element including subordinate elements
* I_WITH_NETWORK = 'X' "WBS element including allocated activities
* I_WITH_ORDERS = 'X' "WBS element including orders for project

IMPORTING
JOBNAME = "Name of background job

TABLES
* GLOBALS = "Report parameters
* T_EXCTAB = "

EXCEPTIONS
INTERNAL_ERROR = 1 NO_JOB = 2 NO_KST = 3 WRONG_INPUT = 4
.



IMPORTING Parameters details for K_KKB_OR_REPORT_CALL

AUFNR - Order number

Data type: KKBC-AUFNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

KOKRS - Controlling area

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

KST - Cost element layout

Data type: TKKB2-KST
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

POSID - WBS element

Data type: KKB0-POSID
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

RGJNR - Report

Data type: TKKB1-BGR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PSPID - Project

Data type: PROJ-PSPID
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NETZPLAN - Network

Data type: KKB0-AUFNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

VORGANG - Operation

Data type: CCSS-VRGNG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAR_FROM_CUST - Control parameters through report list

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

KDAUF - Sales order

Data type: KKBC-KDAUF
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

KDPOS - Sales order item

Data type: KKBC-KDPOS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

BATCH - Background processing yes/no

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

POSNR -

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

NINCL - Including suborders

Data type: KKBC-NINCL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TRSTI -

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

I_PCMNR -

Data type: KKBC-PCMNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_RW_FORCED - Program running in background

Data type: SYBATCH
Default: SPACE
Optional: Yes
Call by Reference: Yes

I_PIVOT - Control Parameters KKBCS

Data type: KKB_PIVOT
Optional: Yes
Call by Reference: Yes

CHOICE_J - Select report yes/no

Data type: TKKB1-OBJ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHOICE_K - Select cost element layout yes/no

Data type: TKKB1-OBJ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHOICE_P - Select report parameters yes/no

Data type: TKKB1-OBJ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IANW - Application

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

I_WITH_HIERARCHY - WBS element including subordinate elements

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

I_WITH_NETWORK - WBS element including allocated activities

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

I_WITH_ORDERS - WBS element including orders for project

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

EXPORTING Parameters details for K_KKB_OR_REPORT_CALL

JOBNAME - Name of background job

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

TABLES Parameters details for K_KKB_OR_REPORT_CALL

GLOBALS - Report parameters

Data type: KKB2
Optional: Yes
Call by Reference: Yes

T_EXCTAB -

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

EXCEPTIONS details

INTERNAL_ERROR - Internal error occurred

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

NO_JOB - no report available

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

NO_KST - No cost element layout available

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

WRONG_INPUT - Incorrect entry

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

Copy and paste ABAP code example for K_KKB_OR_REPORT_CALL 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_aufnr  TYPE KKBC-AUFNR, "   SPACE
lt_globals  TYPE STANDARD TABLE OF KKB2, "   
lv_jobname  TYPE TBTCO-JOBNAME, "   
lv_internal_error  TYPE TBTCO, "   
lv_kokrs  TYPE KKBC-KOKRS, "   
lv_kst  TYPE TKKB2-KST, "   SPACE
lv_posid  TYPE KKB0-POSID, "   SPACE
lv_rgjnr  TYPE TKKB1-BGR, "   SPACE
lv_pspid  TYPE PROJ-PSPID, "   SPACE
lv_netzplan  TYPE KKB0-AUFNR, "   SPACE
lv_vorgang  TYPE CCSS-VRGNG, "   SPACE
lv_par_from_cust  TYPE CCSS, "   SPACE
lv_kdauf  TYPE KKBC-KDAUF, "   SPACE
lv_kdpos  TYPE KKBC-KDPOS, "   SPACE
lv_batch  TYPE SY-BATCH, "   SPACE
lv_no_job  TYPE SY, "   
lt_t_exctab  TYPE STANDARD TABLE OF KKB_ETAB, "   
lv_posnr  TYPE KKB_ETAB, "   
lv_nincl  TYPE KKBC-NINCL, "   SPACE
lv_i_trsti  TYPE TRSTI, "   
lv_i_pcmnr  TYPE KKBC-PCMNR, "   SPACE
lv_i_rw_forced  TYPE SYBATCH, "   SPACE
lv_i_pivot  TYPE KKB_PIVOT, "   
lv_no_kst  TYPE KKB_PIVOT, "   
lv_choice_j  TYPE TKKB1-OBJ, "   SPACE
lv_choice_k  TYPE TKKB1-OBJ, "   SPACE
lv_wrong_input  TYPE TKKB1, "   
lv_choice_p  TYPE TKKB1-OBJ, "   SPACE
lv_ianw  TYPE TKKB1-ANW, "   '1'
lv_i_with_hierarchy  TYPE RCWBS-SEL01, "   'X'
lv_i_with_network  TYPE RCWBS-SEL01, "   'X'
lv_i_with_orders  TYPE RCWBS-SEL01. "   'X'

  CALL FUNCTION 'K_KKB_OR_REPORT_CALL'  "
    EXPORTING
         AUFNR = lv_aufnr
         KOKRS = lv_kokrs
         KST = lv_kst
         POSID = lv_posid
         RGJNR = lv_rgjnr
         PSPID = lv_pspid
         NETZPLAN = lv_netzplan
         VORGANG = lv_vorgang
         PAR_FROM_CUST = lv_par_from_cust
         KDAUF = lv_kdauf
         KDPOS = lv_kdpos
         BATCH = lv_batch
         POSNR = lv_posnr
         NINCL = lv_nincl
         I_TRSTI = lv_i_trsti
         I_PCMNR = lv_i_pcmnr
         I_RW_FORCED = lv_i_rw_forced
         I_PIVOT = lv_i_pivot
         CHOICE_J = lv_choice_j
         CHOICE_K = lv_choice_k
         CHOICE_P = lv_choice_p
         IANW = lv_ianw
         I_WITH_HIERARCHY = lv_i_with_hierarchy
         I_WITH_NETWORK = lv_i_with_network
         I_WITH_ORDERS = lv_i_with_orders
    IMPORTING
         JOBNAME = lv_jobname
    TABLES
         GLOBALS = lt_globals
         T_EXCTAB = lt_t_exctab
    EXCEPTIONS
        INTERNAL_ERROR = 1
        NO_JOB = 2
        NO_KST = 3
        WRONG_INPUT = 4
. " K_KKB_OR_REPORT_CALL




ABAP code using 7.40 inline data declarations to call FM K_KKB_OR_REPORT_CALL

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 AUFNR FROM KKBC INTO @DATA(ld_aufnr).
DATA(ld_aufnr) = ' '.
 
 
"SELECT single JOBNAME FROM TBTCO INTO @DATA(ld_jobname).
 
 
"SELECT single KOKRS FROM KKBC INTO @DATA(ld_kokrs).
 
"SELECT single KST FROM TKKB2 INTO @DATA(ld_kst).
DATA(ld_kst) = ' '.
 
"SELECT single POSID FROM KKB0 INTO @DATA(ld_posid).
DATA(ld_posid) = ' '.
 
"SELECT single BGR FROM TKKB1 INTO @DATA(ld_rgjnr).
DATA(ld_rgjnr) = ' '.
 
"SELECT single PSPID FROM PROJ INTO @DATA(ld_pspid).
DATA(ld_pspid) = ' '.
 
"SELECT single AUFNR FROM KKB0 INTO @DATA(ld_netzplan).
DATA(ld_netzplan) = ' '.
 
"SELECT single VRGNG FROM CCSS INTO @DATA(ld_vorgang).
DATA(ld_vorgang) = ' '.
 
DATA(ld_par_from_cust) = ' '.
 
"SELECT single KDAUF FROM KKBC INTO @DATA(ld_kdauf).
DATA(ld_kdauf) = ' '.
 
"SELECT single KDPOS FROM KKBC INTO @DATA(ld_kdpos).
DATA(ld_kdpos) = ' '.
 
"SELECT single BATCH FROM SY INTO @DATA(ld_batch).
DATA(ld_batch) = ' '.
 
 
 
 
"SELECT single NINCL FROM KKBC INTO @DATA(ld_nincl).
DATA(ld_nincl) = ' '.
 
 
"SELECT single PCMNR FROM KKBC INTO @DATA(ld_i_pcmnr).
DATA(ld_i_pcmnr) = ' '.
 
DATA(ld_i_rw_forced) = ' '.
 
 
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_choice_j).
DATA(ld_choice_j) = ' '.
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_choice_k).
DATA(ld_choice_k) = ' '.
 
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_choice_p).
DATA(ld_choice_p) = ' '.
 
"SELECT single ANW FROM TKKB1 INTO @DATA(ld_ianw).
DATA(ld_ianw) = '1'.
 
"SELECT single SEL01 FROM RCWBS INTO @DATA(ld_i_with_hierarchy).
DATA(ld_i_with_hierarchy) = 'X'.
 
"SELECT single SEL01 FROM RCWBS INTO @DATA(ld_i_with_network).
DATA(ld_i_with_network) = 'X'.
 
"SELECT single SEL01 FROM RCWBS INTO @DATA(ld_i_with_orders).
DATA(ld_i_with_orders) = 'X'.
 


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!