SAP C1F2_SUBSTANCE_GET_COMP_TREE Function Module for NOTRANSL: EHS: Zusammensetzungsbaum für eine Spez. komplett auflösen









C1F2_SUBSTANCE_GET_COMP_TREE is a standard c1f2 substance get comp tree SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: EHS: Zusammensetzungsbaum für eine Spez. komplett auflösen 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 c1f2 substance get comp tree FM, simply by entering the name C1F2_SUBSTANCE_GET_COMP_TREE into the relevant SAP transaction such as SE37 or SE38.

Function Group: C1F2
Program Name: SAPLC1F2
Main Program: SAPLC1F2
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function C1F2_SUBSTANCE_GET_COMP_TREE 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 'C1F2_SUBSTANCE_GET_COMP_TREE'"NOTRANSL: EHS: Zusammensetzungsbaum für eine Spez. komplett auflösen
EXPORTING
I_RECN = "Specification
I_ESTCAT = "Value assignment type (composition)
* I_VALDAT = SY-DATUM "Key date
* I_FLG_CHECK_AUTH = ESP1_FALSE "
* I_USEXNAM = "Name of user exit to cancel for a substance
* I_USEXPAR = "Parameter of user exit to cancel for a substance
* I_UE_TREE_TO_LIST = ' ' "
* I_FLG_CONS_ALL_VAL_INSTS = ESP1_FALSE "

TABLES
* I_USAGE_TAB = "Usage (for access to value assignments)
E_COMP_TREE_TAB = "Determines composition tree
* E_COMP_LIST_TAB = "Determines list of all ingredients
* E_COMP_PROP_TAB = "
* E_COMP_LIST_FLOAT_TAB = "
* I_UE_PARAM_TAB = "EHS: User Exit Parameters in User Exit Management

EXCEPTIONS
NO_OBJECT_SPECIFIED = 1 PARAMETER_ERROR = 2 INTERNAL_ERROR = 3 INCL_SUBS_FIND_ERROR = 4
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLC1F2_001 EHS: Saving Additional Data in the Database

IMPORTING Parameters details for C1F2_SUBSTANCE_GET_COMP_TREE

I_RECN - Specification

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

I_ESTCAT - Value assignment type (composition)

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

I_VALDAT - Key date

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

I_FLG_CHECK_AUTH -

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

I_USEXNAM - Name of user exit to cancel for a substance

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

I_USEXPAR - Parameter of user exit to cancel for a substance

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

I_UE_TREE_TO_LIST -

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

I_FLG_CONS_ALL_VAL_INSTS -

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

TABLES Parameters details for C1F2_SUBSTANCE_GET_COMP_TREE

I_USAGE_TAB - Usage (for access to value assignments)

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

E_COMP_TREE_TAB - Determines composition tree

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

E_COMP_LIST_TAB - Determines list of all ingredients

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

E_COMP_PROP_TAB -

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

E_COMP_LIST_FLOAT_TAB -

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

I_UE_PARAM_TAB - EHS: User Exit Parameters in User Exit Management

Data type: TCGUEEN
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

NO_OBJECT_SPECIFIED - No specification specified or specification does not exist

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

PARAMETER_ERROR - Value assignment type not specified

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

INTERNAL_ERROR - Internal system error

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

INCL_SUBS_FIND_ERROR -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for C1F2_SUBSTANCE_GET_COMP_TREE 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_recn  TYPE ESTRH-RECN, "   
lt_i_usage_tab  TYPE STANDARD TABLE OF ESPRH_APIDU_TAB_TYPE, "   
lv_no_object_specified  TYPE ESPRH_APIDU_TAB_TYPE, "   
lv_i_estcat  TYPE ESTVH-ESTCAT, "   
lt_e_comp_tree_tab  TYPE STANDARD TABLE OF ESPRH_COMP_TREE_TAB_TYPE, "   
lv_parameter_error  TYPE ESPRH_COMP_TREE_TAB_TYPE, "   
lv_i_valdat  TYPE RCGADDINF-VALDAT, "   SY-DATUM
lv_internal_error  TYPE RCGADDINF, "   
lt_e_comp_list_tab  TYPE STANDARD TABLE OF ESPRH_COMP_TREE_TAB_TYPE, "   
lt_e_comp_prop_tab  TYPE STANDARD TABLE OF ESPRH_COMP_TREE_TAB_TYPE, "   
lv_i_flg_check_auth  TYPE ESP1_BOOLEAN, "   ESP1_FALSE
lv_incl_subs_find_error  TYPE ESP1_BOOLEAN, "   
lv_i_usexnam  TYPE RCGEXITPAR-USEXNAM, "   
lt_e_comp_list_float_tab  TYPE STANDARD TABLE OF ESPRH_COMP_TREE_FLOAT_TAB_TYPE, "   
lv_i_usexpar  TYPE BAPI1077IL-TEXT_LINE, "   
lt_i_ue_param_tab  TYPE STANDARD TABLE OF TCGUEEN, "   
lv_i_ue_tree_to_list  TYPE FUNCNAME, "   SPACE
lv_i_flg_cons_all_val_insts  TYPE ESP1_BOOLEAN. "   ESP1_FALSE

  CALL FUNCTION 'C1F2_SUBSTANCE_GET_COMP_TREE'  "NOTRANSL: EHS: Zusammensetzungsbaum für eine Spez. komplett auflösen
    EXPORTING
         I_RECN = lv_i_recn
         I_ESTCAT = lv_i_estcat
         I_VALDAT = lv_i_valdat
         I_FLG_CHECK_AUTH = lv_i_flg_check_auth
         I_USEXNAM = lv_i_usexnam
         I_USEXPAR = lv_i_usexpar
         I_UE_TREE_TO_LIST = lv_i_ue_tree_to_list
         I_FLG_CONS_ALL_VAL_INSTS = lv_i_flg_cons_all_val_insts
    TABLES
         I_USAGE_TAB = lt_i_usage_tab
         E_COMP_TREE_TAB = lt_e_comp_tree_tab
         E_COMP_LIST_TAB = lt_e_comp_list_tab
         E_COMP_PROP_TAB = lt_e_comp_prop_tab
         E_COMP_LIST_FLOAT_TAB = lt_e_comp_list_float_tab
         I_UE_PARAM_TAB = lt_i_ue_param_tab
    EXCEPTIONS
        NO_OBJECT_SPECIFIED = 1
        PARAMETER_ERROR = 2
        INTERNAL_ERROR = 3
        INCL_SUBS_FIND_ERROR = 4
. " C1F2_SUBSTANCE_GET_COMP_TREE




ABAP code using 7.40 inline data declarations to call FM C1F2_SUBSTANCE_GET_COMP_TREE

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 RECN FROM ESTRH INTO @DATA(ld_i_recn).
 
 
 
"SELECT single ESTCAT FROM ESTVH INTO @DATA(ld_i_estcat).
 
 
 
"SELECT single VALDAT FROM RCGADDINF INTO @DATA(ld_i_valdat).
DATA(ld_i_valdat) = SY-DATUM.
 
 
 
 
DATA(ld_i_flg_check_auth) = ESP1_FALSE.
 
 
"SELECT single USEXNAM FROM RCGEXITPAR INTO @DATA(ld_i_usexnam).
 
 
"SELECT single TEXT_LINE FROM BAPI1077IL INTO @DATA(ld_i_usexpar).
 
 
DATA(ld_i_ue_tree_to_list) = ' '.
 
DATA(ld_i_flg_cons_all_val_insts) = ESP1_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!