SAP UPSCU_CONSTRUCTOR Function Module for
UPSCU_CONSTRUCTOR is a standard upscu constructor SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 upscu constructor FM, simply by entering the name UPSCU_CONSTRUCTOR into the relevant SAP transaction such as SE37 or SE38.
Function Group: UPSCU
Program Name: SAPLUPSCU
Main Program: SAPLUPSCU
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function UPSCU_CONSTRUCTOR 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 'UPSCU_CONSTRUCTOR'".
EXPORTING
IM_PACKAGENAME = "ALE Distribution Packet: Name
* FLG_ITM_DSCRPT = KUPS_FALSE "
* FLG_ITM_IDOC = KUPS_FALSE "
* FLG_DIALOG = KUPS_FALSE "Call in Dialog
* IM_HANDLE = "Application Log: Log Handle
* IM_TRUSTLEVEL_CHECK = 0 "
* IM_TRUSTLEVEL_LOG = 0 "
IM_OWNER = "ALE Distribution Packet : Owner
IM_PARTNER = "ALE Distribution Packet : Partner
IM_DIRECTION = "ALE Distribution Packet: Distribution Direction
* IM_EDITMODE = KUPS_DISPLAY "Processing type
* FLG_ERROR_IF_NOT_EXIST = KUPS_TRUE "Error Message if Unit Does Not Exist
* FLG_ERROR_IF_EXIST = KUPS_TRUE "Error Message if Unit Already Exists
* FLG_APPL_LOG = KUPS_FALSE "Write application log
* FLG_MSG_COLLECT = KUPS_FALSE "Collect messages
IMPORTING
EX_INSTID = "ALE Distribution Packet: ID for Instantiation
TABLES
* EX_MESSAGES = "Accumulated messages
EXCEPTIONS
FAILING_INSTANCE = 1 UNITY_NOT_EXISTS = 2 UNITY_EXISTS = 3 NO_AUTHORITY = 4 DISPLAY_ONLY = 5 ERROR = 6
IMPORTING Parameters details for UPSCU_CONSTRUCTOR
IM_PACKAGENAME - ALE Distribution Packet: Name
Data type: API_UPSHDR-UPSNAMOptional: No
Call by Reference: Yes
FLG_ITM_DSCRPT -
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_ITM_IDOC -
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_DIALOG - Call in Dialog
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
IM_HANDLE - Application Log: Log Handle
Data type: BALLOGHNDLOptional: Yes
Call by Reference: Yes
IM_TRUSTLEVEL_CHECK -
Data type: IOptional: Yes
Call by Reference: Yes
IM_TRUSTLEVEL_LOG -
Data type: IOptional: Yes
Call by Reference: Yes
IM_OWNER - ALE Distribution Packet : Owner
Data type: API_UPSHDR-OWNEROptional: No
Call by Reference: Yes
IM_PARTNER - ALE Distribution Packet : Partner
Data type: API_UPSHDR-LOGSYSOptional: No
Call by Reference: Yes
IM_DIRECTION - ALE Distribution Packet: Distribution Direction
Data type: API_UPSHDR-DIRECTOptional: No
Call by Reference: Yes
IM_EDITMODE - Processing type
Data type: UPS_EDITMODEDefault: KUPS_DISPLAY
Optional: Yes
Call by Reference: Yes
FLG_ERROR_IF_NOT_EXIST - Error Message if Unit Does Not Exist
Data type: XFELDDefault: KUPS_TRUE
Optional: Yes
Call by Reference: Yes
FLG_ERROR_IF_EXIST - Error Message if Unit Already Exists
Data type: XFELDDefault: KUPS_TRUE
Optional: Yes
Call by Reference: Yes
FLG_APPL_LOG - Write application log
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_MSG_COLLECT - Collect messages
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for UPSCU_CONSTRUCTOR
EX_INSTID - ALE Distribution Packet: ID for Instantiation
Data type: UPS_INSTIDOptional: No
Call by Reference: Yes
TABLES Parameters details for UPSCU_CONSTRUCTOR
EX_MESSAGES - Accumulated messages
Data type: TUPSBAPIRET2Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
FAILING_INSTANCE - Object instance of packet could not be created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNITY_NOT_EXISTS - Distribution unit is not available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNITY_EXISTS - Distribution Packet Already Exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY - No Authorization
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DISPLAY_ONLY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR - Unclassified error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for UPSCU_CONSTRUCTOR 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_ex_instid | TYPE UPS_INSTID, " | |||
| lt_ex_messages | TYPE STANDARD TABLE OF TUPSBAPIRET2, " | |||
| lv_im_packagename | TYPE API_UPSHDR-UPSNAM, " | |||
| lv_failing_instance | TYPE API_UPSHDR, " | |||
| lv_flg_itm_dscrpt | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_itm_idoc | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_dialog | TYPE XFELD, " KUPS_FALSE | |||
| lv_im_handle | TYPE BALLOGHNDL, " | |||
| lv_im_trustlevel_check | TYPE I, " 0 | |||
| lv_im_trustlevel_log | TYPE I, " 0 | |||
| lv_im_owner | TYPE API_UPSHDR-OWNER, " | |||
| lv_unity_not_exists | TYPE API_UPSHDR, " | |||
| lv_im_partner | TYPE API_UPSHDR-LOGSYS, " | |||
| lv_unity_exists | TYPE API_UPSHDR, " | |||
| lv_im_direction | TYPE API_UPSHDR-DIRECT, " | |||
| lv_no_authority | TYPE API_UPSHDR, " | |||
| lv_im_editmode | TYPE UPS_EDITMODE, " KUPS_DISPLAY | |||
| lv_display_only | TYPE UPS_EDITMODE, " | |||
| lv_error | TYPE UPS_EDITMODE, " | |||
| lv_flg_error_if_not_exist | TYPE XFELD, " KUPS_TRUE | |||
| lv_flg_error_if_exist | TYPE XFELD, " KUPS_TRUE | |||
| lv_flg_appl_log | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_msg_collect | TYPE XFELD. " KUPS_FALSE |
|   CALL FUNCTION 'UPSCU_CONSTRUCTOR' " |
| EXPORTING | ||
| IM_PACKAGENAME | = lv_im_packagename | |
| FLG_ITM_DSCRPT | = lv_flg_itm_dscrpt | |
| FLG_ITM_IDOC | = lv_flg_itm_idoc | |
| FLG_DIALOG | = lv_flg_dialog | |
| IM_HANDLE | = lv_im_handle | |
| IM_TRUSTLEVEL_CHECK | = lv_im_trustlevel_check | |
| IM_TRUSTLEVEL_LOG | = lv_im_trustlevel_log | |
| IM_OWNER | = lv_im_owner | |
| IM_PARTNER | = lv_im_partner | |
| IM_DIRECTION | = lv_im_direction | |
| IM_EDITMODE | = lv_im_editmode | |
| FLG_ERROR_IF_NOT_EXIST | = lv_flg_error_if_not_exist | |
| FLG_ERROR_IF_EXIST | = lv_flg_error_if_exist | |
| FLG_APPL_LOG | = lv_flg_appl_log | |
| FLG_MSG_COLLECT | = lv_flg_msg_collect | |
| IMPORTING | ||
| EX_INSTID | = lv_ex_instid | |
| TABLES | ||
| EX_MESSAGES | = lt_ex_messages | |
| EXCEPTIONS | ||
| FAILING_INSTANCE = 1 | ||
| UNITY_NOT_EXISTS = 2 | ||
| UNITY_EXISTS = 3 | ||
| NO_AUTHORITY = 4 | ||
| DISPLAY_ONLY = 5 | ||
| ERROR = 6 | ||
| . " UPSCU_CONSTRUCTOR | ||
ABAP code using 7.40 inline data declarations to call FM UPSCU_CONSTRUCTOR
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 UPSNAM FROM API_UPSHDR INTO @DATA(ld_im_packagename). | ||||
| DATA(ld_flg_itm_dscrpt) | = KUPS_FALSE. | |||
| DATA(ld_flg_itm_idoc) | = KUPS_FALSE. | |||
| DATA(ld_flg_dialog) | = KUPS_FALSE. | |||
| "SELECT single OWNER FROM API_UPSHDR INTO @DATA(ld_im_owner). | ||||
| "SELECT single LOGSYS FROM API_UPSHDR INTO @DATA(ld_im_partner). | ||||
| "SELECT single DIRECT FROM API_UPSHDR INTO @DATA(ld_im_direction). | ||||
| DATA(ld_im_editmode) | = KUPS_DISPLAY. | |||
| DATA(ld_flg_error_if_not_exist) | = KUPS_TRUE. | |||
| DATA(ld_flg_error_if_exist) | = KUPS_TRUE. | |||
| DATA(ld_flg_appl_log) | = KUPS_FALSE. | |||
| DATA(ld_flg_msg_collect) | = KUPS_FALSE. | |||
Search for further information about these or an SAP related objects