SAP Function Modules

CHECK_TREE_RISK_NEW SAP Function module - Funktion zur Überprüfung der Risiko-Hierarchie







CHECK_TREE_RISK_NEW is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CHECK_TREE_RISK_NEW into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: JBR1
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CHECK_TREE_RISK_NEW - CHECK TREE RISK NEW





CALL FUNCTION 'CHECK_TREE_RISK_NEW' "Funktion zur Überprüfung der Risiko-Hierarchie
  EXPORTING
    m_rhid =                    " jbrrh-rhid    Id der zu prüfenden Risikohierarchie
*   is_rh =                     " jbrrh         Optional: Interne RH-Struktur (JBRRH)
*   is_rht =                    " jbrrht        Optional: Interne RH-Text-Struktur (JBRRHT)
*   text_flag = 'X'             " c             prüft ob Kurzbez. vorhanden, wenn angekreuzt
  IMPORTING
    error_flag =                " c             gibt WAHR zurück, wenn Hierarchie fehlerhaft
* TABLES
*   it_knots =                  " jbrrhbaum     Optional: Interne RH-Baum-Tabelle (JBRRHBAUM)
*   it_rhbaumt =                " jbrrhbaumt    Optional: Interne RH-Baum-Text-Tab. (JBRRHBAUMT)
*   it_leafs =                  " jbrrhblatt    Optional: Interne RH-Blatt-Tabelle (JBRRHBLATT)
*   it_prot =                   " mesg          Protokoll-Tabelle (Auflistung der Fehler)
  EXCEPTIONS
    NOT_FOUND = 1               "               Risikohierarchie-Definition existiert nicht
    DEPENDENT_TABLE_ERROR = 2   "               eine der abhängigen Tabellen enth. keine Daten
    .  "  CHECK_TREE_RISK_NEW

ABAP code example for Function Module CHECK_TREE_RISK_NEW





The ABAP code below is a full code listing to execute function module CHECK_TREE_RISK_NEW including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_error_flag  TYPE C ,
it_it_knots  TYPE STANDARD TABLE OF JBRRHBAUM,"TABLES PARAM
wa_it_knots  LIKE LINE OF it_it_knots ,
it_it_rhbaumt  TYPE STANDARD TABLE OF JBRRHBAUMT,"TABLES PARAM
wa_it_rhbaumt  LIKE LINE OF it_it_rhbaumt ,
it_it_leafs  TYPE STANDARD TABLE OF JBRRHBLATT,"TABLES PARAM
wa_it_leafs  LIKE LINE OF it_it_leafs ,
it_it_prot  TYPE STANDARD TABLE OF MESG,"TABLES PARAM
wa_it_prot  LIKE LINE OF it_it_prot .


SELECT single RHID
FROM JBRRH
INTO @DATA(ld_m_rhid).

DATA(ld_is_rh) = 'Check type of data required'.
DATA(ld_is_rht) = 'Check type of data required'.
DATA(ld_text_flag) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_knots to it_it_knots.

"populate fields of struture and append to itab
append wa_it_rhbaumt to it_it_rhbaumt.

"populate fields of struture and append to itab
append wa_it_leafs to it_it_leafs.

"populate fields of struture and append to itab
append wa_it_prot to it_it_prot. . CALL FUNCTION 'CHECK_TREE_RISK_NEW' EXPORTING m_rhid = ld_m_rhid * is_rh = ld_is_rh * is_rht = ld_is_rht * text_flag = ld_text_flag IMPORTING error_flag = ld_error_flag * TABLES * it_knots = it_it_knots * it_rhbaumt = it_it_rhbaumt * it_leafs = it_it_leafs * it_prot = it_it_prot EXCEPTIONS NOT_FOUND = 1 DEPENDENT_TABLE_ERROR = 2 . " CHECK_TREE_RISK_NEW
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_error_flag  TYPE C ,
ld_m_rhid  TYPE JBRRH-RHID ,
it_it_knots  TYPE STANDARD TABLE OF JBRRHBAUM ,
wa_it_knots  LIKE LINE OF it_it_knots,
ld_is_rh  TYPE JBRRH ,
it_it_rhbaumt  TYPE STANDARD TABLE OF JBRRHBAUMT ,
wa_it_rhbaumt  LIKE LINE OF it_it_rhbaumt,
ld_is_rht  TYPE JBRRHT ,
it_it_leafs  TYPE STANDARD TABLE OF JBRRHBLATT ,
wa_it_leafs  LIKE LINE OF it_it_leafs,
ld_text_flag  TYPE C ,
it_it_prot  TYPE STANDARD TABLE OF MESG ,
wa_it_prot  LIKE LINE OF it_it_prot.


SELECT single RHID
FROM JBRRH
INTO ld_m_rhid.


"populate fields of struture and append to itab
append wa_it_knots to it_it_knots.
ld_is_rh = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_rhbaumt to it_it_rhbaumt.
ld_is_rht = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_leafs to it_it_leafs.
ld_text_flag = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_prot to it_it_prot.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CHECK_TREE_RISK_NEW or its description.