SAP CC_LS_GET_CLASS_HIER_STRUCTURE Function Module for Explodes the class hierarchy via the CAD interface
CC_LS_GET_CLASS_HIER_STRUCTURE is a standard cc ls get class hier structure SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Explodes the class hierarchy via the CAD interface 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 cc ls get class hier structure FM, simply by entering the name CC_LS_GET_CLASS_HIER_STRUCTURE into the relevant SAP transaction such as SE37 or SE38.
Function Group: CCLS
Program Name: SAPLCCLS
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CC_LS_GET_CLASS_HIER_STRUCTURE 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 'CC_LS_GET_CLASS_HIER_STRUCTURE'"Explodes the class hierarchy via the CAD interface.
EXPORTING
CLASS_NUMBER = "Class
CLASS_TYPE = "Class type
* KEY_DATE = SY-DATUM "Date
* LANGUAGE = SY-LANGU "Language
* LEVELS_DOWN = '0000000001' "Explode: top down
* LEVELS_UP = '0000000000' "Explosion: levels upward
TABLES
CLASS_STRUCTURE = "Table of classes found
EXCEPTIONS
CLASS_INVALID_SIGN = 1 CLASS_IS_ISOLATED = 2 CLASS_NOT_EXIST = 3 CLASS_NOT_VALID = 4 CLASS_NO_PREDECESSOR = 5 CLASS_NO_SUCCESSOR = 6
IMPORTING Parameters details for CC_LS_GET_CLASS_HIER_STRUCTURE
CLASS_NUMBER - Class
Data type: KLAH-CLASSOptional: No
Call by Reference: No ( called with pass by value option)
CLASS_TYPE - Class type
Data type: KLAH-KLARTOptional: No
Call by Reference: No ( called with pass by value option)
KEY_DATE - Date
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
LEVELS_DOWN - Explode: top down
Data type: GHCL-STUFEDefault: '0000000001'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LEVELS_UP - Explosion: levels upward
Data type: GHCL-STUFEDefault: '0000000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CC_LS_GET_CLASS_HIER_STRUCTURE
CLASS_STRUCTURE - Table of classes found
Data type: GHCLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CLASS_INVALID_SIGN - Class contains invalid characters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASS_IS_ISOLATED - Class has no superior or subordinate classes
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASS_NOT_EXIST - Initial class does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASS_NOT_VALID - Date is outside validity period
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASS_NO_PREDECESSOR - Class has no superior class
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASS_NO_SUCCESSOR - Class has no subordinate classes
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CC_LS_GET_CLASS_HIER_STRUCTURE 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_class_number | TYPE KLAH-CLASS, " | |||
| lt_class_structure | TYPE STANDARD TABLE OF GHCL, " | |||
| lv_class_invalid_sign | TYPE GHCL, " | |||
| lv_class_type | TYPE KLAH-KLART, " | |||
| lv_class_is_isolated | TYPE KLAH, " | |||
| lv_key_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_class_not_exist | TYPE SY, " | |||
| lv_language | TYPE SY-LANGU, " SY-LANGU | |||
| lv_class_not_valid | TYPE SY, " | |||
| lv_levels_down | TYPE GHCL-STUFE, " '0000000001' | |||
| lv_class_no_predecessor | TYPE GHCL, " | |||
| lv_levels_up | TYPE GHCL-STUFE, " '0000000000' | |||
| lv_class_no_successor | TYPE GHCL. " |
|   CALL FUNCTION 'CC_LS_GET_CLASS_HIER_STRUCTURE' "Explodes the class hierarchy via the CAD interface |
| EXPORTING | ||
| CLASS_NUMBER | = lv_class_number | |
| CLASS_TYPE | = lv_class_type | |
| KEY_DATE | = lv_key_date | |
| LANGUAGE | = lv_language | |
| LEVELS_DOWN | = lv_levels_down | |
| LEVELS_UP | = lv_levels_up | |
| TABLES | ||
| CLASS_STRUCTURE | = lt_class_structure | |
| EXCEPTIONS | ||
| CLASS_INVALID_SIGN = 1 | ||
| CLASS_IS_ISOLATED = 2 | ||
| CLASS_NOT_EXIST = 3 | ||
| CLASS_NOT_VALID = 4 | ||
| CLASS_NO_PREDECESSOR = 5 | ||
| CLASS_NO_SUCCESSOR = 6 | ||
| . " CC_LS_GET_CLASS_HIER_STRUCTURE | ||
ABAP code using 7.40 inline data declarations to call FM CC_LS_GET_CLASS_HIER_STRUCTURE
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 CLASS FROM KLAH INTO @DATA(ld_class_number). | ||||
| "SELECT single KLART FROM KLAH INTO @DATA(ld_class_type). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_key_date). | ||||
| DATA(ld_key_date) | = SY-DATUM. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_language). | ||||
| DATA(ld_language) | = SY-LANGU. | |||
| "SELECT single STUFE FROM GHCL INTO @DATA(ld_levels_down). | ||||
| DATA(ld_levels_down) | = '0000000001'. | |||
| "SELECT single STUFE FROM GHCL INTO @DATA(ld_levels_up). | ||||
| DATA(ld_levels_up) | = '0000000000'. | |||
Search for further information about these or an SAP related objects