SAP UPSCU_PACKAGE_MAINTAIN Function Module for
UPSCU_PACKAGE_MAINTAIN is a standard upscu package maintain 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 package maintain FM, simply by entering the name UPSCU_PACKAGE_MAINTAIN 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_PACKAGE_MAINTAIN 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_PACKAGE_MAINTAIN'".
EXPORTING
IM_INSTID = "ALE Distribution Packet: ID for Instantiation
* FLG_MSG_COLLECT = KUPS_FALSE "Collect accumulated messages
* FLG_SRC_IMPORT = KUPS_FALSE "
* FLG_PRE_IMPORT = KUPS_FALSE "
* IM_HANDLE = "Reference to application log
* FLG_SET_UPSSTS_NEW = KUPS_FALSE "Set packet status to 'new'
* FLG_SYNC_OBJLIST = KUPS_TRUE "Synchronize object list
* IM_VRGNG = ' ' "Business Transaction
IMT_APIITM = "Object List
* IMT_APISRC = "
* IMT_APIPRE = "ALE Distribution Packet: Predecessor (Input Structure)
* FLG_COMMIT_AND_WAIT = KUPS_TRUE "Send COMMIT AND WAIT
* FLG_APPL_LOG = KUPS_FALSE "Write application log
* FLG_DOCNUM_UPDATE = KUPS_FALSE "Identify object IDocs
* FLG_SERIAL_UPDATE = KUPS_FALSE "
* FLG_LOCK_PACKAGE = KUPS_FALSE "Lock packet against changes
IMPORTING
EX_MESSAGES = "Output list
CHANGING
CH_APIHDR = "ALE Distribution Packet: Header Data (Input Structure)
EXCEPTIONS
FAILING_INSTANCE = 1 ERROR = 2 NO_CHANGE = 3 NO_AUTHORITY = 4
IMPORTING Parameters details for UPSCU_PACKAGE_MAINTAIN
IM_INSTID - ALE Distribution Packet: ID for Instantiation
Data type: UPS_INSTIDOptional: No
Call by Reference: Yes
FLG_MSG_COLLECT - Collect accumulated messages
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_SRC_IMPORT -
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_PRE_IMPORT -
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
IM_HANDLE - Reference to application log
Data type: BALLOGHNDLOptional: Yes
Call by Reference: Yes
FLG_SET_UPSSTS_NEW - Set packet status to 'new'
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_SYNC_OBJLIST - Synchronize object list
Data type: XFELDDefault: KUPS_TRUE
Optional: Yes
Call by Reference: Yes
IM_VRGNG - Business Transaction
Data type: TJ01-VRGNGDefault: ' '
Optional: Yes
Call by Reference: Yes
IMT_APIITM - Object List
Data type: API_TUPSITMOptional: No
Call by Reference: Yes
IMT_APISRC -
Data type: API_TUPSSRCOptional: Yes
Call by Reference: Yes
IMT_APIPRE - ALE Distribution Packet: Predecessor (Input Structure)
Data type: API_TUPSPREOptional: Yes
Call by Reference: Yes
FLG_COMMIT_AND_WAIT - Send COMMIT AND WAIT
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_DOCNUM_UPDATE - Identify object IDocs
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_SERIAL_UPDATE -
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
FLG_LOCK_PACKAGE - Lock packet against changes
Data type: XFELDDefault: KUPS_FALSE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for UPSCU_PACKAGE_MAINTAIN
EX_MESSAGES - Output list
Data type: TUPSBAPIRET2Optional: No
Call by Reference: Yes
CHANGING Parameters details for UPSCU_PACKAGE_MAINTAIN
CH_APIHDR - ALE Distribution Packet: Header Data (Input Structure)
Data type: API_UPSHDROptional: No
Call by Reference: Yes
EXCEPTIONS details
FAILING_INSTANCE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR - Unspecified Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_CHANGE - Packet has been opened for display only
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)
Copy and paste ABAP code example for UPSCU_PACKAGE_MAINTAIN 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_ch_apihdr | TYPE API_UPSHDR, " | |||
| lv_im_instid | TYPE UPS_INSTID, " | |||
| lv_ex_messages | TYPE TUPSBAPIRET2, " | |||
| lv_failing_instance | TYPE TUPSBAPIRET2, " | |||
| lv_flg_msg_collect | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_src_import | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_pre_import | TYPE XFELD, " KUPS_FALSE | |||
| lv_im_handle | TYPE BALLOGHNDL, " | |||
| lv_flg_set_upssts_new | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_sync_objlist | TYPE XFELD, " KUPS_TRUE | |||
| lv_im_vrgng | TYPE TJ01-VRGNG, " ' ' | |||
| lv_error | TYPE TJ01, " | |||
| lv_imt_apiitm | TYPE API_TUPSITM, " | |||
| lv_no_change | TYPE API_TUPSITM, " | |||
| lv_imt_apisrc | TYPE API_TUPSSRC, " | |||
| lv_imt_apipre | TYPE API_TUPSPRE, " | |||
| lv_no_authority | TYPE API_TUPSPRE, " | |||
| lv_flg_commit_and_wait | TYPE XFELD, " KUPS_TRUE | |||
| lv_flg_appl_log | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_docnum_update | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_serial_update | TYPE XFELD, " KUPS_FALSE | |||
| lv_flg_lock_package | TYPE XFELD. " KUPS_FALSE |
|   CALL FUNCTION 'UPSCU_PACKAGE_MAINTAIN' " |
| EXPORTING | ||
| IM_INSTID | = lv_im_instid | |
| FLG_MSG_COLLECT | = lv_flg_msg_collect | |
| FLG_SRC_IMPORT | = lv_flg_src_import | |
| FLG_PRE_IMPORT | = lv_flg_pre_import | |
| IM_HANDLE | = lv_im_handle | |
| FLG_SET_UPSSTS_NEW | = lv_flg_set_upssts_new | |
| FLG_SYNC_OBJLIST | = lv_flg_sync_objlist | |
| IM_VRGNG | = lv_im_vrgng | |
| IMT_APIITM | = lv_imt_apiitm | |
| IMT_APISRC | = lv_imt_apisrc | |
| IMT_APIPRE | = lv_imt_apipre | |
| FLG_COMMIT_AND_WAIT | = lv_flg_commit_and_wait | |
| FLG_APPL_LOG | = lv_flg_appl_log | |
| FLG_DOCNUM_UPDATE | = lv_flg_docnum_update | |
| FLG_SERIAL_UPDATE | = lv_flg_serial_update | |
| FLG_LOCK_PACKAGE | = lv_flg_lock_package | |
| IMPORTING | ||
| EX_MESSAGES | = lv_ex_messages | |
| CHANGING | ||
| CH_APIHDR | = lv_ch_apihdr | |
| EXCEPTIONS | ||
| FAILING_INSTANCE = 1 | ||
| ERROR = 2 | ||
| NO_CHANGE = 3 | ||
| NO_AUTHORITY = 4 | ||
| . " UPSCU_PACKAGE_MAINTAIN | ||
ABAP code using 7.40 inline data declarations to call FM UPSCU_PACKAGE_MAINTAIN
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.| DATA(ld_flg_msg_collect) | = KUPS_FALSE. | |||
| DATA(ld_flg_src_import) | = KUPS_FALSE. | |||
| DATA(ld_flg_pre_import) | = KUPS_FALSE. | |||
| DATA(ld_flg_set_upssts_new) | = KUPS_FALSE. | |||
| DATA(ld_flg_sync_objlist) | = KUPS_TRUE. | |||
| "SELECT single VRGNG FROM TJ01 INTO @DATA(ld_im_vrgng). | ||||
| DATA(ld_im_vrgng) | = ' '. | |||
| DATA(ld_flg_commit_and_wait) | = KUPS_TRUE. | |||
| DATA(ld_flg_appl_log) | = KUPS_FALSE. | |||
| DATA(ld_flg_docnum_update) | = KUPS_FALSE. | |||
| DATA(ld_flg_serial_update) | = KUPS_FALSE. | |||
| DATA(ld_flg_lock_package) | = KUPS_FALSE. | |||
Search for further information about these or an SAP related objects