SAP CLSA_STRUCTURE_RECURSION Function Module for









CLSA_STRUCTURE_RECURSION is a standard clsa structure recursion 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 clsa structure recursion FM, simply by entering the name CLSA_STRUCTURE_RECURSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: CLSA
Program Name: SAPLCLSA
Main Program:
Appliation area: M
Release date: 01-Jan-1970
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CLSA_STRUCTURE_RECURSION 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 'CLSA_STRUCTURE_RECURSION'"
EXPORTING
CLASS = "Class to be exploded
* KEY_DATE = SY-DATUM "Start date
* RECURSION_CHECK = 'X' "Call as recursiveness check
CLASSTYPE = "Class type
* HEADCLASS = ' ' "Class to check for recursiveness
* HEADCLINT = ' ' "
* LANGUAGE = SY-LANGU "Language for reading class description
* WITH_TEXT = 'X' "Read class description
* MODE = 'U' "Explosion mode:'G' = restricted, 'U' = unrestricted
* REFRESH = 'X' "Delete table STRUKT during call = 'X'
* STRUCTURE_DEPTH = 99 "Structure explosion level ( > 0, max. 99)

TABLES
* STRUKT = "Stored structure (module --> TX)

EXCEPTIONS
ERR_INKONSISTENT = 1 ERR_NO_SUBCLASS = 2 ERR_OVERFLOW = 3 ERR_REKURSIV = 4
.



IMPORTING Parameters details for CLSA_STRUCTURE_RECURSION

CLASS - Class to be exploded

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

KEY_DATE - Start date

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

RECURSION_CHECK - Call as recursiveness check

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

CLASSTYPE - Class type

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

HEADCLASS - Class to check for recursiveness

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

HEADCLINT -

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

LANGUAGE - Language for reading class description

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

WITH_TEXT - Read class description

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

MODE - Explosion mode:'G' = restricted, 'U' = unrestricted

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

REFRESH - Delete table STRUKT during call = 'X'

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

STRUCTURE_DEPTH - Structure explosion level ( > 0, max. 99)

Data type: RMCLS-TIEFE
Default: 99
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CLSA_STRUCTURE_RECURSION

STRUKT - Stored structure (module --> TX)

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

EXCEPTIONS details

ERR_INKONSISTENT - Structure is inconsistent - no explosion !!

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

ERR_NO_SUBCLASS - Class has no subordinate classes

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

ERR_OVERFLOW - Internal recursiveness (>99 levels)

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

ERR_REKURSIV - Recursiveness occurred

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

Copy and paste ABAP code example for CLSA_STRUCTURE_RECURSION 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  TYPE KLAH-CLASS, "   
lt_strukt  TYPE STANDARD TABLE OF KLAH, "   
lv_err_inkonsistent  TYPE KLAH, "   
lv_key_date  TYPE SY-DATUM, "   SY-DATUM
lv_recursion_check  TYPE RMCLS-XFLAG, "   'X'
lv_classtype  TYPE KLAH-KLART, "   
lv_err_no_subclass  TYPE KLAH, "   
lv_headclass  TYPE KLAH-CLASS, "   SPACE
lv_err_overflow  TYPE KLAH, "   
lv_headclint  TYPE KLAH-CLINT, "   SPACE
lv_err_rekursiv  TYPE KLAH, "   
lv_language  TYPE SY-LANGU, "   SY-LANGU
lv_with_text  TYPE RMCLS-XFLAG, "   'X'
lv_mode  TYPE RMCLS-XFLAG, "   'U'
lv_refresh  TYPE RMCLS-XFLAG, "   'X'
lv_structure_depth  TYPE RMCLS-TIEFE. "   99

  CALL FUNCTION 'CLSA_STRUCTURE_RECURSION'  "
    EXPORTING
         CLASS = lv_class
         KEY_DATE = lv_key_date
         RECURSION_CHECK = lv_recursion_check
         CLASSTYPE = lv_classtype
         HEADCLASS = lv_headclass
         HEADCLINT = lv_headclint
         LANGUAGE = lv_language
         WITH_TEXT = lv_with_text
         MODE = lv_mode
         REFRESH = lv_refresh
         STRUCTURE_DEPTH = lv_structure_depth
    TABLES
         STRUKT = lt_strukt
    EXCEPTIONS
        ERR_INKONSISTENT = 1
        ERR_NO_SUBCLASS = 2
        ERR_OVERFLOW = 3
        ERR_REKURSIV = 4
. " CLSA_STRUCTURE_RECURSION




ABAP code using 7.40 inline data declarations to call FM CLSA_STRUCTURE_RECURSION

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).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_key_date).
DATA(ld_key_date) = SY-DATUM.
 
"SELECT single XFLAG FROM RMCLS INTO @DATA(ld_recursion_check).
DATA(ld_recursion_check) = 'X'.
 
"SELECT single KLART FROM KLAH INTO @DATA(ld_classtype).
 
 
"SELECT single CLASS FROM KLAH INTO @DATA(ld_headclass).
DATA(ld_headclass) = ' '.
 
 
"SELECT single CLINT FROM KLAH INTO @DATA(ld_headclint).
DATA(ld_headclint) = ' '.
 
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single XFLAG FROM RMCLS INTO @DATA(ld_with_text).
DATA(ld_with_text) = 'X'.
 
"SELECT single XFLAG FROM RMCLS INTO @DATA(ld_mode).
DATA(ld_mode) = 'U'.
 
"SELECT single XFLAG FROM RMCLS INTO @DATA(ld_refresh).
DATA(ld_refresh) = 'X'.
 
"SELECT single TIEFE FROM RMCLS INTO @DATA(ld_structure_depth).
DATA(ld_structure_depth) = 99.
 


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!