SAP K_KKB_ORDER_TREE Function Module for









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

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



Function K_KKB_ORDER_TREE 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_ORDER_TREE'"
EXPORTING
I_VBELN = "Sales document number
* I_OBJW = ' ' "'X': in object currency
* I_TAB = 'X' "Justifies values to a height
* I_CHOICE_J = 'X' "'X': Dialog box for report group selection
* I_CHOICE_K = 'X' "'X': Dialog box for cost element selection
* I_CHOICE_P = 'X' "'X': Dialog box for report parameters
* I_KST = ' ' "Cost element group for report call
* I_RGJNR = ' ' "Report group for report call
* I_POSNR = "
* I_WINDOW = 'X' "'X': Full screen ' ': Dialog box
* I_BEGROW = 5 "First line of dialog box
* I_BEGCOL = 10 "First column of dialog box
* I_ENDROW = 25 "Last line of dialog box
* I_ENDCOL = 70 "Last column of dialog box
* I_STATUS = '0' "0: Display 1: With plan/act '2':Item pick
* I_ANW = '3' "Application for reporting

IMPORTING
E_POSNR = "Selected item number (with I_STATUS '2')

TABLES
* T_GLOBALS = "Parameter table for report call

EXCEPTIONS
OBJECT_NOT_FOUND = 1
.



IMPORTING Parameters details for K_KKB_ORDER_TREE

I_VBELN - Sales document number

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

I_OBJW - 'X': in object currency

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

I_TAB - Justifies values to a height

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

I_CHOICE_J - 'X': Dialog box for report group selection

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

I_CHOICE_K - 'X': Dialog box for cost element selection

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

I_CHOICE_P - 'X': Dialog box for report parameters

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

I_KST - Cost element group for report call

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

I_RGJNR - Report group for report call

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

I_POSNR -

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

I_WINDOW - 'X': Full screen ' ': Dialog box

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

I_BEGROW - First line of dialog box

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

I_BEGCOL - First column of dialog box

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

I_ENDROW - Last line of dialog box

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

I_ENDCOL - Last column of dialog box

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

I_STATUS - 0: Display 1: With plan/act '2':Item pick

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

I_ANW - Application for reporting

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

EXPORTING Parameters details for K_KKB_ORDER_TREE

E_POSNR - Selected item number (with I_STATUS '2')

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

TABLES Parameters details for K_KKB_ORDER_TREE

T_GLOBALS - Parameter table for report call

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

EXCEPTIONS details

OBJECT_NOT_FOUND - Object not found

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

Copy and paste ABAP code example for K_KKB_ORDER_TREE 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_e_posnr  TYPE STRING, "   
lv_i_vbeln  TYPE VBAP-VBELN, "   
lt_t_globals  TYPE STANDARD TABLE OF KKB2, "   
lv_object_not_found  TYPE KKB2, "   
lv_i_objw  TYPE KKB2, "   ' '
lv_i_tab  TYPE KKB2, "   'X'
lv_i_choice_j  TYPE TKKB1-OBJ, "   'X'
lv_i_choice_k  TYPE TKKB1-OBJ, "   'X'
lv_i_choice_p  TYPE TKKB1-OBJ, "   'X'
lv_i_kst  TYPE TKKB2-KST, "   SPACE
lv_i_rgjnr  TYPE TKKB1-BGR, "   SPACE
lv_i_posnr  TYPE VBAP-POSNR, "   
lv_i_window  TYPE VBAP, "   'X'
lv_i_begrow  TYPE I, "   5
lv_i_begcol  TYPE I, "   10
lv_i_endrow  TYPE I, "   25
lv_i_endcol  TYPE I, "   70
lv_i_status  TYPE I, "   '0'
lv_i_anw  TYPE TKKB1-ANW. "   '3'

  CALL FUNCTION 'K_KKB_ORDER_TREE'  "
    EXPORTING
         I_VBELN = lv_i_vbeln
         I_OBJW = lv_i_objw
         I_TAB = lv_i_tab
         I_CHOICE_J = lv_i_choice_j
         I_CHOICE_K = lv_i_choice_k
         I_CHOICE_P = lv_i_choice_p
         I_KST = lv_i_kst
         I_RGJNR = lv_i_rgjnr
         I_POSNR = lv_i_posnr
         I_WINDOW = lv_i_window
         I_BEGROW = lv_i_begrow
         I_BEGCOL = lv_i_begcol
         I_ENDROW = lv_i_endrow
         I_ENDCOL = lv_i_endcol
         I_STATUS = lv_i_status
         I_ANW = lv_i_anw
    IMPORTING
         E_POSNR = lv_e_posnr
    TABLES
         T_GLOBALS = lt_t_globals
    EXCEPTIONS
        OBJECT_NOT_FOUND = 1
. " K_KKB_ORDER_TREE




ABAP code using 7.40 inline data declarations to call FM K_KKB_ORDER_TREE

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 VBELN FROM VBAP INTO @DATA(ld_i_vbeln).
 
 
 
DATA(ld_i_objw) = ' '.
 
DATA(ld_i_tab) = 'X'.
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_choice_j).
DATA(ld_i_choice_j) = 'X'.
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_choice_k).
DATA(ld_i_choice_k) = 'X'.
 
"SELECT single OBJ FROM TKKB1 INTO @DATA(ld_i_choice_p).
DATA(ld_i_choice_p) = 'X'.
 
"SELECT single KST FROM TKKB2 INTO @DATA(ld_i_kst).
DATA(ld_i_kst) = ' '.
 
"SELECT single BGR FROM TKKB1 INTO @DATA(ld_i_rgjnr).
DATA(ld_i_rgjnr) = ' '.
 
"SELECT single POSNR FROM VBAP INTO @DATA(ld_i_posnr).
 
DATA(ld_i_window) = 'X'.
 
DATA(ld_i_begrow) = 5.
 
DATA(ld_i_begcol) = 10.
 
DATA(ld_i_endrow) = 25.
 
DATA(ld_i_endcol) = 70.
 
DATA(ld_i_status) = '0'.
 
"SELECT single ANW FROM TKKB1 INTO @DATA(ld_i_anw).
DATA(ld_i_anw) = '3'.
 


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!