SAP 1158_EP_SUBTREE_CREATE Function Module for Create Program Sub-Tree
1158_EP_SUBTREE_CREATE is a standard 1158 ep subtree create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create Program Sub-Tree 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 1158 ep subtree create FM, simply by entering the name 1158_EP_SUBTREE_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: 1158
Program Name: SAPL1158
Main Program: SAPL1158
Appliation area: A
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function 1158_EP_SUBTREE_CREATE 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 '1158_EP_SUBTREE_CREATE'"Create Program Sub-Tree.
EXPORTING
PROGRAM_IN = "Program Name
APPROVALYEAR_IN = "Approval Year of Program
* PARENT = ' ' "Position ID of parent
* PREDECESSOR = ' ' "Position ID of predecessor
* TEST_RUN = ' ' "Test Run
* LANGUAGE = "Logon Language in SAP Format
* LANGUAGE_ISO = "Logon Language in ISO Format
* IN_UPDATE_TASK = ' ' "Update in Update Task
* KEY_DATE = "
IMPORTING
PROGRAM = "
APPROVALYEAR = "
POSITION = "
TABLES
PROGTREE = "Detail Specif. on Program Positions
* RETURN = "Return Messages
IMPORTING Parameters details for 1158_EP_SUBTREE_CREATE
PROGRAM_IN - Program Name
Data type: BAPIPROGPOSID-PROGRAMOptional: No
Call by Reference: No ( called with pass by value option)
APPROVALYEAR_IN - Approval Year of Program
Data type: BAPIPROGPOSID-APPROVALYEAROptional: No
Call by Reference: No ( called with pass by value option)
PARENT - Position ID of parent
Data type: BAPIPROGAUX-PARENTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PREDECESSOR - Position ID of predecessor
Data type: BAPIPROGAUX-PREDECESSORDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_RUN - Test Run
Data type: BAPIPROGAUX-TEST_RUNDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Logon Language in SAP Format
Data type: BAPIPROGAUX-LANGUOptional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE_ISO - Logon Language in ISO Format
Data type: BAPIPROGAUX-LANGU_ISOOptional: Yes
Call by Reference: No ( called with pass by value option)
IN_UPDATE_TASK - Update in Update Task
Data type: FLAGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_DATE -
Data type: DATSOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for 1158_EP_SUBTREE_CREATE
PROGRAM -
Data type: BAPIPROGPOSID-PROGRAMOptional: No
Call by Reference: No ( called with pass by value option)
APPROVALYEAR -
Data type: BAPIPROGPOSID-APPROVALYEAROptional: No
Call by Reference: No ( called with pass by value option)
POSITION -
Data type: BAPIPROGPOSID-POSITIONOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for 1158_EP_SUBTREE_CREATE
PROGTREE - Detail Specif. on Program Positions
Data type: BAPIPROGSTRUCOptional: No
Call by Reference: No ( called with pass by value option)
RETURN - Return Messages
Data type: BAPIRET2Optional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for 1158_EP_SUBTREE_CREATE 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_program | TYPE BAPIPROGPOSID-PROGRAM, " | |||
lt_progtree | TYPE STANDARD TABLE OF BAPIPROGSTRUC, " | |||
lv_program_in | TYPE BAPIPROGPOSID-PROGRAM, " | |||
lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
lv_approvalyear | TYPE BAPIPROGPOSID-APPROVALYEAR, " | |||
lv_approvalyear_in | TYPE BAPIPROGPOSID-APPROVALYEAR, " | |||
lv_parent | TYPE BAPIPROGAUX-PARENT, " ' ' | |||
lv_position | TYPE BAPIPROGPOSID-POSITION, " | |||
lv_predecessor | TYPE BAPIPROGAUX-PREDECESSOR, " ' ' | |||
lv_test_run | TYPE BAPIPROGAUX-TEST_RUN, " ' ' | |||
lv_language | TYPE BAPIPROGAUX-LANGU, " | |||
lv_language_iso | TYPE BAPIPROGAUX-LANGU_ISO, " | |||
lv_in_update_task | TYPE FLAG, " ' ' | |||
lv_key_date | TYPE DATS. " |
  CALL FUNCTION '1158_EP_SUBTREE_CREATE' "Create Program Sub-Tree |
EXPORTING | ||
PROGRAM_IN | = lv_program_in | |
APPROVALYEAR_IN | = lv_approvalyear_in | |
PARENT | = lv_parent | |
PREDECESSOR | = lv_predecessor | |
TEST_RUN | = lv_test_run | |
LANGUAGE | = lv_language | |
LANGUAGE_ISO | = lv_language_iso | |
IN_UPDATE_TASK | = lv_in_update_task | |
KEY_DATE | = lv_key_date | |
IMPORTING | ||
PROGRAM | = lv_program | |
APPROVALYEAR | = lv_approvalyear | |
POSITION | = lv_position | |
TABLES | ||
PROGTREE | = lt_progtree | |
RETURN | = lt_return | |
. " 1158_EP_SUBTREE_CREATE |
ABAP code using 7.40 inline data declarations to call FM 1158_EP_SUBTREE_CREATE
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 PROGRAM FROM BAPIPROGPOSID INTO @DATA(ld_program). | ||||
"SELECT single PROGRAM FROM BAPIPROGPOSID INTO @DATA(ld_program_in). | ||||
"SELECT single APPROVALYEAR FROM BAPIPROGPOSID INTO @DATA(ld_approvalyear). | ||||
"SELECT single APPROVALYEAR FROM BAPIPROGPOSID INTO @DATA(ld_approvalyear_in). | ||||
"SELECT single PARENT FROM BAPIPROGAUX INTO @DATA(ld_parent). | ||||
DATA(ld_parent) | = ' '. | |||
"SELECT single POSITION FROM BAPIPROGPOSID INTO @DATA(ld_position). | ||||
"SELECT single PREDECESSOR FROM BAPIPROGAUX INTO @DATA(ld_predecessor). | ||||
DATA(ld_predecessor) | = ' '. | |||
"SELECT single TEST_RUN FROM BAPIPROGAUX INTO @DATA(ld_test_run). | ||||
DATA(ld_test_run) | = ' '. | |||
"SELECT single LANGU FROM BAPIPROGAUX INTO @DATA(ld_language). | ||||
"SELECT single LANGU_ISO FROM BAPIPROGAUX INTO @DATA(ld_language_iso). | ||||
DATA(ld_in_update_task) | = ' '. | |||
Search for further information about these or an SAP related objects