SAP RSAR_PROGRAM_GENERATE_HIER_NEW Function Module for Generates program to load hierarchies from 3.0 (TRFC, PSA)









RSAR_PROGRAM_GENERATE_HIER_NEW is a standard rsar program generate hier new SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Generates program to load hierarchies from 3.0 (TRFC, PSA) 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 rsar program generate hier new FM, simply by entering the name RSAR_PROGRAM_GENERATE_HIER_NEW into the relevant SAP transaction such as SE37 or SE38.

Function Group: RSAI
Program Name: SAPLRSAI
Main Program: SAPLRSAI
Appliation area: B
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RSAR_PROGRAM_GENERATE_HIER_NEW 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 'RSAR_PROGRAM_GENERATE_HIER_NEW'"Generates program to load hierarchies from 3.0 (TRFC, PSA)
EXPORTING
I_LOGSYS = "Logical System Name
I_OBJECT = "InfoSource Name
I_OLTPSOURCE = "OLTP Source
I_REPORTNAME = "Name of an evtl. existing program
* I_DEBUG_LEVEL = 0 "Debug level for the generation
* I_ODSNAME_TECH = "Technical ODS name in the DB
* I_TRANSTRU_CHAR = "
* I_DB_COMMIT = RS_C_FALSE "Boolean
* I_WITHOUT_LOG = RS_C_FALSE "Boolean

IMPORTING
E_REPORTNAME = "Name of Generated Program
E_FORMNAME = "Name of the generated form routine

EXCEPTIONS
REPORT_CREATION_ERROR = 1 PROG_TEMPLATE_ERROR = 2 OBJECT_NOT_FOUND = 3 NO_HIERARCHY_AVAILABLE = 4 NO_LOGSYS_TYPE_AVAILABLE = 5 META_DATA_ERROR = 6 INVALID_CONVRULES = 7 RULE_TEMPLATE_ERROR = 8
.



IMPORTING Parameters details for RSAR_PROGRAM_GENERATE_HIER_NEW

I_LOGSYS - Logical System Name

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

I_OBJECT - InfoSource Name

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

I_OLTPSOURCE - OLTP Source

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

I_REPORTNAME - Name of an evtl. existing program

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

I_DEBUG_LEVEL - Debug level for the generation

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

I_ODSNAME_TECH - Technical ODS name in the DB

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

I_TRANSTRU_CHAR -

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

I_DB_COMMIT - Boolean

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

I_WITHOUT_LOG - Boolean

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

EXPORTING Parameters details for RSAR_PROGRAM_GENERATE_HIER_NEW

E_REPORTNAME - Name of Generated Program

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

E_FORMNAME - Name of the generated form routine

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

EXCEPTIONS details

REPORT_CREATION_ERROR - Error creating the report

Data type:
Optional: No
Call by Reference: Yes

PROG_TEMPLATE_ERROR - Syntaxfehler in hierachy template

Data type:
Optional: No
Call by Reference: Yes

OBJECT_NOT_FOUND - InfoSource not found

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

NO_HIERARCHY_AVAILABLE - InfoSource returns no hierarchies

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

NO_LOGSYS_TYPE_AVAILABLE -

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

META_DATA_ERROR -

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

INVALID_CONVRULES - Syntax errors in the conversion rules

Data type:
Optional: No
Call by Reference: Yes

RULE_TEMPLATE_ERROR - Syntax error in template

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for RSAR_PROGRAM_GENERATE_HIER_NEW 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_i_logsys  TYPE RSA_LOGSYS, "   
lv_e_reportname  TYPE RSA_PROGNAME, "   
lv_report_creation_error  TYPE RSA_PROGNAME, "   
lv_i_object  TYPE RSA_OBJECT, "   
lv_e_formname  TYPE RSA_FORMNAME, "   
lv_prog_template_error  TYPE RSA_FORMNAME, "   
lv_i_oltpsource  TYPE RSOLTPSOURCER, "   
lv_object_not_found  TYPE RSOLTPSOURCER, "   
lv_i_reportname  TYPE RSA_PROGNAME, "   
lv_no_hierarchy_available  TYPE RSA_PROGNAME, "   
lv_i_debug_level  TYPE I, "   0
lv_no_logsys_type_available  TYPE I, "   
lv_i_odsname_tech  TYPE RSTSODS-ODSNAME_TECH, "   
lv_meta_data_error  TYPE RSTSODS, "   
lv_i_transtru_char  TYPE RSA_TRANSTRU, "   
lv_invalid_convrules  TYPE RSA_TRANSTRU, "   
lv_i_db_commit  TYPE RS_BOOL, "   RS_C_FALSE
lv_rule_template_error  TYPE RS_BOOL, "   
lv_i_without_log  TYPE RS_BOOL. "   RS_C_FALSE

  CALL FUNCTION 'RSAR_PROGRAM_GENERATE_HIER_NEW'  "Generates program to load hierarchies from 3.0 (TRFC, PSA)
    EXPORTING
         I_LOGSYS = lv_i_logsys
         I_OBJECT = lv_i_object
         I_OLTPSOURCE = lv_i_oltpsource
         I_REPORTNAME = lv_i_reportname
         I_DEBUG_LEVEL = lv_i_debug_level
         I_ODSNAME_TECH = lv_i_odsname_tech
         I_TRANSTRU_CHAR = lv_i_transtru_char
         I_DB_COMMIT = lv_i_db_commit
         I_WITHOUT_LOG = lv_i_without_log
    IMPORTING
         E_REPORTNAME = lv_e_reportname
         E_FORMNAME = lv_e_formname
    EXCEPTIONS
        REPORT_CREATION_ERROR = 1
        PROG_TEMPLATE_ERROR = 2
        OBJECT_NOT_FOUND = 3
        NO_HIERARCHY_AVAILABLE = 4
        NO_LOGSYS_TYPE_AVAILABLE = 5
        META_DATA_ERROR = 6
        INVALID_CONVRULES = 7
        RULE_TEMPLATE_ERROR = 8
. " RSAR_PROGRAM_GENERATE_HIER_NEW




ABAP code using 7.40 inline data declarations to call FM RSAR_PROGRAM_GENERATE_HIER_NEW

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 ODSNAME_TECH FROM RSTSODS INTO @DATA(ld_i_odsname_tech).
 
 
 
 
DATA(ld_i_db_commit) = RS_C_FALSE.
 
 
DATA(ld_i_without_log) = RS_C_FALSE.
 


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!