SAP Function Modules

RTMATGRP_HIER_SINGLE_SELECT SAP Function module - Read Hierarchy Data







RTMATGRP_HIER_SINGLE_SELECT 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 RTMATGRP_HIER_SINGLE_SELECT into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM RTMATGRP_HIER_SINGLE_SELECT - RTMATGRP HIER SINGLE SELECT





CALL FUNCTION 'RTMATGRP_HIER_SINGLE_SELECT' "Read Hierarchy Data
  EXPORTING
*   kzrfb =                     " sy-batch      Program running in background
    hier_id =                   " wrf_matgrp_sku-hier_id  Hierarchy ID
*   spras =                     " sy-langu      SAP System, Current Language
  IMPORTING
    matgrp_hier =               " wrf_matgrp_hier  Article Hierarchy Properties
    matgrp_hiert =              " wrf_matgrp_hiert  Article Hierarchy Description
    status =                    " wrf_matgrp_hier-status  Article Hierarchy Status
    ltext =                     " wrf_matgrp_hiert-ltext  Name
  EXCEPTIONS
    NOT_FOUND = 1               "               Not Found
    .  "  RTMATGRP_HIER_SINGLE_SELECT

ABAP code example for Function Module RTMATGRP_HIER_SINGLE_SELECT





The ABAP code below is a full code listing to execute function module RTMATGRP_HIER_SINGLE_SELECT 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_matgrp_hier  TYPE WRF_MATGRP_HIER ,
ld_matgrp_hiert  TYPE WRF_MATGRP_HIERT ,
ld_status  TYPE WRF_MATGRP_HIER-STATUS ,
ld_ltext  TYPE WRF_MATGRP_HIERT-LTEXT .

DATA(ld_kzrfb) = 'some text here'.

SELECT single HIER_ID
FROM WRF_MATGRP_SKU
INTO @DATA(ld_hier_id).

DATA(ld_spras) = 'Check type of data required'. . CALL FUNCTION 'RTMATGRP_HIER_SINGLE_SELECT' EXPORTING * kzrfb = ld_kzrfb hier_id = ld_hier_id * spras = ld_spras IMPORTING matgrp_hier = ld_matgrp_hier matgrp_hiert = ld_matgrp_hiert status = ld_status ltext = ld_ltext EXCEPTIONS NOT_FOUND = 1 . " RTMATGRP_HIER_SINGLE_SELECT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_matgrp_hier  TYPE WRF_MATGRP_HIER ,
ld_kzrfb  TYPE SY-BATCH ,
ld_matgrp_hiert  TYPE WRF_MATGRP_HIERT ,
ld_hier_id  TYPE WRF_MATGRP_SKU-HIER_ID ,
ld_status  TYPE WRF_MATGRP_HIER-STATUS ,
ld_spras  TYPE SY-LANGU ,
ld_ltext  TYPE WRF_MATGRP_HIERT-LTEXT .

ld_kzrfb = 'some text here'.

SELECT single HIER_ID
FROM WRF_MATGRP_SKU
INTO ld_hier_id.

ld_spras = 'Check type of data required'.

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 RTMATGRP_HIER_SINGLE_SELECT or its description.