Copy Organizational Unit (EC01-style)
org_copyCopies or deletes a whole SAP organizational unit with all dependent customizing through SAP's standard entity copier, with a dry run that lists copied and retest-scope tables.
Instructions
Copy or delete a WHOLE organizational unit including all its dependent customizing, via SAP's standard entity copier (ECOP_ORG_UNITS_IN_THE_DARK) — the exact engine behind EC01/EC02/EC04…, run headlessly through the in-system Customizing Engine.
orgUnit values (org-key DOMAIN): BUKRS company code (EC01), WERKS plant (EC02), CACCD controlling area (EC03), VKORG sales org (EC04), VTWEG distribution channel (EC05), SPART division (EC06), VSTEL shipping point (EC07), LGNUM warehouse no. (EC09), EKORG purchasing org (EC13), LGORT storage location (EC14), MTART material type (EC15).
DRY RUN by default: lists the copier's dependent tables, then the RETEST SCOPE — every customizing table (delivery class C/G/E) keyed on the org domain that the copier does NOT copy, with live source/target row counts (source has rows, target none = retest first), and a summary of application/master-data tables (class A) keyed on it. Run the dry run again after the copy, same source and target, to diff the new unit against the source. commit: true performs the copy and commits.
TRANSPORT: the entity copier records onto a Customizing request it MINTS ITSELF and reports back — it cannot record into a request you supply (a passed transport is ignored). On commit set createTransport: true to acknowledge that; the copier names the request. The copier never overwrites: it fails if the target unit already exists. After the copy, patch unit-specific values (name, currency, country, …) with customizing_apply using values + onlyMissing: false. Needs engine v0.9.9+.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"orgUnit": "<orgUnit>",
"sourceKey": "<sourceKey>"
},
"name": "org_copy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | "copy" (default) duplicates source→target; "delete" removes sourceKey's unit with all dependent entries | |
| commit | No | Actually copy (default: false = dry run) | |
| icfPath | No | SICF path of the engine (default: /sap/bc/zmcp_cust) | |
| orgUnit | Yes | Org-key domain: BUKRS, WERKS, VKORG, VTWEG, SPART, EKORG, LGORT, CACCD, VSTEL, LGNUM, MTART | |
| sourceKey | Yes | Source unit to copy from (e.g. plant 1000). For action: "delete" — the unit to remove. | |
| targetKey | No | New unit to create (e.g. 1010). Not used for delete. On a dry run it may already exist: the retest scope then compares source and target. | |
| autoDeploy | No | Auto-deploy/update the engine class if missing or outdated (default: true) | |
| retestScope | No | List the org-keyed tables the copier leaves alone, with source/target row counts (default: true for a copy, customizing first, then application data, within ~30 s). "customizing" or "application" counts only that part — for a re-run when a large unit (a company code has ~6,000 keyed tables) runs out of time. false = just the copier's table set. | |
| connectionId | No | SAP system connection ID | |
| createTransport | No | Required on commit in a recording client: acknowledge that the copier mints its OWN Customizing request (a supplied transport is not honored). The copier names the request; transportText is not applied. The new request number is reported on completion. |