SAP COTB_HIERACHY_RESOLVE2 Function Module for









COTB_HIERACHY_RESOLVE2 is a standard cotb hierachy resolve2 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 cotb hierachy resolve2 FM, simply by entering the name COTB_HIERACHY_RESOLVE2 into the relevant SAP transaction such as SE37 or SE38.

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



Function COTB_HIERACHY_RESOLVE2 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 'COTB_HIERACHY_RESOLVE2'"
EXPORTING
* VALUE = "
* START_GROUP = "
* HIERACHY = "
* FIELD = "
* KOKRS = "
* INIT_FLAG = "

IMPORTING
GROUP = "

EXCEPTIONS
TOP_NODE_REACHED = 1 WRONG_INITIALIZATION = 2 WRONG_HIERARCHY_NAME = 3 SET_NOT_IMPORTED = 4 VALUE_NOT_IN_GROUP = 5 GROUP_NOT_FOUND = 6 START_GROUP_NOT_FOUND = 7
.



IMPORTING Parameters details for COTB_HIERACHY_RESOLVE2

VALUE -

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

START_GROUP -

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

HIERACHY -

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

FIELD -

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

KOKRS -

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

INIT_FLAG -

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

EXPORTING Parameters details for COTB_HIERACHY_RESOLVE2

GROUP -

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

EXCEPTIONS details

TOP_NODE_REACHED -

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

WRONG_INITIALIZATION -

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

WRONG_HIERARCHY_NAME -

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

SET_NOT_IMPORTED -

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

VALUE_NOT_IN_GROUP -

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

GROUP_NOT_FOUND -

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

START_GROUP_NOT_FOUND -

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

Copy and paste ABAP code example for COTB_HIERACHY_RESOLVE2 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_group  TYPE SETHIER-SETID, "   
lv_value  TYPE SETLEAF-VALFROM, "   
lv_top_node_reached  TYPE SETLEAF, "   
lv_start_group  TYPE SETHIER-SETID, "   
lv_wrong_initialization  TYPE SETHIER, "   
lv_hierachy  TYPE SETHIER-SETID, "   
lv_wrong_hierarchy_name  TYPE SETHIER, "   
lv_field  TYPE SETHEADER-FIELDNAME, "   
lv_set_not_imported  TYPE SETHEADER, "   
lv_kokrs  TYPE SETHIER-KOKRS, "   
lv_value_not_in_group  TYPE SETHIER, "   
lv_init_flag  TYPE SETHIER, "   
lv_group_not_found  TYPE SETHIER, "   
lv_start_group_not_found  TYPE SETHIER. "   

  CALL FUNCTION 'COTB_HIERACHY_RESOLVE2'  "
    EXPORTING
         VALUE = lv_value
         START_GROUP = lv_start_group
         HIERACHY = lv_hierachy
         FIELD = lv_field
         KOKRS = lv_kokrs
         INIT_FLAG = lv_init_flag
    IMPORTING
         GROUP = lv_group
    EXCEPTIONS
        TOP_NODE_REACHED = 1
        WRONG_INITIALIZATION = 2
        WRONG_HIERARCHY_NAME = 3
        SET_NOT_IMPORTED = 4
        VALUE_NOT_IN_GROUP = 5
        GROUP_NOT_FOUND = 6
        START_GROUP_NOT_FOUND = 7
. " COTB_HIERACHY_RESOLVE2




ABAP code using 7.40 inline data declarations to call FM COTB_HIERACHY_RESOLVE2

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 SETID FROM SETHIER INTO @DATA(ld_group).
 
"SELECT single VALFROM FROM SETLEAF INTO @DATA(ld_value).
 
 
"SELECT single SETID FROM SETHIER INTO @DATA(ld_start_group).
 
 
"SELECT single SETID FROM SETHIER INTO @DATA(ld_hierachy).
 
 
"SELECT single FIELDNAME FROM SETHEADER INTO @DATA(ld_field).
 
 
"SELECT single KOKRS FROM SETHIER INTO @DATA(ld_kokrs).
 
 
 
 
 


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!