SAP BAPI_ECOP_ORG_UNITS Function Module for RFC call from ECOP
BAPI_ECOP_ORG_UNITS is a standard bapi ecop org units SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for RFC call from ECOP 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 bapi ecop org units FM, simply by entering the name BAPI_ECOP_ORG_UNITS into the relevant SAP transaction such as SE37 or SE38.
Function Group: ECOP
Program Name: SAPLECOP
Main Program: SAPLECOP
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_ECOP_ORG_UNITS 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 'BAPI_ECOP_ORG_UNITS'"RFC call from ECOP.
EXPORTING
* IV_ORG_OBJECT = "Org.Object: DDIC domain
* IV_RETURN_IMG_ACTIVITIES = ' ' "Return IMG activities
* IV_STRUCTURE_MODE = ' ' "Structure mode on
IV_ACTION = "Action: COPY, DELE, SCOP, SDEL
* IV_TR_REQUEST = "Transport request
* IV_TR_TASK = "Transport task
* IV_BUSINESS_OBJECT = "Org.Object: BOR object
* IV_ENTITY_TAB = "Entity table
* IV_SOURCE_ORGUNIT = "From Value
* IV_TARGET_ORGUNIT = "To value
* IV_COMMIT_WORK = ' ' "Commit Work (individual mode)
IMPORTING
EV_RETURN_CODE = "Return code
EV_DESCRIPTION = "Object name (individual mode)
EV_ORG_UNIT = "Org.Object: DDIC domains
EV_TR_REQUEST = "Selected transport request
EV_TR_TASK = "Selected transport task
TABLES
* IMG_ACTIVITIES = "IMG Activities
* P_ORGLIST = "List of Org.objects
* P_VALUELIST = "List of object values
* IV_OBJECTLIST = "Business objects in Parent-Child form
* EV_OBJ_ACT_LIST = "
EXCEPTIONS
NO_VALID_ORGUNIT = 1 LOCKING_ERROR = 10 WRONG_CATEGORY = 11 SOURCE_UNIT_DOES_NOT_EXIST = 12 TARGET_UNIT_EXISTS = 13 GLOBAL_CHECK_FAILED = 14 INVALID_ORGTYPE = 15 NO_MODIFICATIONS_ALLOWED = 16 NO_TRANSPORTS_ALLOWED = 17 DOUBLE_ORG_OBJECT = 18 INVALID_STRUCTURE = 19 INVALID_ACTION = 2 OTHER_CANCEL_ERROR = 20 NO_TABLES = 3 DB_ERROR_ON_INSERT = 4 DB_ERROR_ON_DELETE = 5 NO_TR_REQUEST = 6 TRANSPORT_ERROR = 7 NO_AUTHORIZATION = 8 UNALLOWED_USER = 9
IMPORTING Parameters details for BAPI_ECOP_ORG_UNITS
IV_ORG_OBJECT - Org.Object: DDIC domain
Data type: DOMNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_RETURN_IMG_ACTIVITIES - Return IMG activities
Data type: CHAR1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_STRUCTURE_MODE - Structure mode on
Data type: CHAR1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_ACTION - Action: COPY, DELE, SCOP, SDEL
Data type: CHAR4Optional: No
Call by Reference: No ( called with pass by value option)
IV_TR_REQUEST - Transport request
Data type: TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TR_TASK - Transport task
Data type: TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_BUSINESS_OBJECT - Org.Object: BOR object
Data type: SWO_OBJTYPOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_ENTITY_TAB - Entity table
Data type: TABNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_SOURCE_ORGUNIT - From Value
Data type: CHAR20Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_TARGET_ORGUNIT - To value
Data type: CHAR20Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMIT_WORK - Commit Work (individual mode)
Data type: CHAR1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_ECOP_ORG_UNITS
EV_RETURN_CODE - Return code
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
EV_DESCRIPTION - Object name (individual mode)
Data type: SCRTEXT_MOptional: No
Call by Reference: No ( called with pass by value option)
EV_ORG_UNIT - Org.Object: DDIC domains
Data type: DOMNAMEOptional: No
Call by Reference: No ( called with pass by value option)
EV_TR_REQUEST - Selected transport request
Data type: TRKORROptional: No
Call by Reference: No ( called with pass by value option)
EV_TR_TASK - Selected transport task
Data type: TRKORROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_ECOP_ORG_UNITS
IMG_ACTIVITIES - IMG Activities
Data type: ECOP_IMG_ACTIVITYOptional: Yes
Call by Reference: No ( called with pass by value option)
P_ORGLIST - List of Org.objects
Data type: ECOP_ORGLISTOptional: Yes
Call by Reference: No ( called with pass by value option)
P_VALUELIST - List of object values
Data type: ECOP_VALUELISTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_OBJECTLIST - Business objects in Parent-Child form
Data type: ECOP_BUS_HIEROptional: Yes
Call by Reference: No ( called with pass by value option)
EV_OBJ_ACT_LIST -
Data type: ECOP_OBJECT_ACT_LISTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_VALID_ORGUNIT - Invalid DDIC domains
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCKING_ERROR - Lock error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_CATEGORY - Wron transport category (CUST/SYST)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SOURCE_UNIT_DOES_NOT_EXIST - Source object does not exist (individual mode)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TARGET_UNIT_EXISTS - Target object exists (indivdual mode)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GLOBAL_CHECK_FAILED - Global check error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_ORGTYPE - Invalid object type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_MODIFICATIONS_ALLOWED - No changes allowed in system
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TRANSPORTS_ALLOWED - No transports allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DOUBLE_ORG_OBJECT - Specified domain and object type inconsistent
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_STRUCTURE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_ACTION - Invalid action
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OTHER_CANCEL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TABLES - No tables exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DB_ERROR_ON_INSERT - Database insert error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DB_ERROR_ON_DELETE - Database Error During Deletion
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TR_REQUEST - No transport request selected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TRANSPORT_ERROR - Transport error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORIZATION - No authorization
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNALLOWED_USER - User not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_ECOP_ORG_UNITS 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_iv_org_object | TYPE DOMNAME, " | |||
| lv_ev_return_code | TYPE SY-SUBRC, " | |||
| lt_img_activities | TYPE STANDARD TABLE OF ECOP_IMG_ACTIVITY, " | |||
| lv_no_valid_orgunit | TYPE ECOP_IMG_ACTIVITY, " | |||
| lv_locking_error | TYPE ECOP_IMG_ACTIVITY, " | |||
| lv_iv_return_img_activities | TYPE CHAR1, " SPACE | |||
| lv_wrong_category | TYPE CHAR1, " | |||
| lv_iv_structure_mode | TYPE CHAR1, " SPACE | |||
| lv_source_unit_does_not_exist | TYPE CHAR1, " | |||
| lv_target_unit_exists | TYPE CHAR1, " | |||
| lv_global_check_failed | TYPE CHAR1, " | |||
| lv_invalid_orgtype | TYPE CHAR1, " | |||
| lv_no_modifications_allowed | TYPE CHAR1, " | |||
| lv_no_transports_allowed | TYPE CHAR1, " | |||
| lv_double_org_object | TYPE CHAR1, " | |||
| lv_invalid_structure | TYPE CHAR1, " | |||
| lv_iv_action | TYPE CHAR4, " | |||
| lt_p_orglist | TYPE STANDARD TABLE OF ECOP_ORGLIST, " | |||
| lv_ev_description | TYPE SCRTEXT_M, " | |||
| lv_invalid_action | TYPE SCRTEXT_M, " | |||
| lv_other_cancel_error | TYPE SCRTEXT_M, " | |||
| lv_no_tables | TYPE SCRTEXT_M, " | |||
| lv_ev_org_unit | TYPE DOMNAME, " | |||
| lt_p_valuelist | TYPE STANDARD TABLE OF ECOP_VALUELIST, " | |||
| lv_iv_tr_request | TYPE TRKORR, " | |||
| lv_iv_tr_task | TYPE TRKORR, " | |||
| lv_ev_tr_request | TYPE TRKORR, " | |||
| lt_iv_objectlist | TYPE STANDARD TABLE OF ECOP_BUS_HIER, " | |||
| lv_db_error_on_insert | TYPE ECOP_BUS_HIER, " | |||
| lv_ev_tr_task | TYPE TRKORR, " | |||
| lt_ev_obj_act_list | TYPE STANDARD TABLE OF ECOP_OBJECT_ACT_LIST, " | |||
| lv_db_error_on_delete | TYPE ECOP_OBJECT_ACT_LIST, " | |||
| lv_iv_business_object | TYPE SWO_OBJTYP, " | |||
| lv_iv_entity_tab | TYPE TABNAME, " | |||
| lv_no_tr_request | TYPE TABNAME, " | |||
| lv_transport_error | TYPE TABNAME, " | |||
| lv_iv_source_orgunit | TYPE CHAR20, " | |||
| lv_no_authorization | TYPE CHAR20, " | |||
| lv_iv_target_orgunit | TYPE CHAR20, " | |||
| lv_iv_commit_work | TYPE CHAR1, " SPACE | |||
| lv_unallowed_user | TYPE CHAR1. " |
|   CALL FUNCTION 'BAPI_ECOP_ORG_UNITS' "RFC call from ECOP |
| EXPORTING | ||
| IV_ORG_OBJECT | = lv_iv_org_object | |
| IV_RETURN_IMG_ACTIVITIES | = lv_iv_return_img_activities | |
| IV_STRUCTURE_MODE | = lv_iv_structure_mode | |
| IV_ACTION | = lv_iv_action | |
| IV_TR_REQUEST | = lv_iv_tr_request | |
| IV_TR_TASK | = lv_iv_tr_task | |
| IV_BUSINESS_OBJECT | = lv_iv_business_object | |
| IV_ENTITY_TAB | = lv_iv_entity_tab | |
| IV_SOURCE_ORGUNIT | = lv_iv_source_orgunit | |
| IV_TARGET_ORGUNIT | = lv_iv_target_orgunit | |
| IV_COMMIT_WORK | = lv_iv_commit_work | |
| IMPORTING | ||
| EV_RETURN_CODE | = lv_ev_return_code | |
| EV_DESCRIPTION | = lv_ev_description | |
| EV_ORG_UNIT | = lv_ev_org_unit | |
| EV_TR_REQUEST | = lv_ev_tr_request | |
| EV_TR_TASK | = lv_ev_tr_task | |
| TABLES | ||
| IMG_ACTIVITIES | = lt_img_activities | |
| P_ORGLIST | = lt_p_orglist | |
| P_VALUELIST | = lt_p_valuelist | |
| IV_OBJECTLIST | = lt_iv_objectlist | |
| EV_OBJ_ACT_LIST | = lt_ev_obj_act_list | |
| EXCEPTIONS | ||
| NO_VALID_ORGUNIT = 1 | ||
| LOCKING_ERROR = 10 | ||
| WRONG_CATEGORY = 11 | ||
| SOURCE_UNIT_DOES_NOT_EXIST = 12 | ||
| TARGET_UNIT_EXISTS = 13 | ||
| GLOBAL_CHECK_FAILED = 14 | ||
| INVALID_ORGTYPE = 15 | ||
| NO_MODIFICATIONS_ALLOWED = 16 | ||
| NO_TRANSPORTS_ALLOWED = 17 | ||
| DOUBLE_ORG_OBJECT = 18 | ||
| INVALID_STRUCTURE = 19 | ||
| INVALID_ACTION = 2 | ||
| OTHER_CANCEL_ERROR = 20 | ||
| NO_TABLES = 3 | ||
| DB_ERROR_ON_INSERT = 4 | ||
| DB_ERROR_ON_DELETE = 5 | ||
| NO_TR_REQUEST = 6 | ||
| TRANSPORT_ERROR = 7 | ||
| NO_AUTHORIZATION = 8 | ||
| UNALLOWED_USER = 9 | ||
| . " BAPI_ECOP_ORG_UNITS | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_ECOP_ORG_UNITS
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 SUBRC FROM SY INTO @DATA(ld_ev_return_code). | ||||
| DATA(ld_iv_return_img_activities) | = ' '. | |||
| DATA(ld_iv_structure_mode) | = ' '. | |||
| DATA(ld_iv_commit_work) | = ' '. | |||
Search for further information about these or an SAP related objects