createAndWrite
Creates an ABAP object and writes its source in one call, preventing empty shells: validates names, locks, writes source, unlocks, and activates. Handles failure steps transparently.
Instructions
Create an object and put its source in it, in one call: validate the name, create, lock, write the source, unlock, activate with verification. Creating and writing are separate calls in ADT, and an object created without source is an empty shell that fails activation - this keeps the two halves together. Report includes (PROG/I) are created the way createInclude does it, so they work here too; pass mainProgram. Nothing is rolled back on failure: the answer says which step stopped it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Object name, e.g. ZCL_APP_FOO. | |
| dryRun | No | Validate the name and report the URLs that would be used, creating nothing. | |
| source | Yes | The complete source of the object. For a class this is the whole CLASS ... ENDCLASS pair, definition and implementation. | |
| objtype | Yes | ADT type: CLAS/OC, INTF/OI, PROG/P, PROG/I, FUGR/F, FUGR/FF or FUGR/I. | |
| activate | No | Activate at the end (default true). | |
| language | No | Language of the description, and the master language of the object. Defaults to the logon language - the underlying library would use EN, which files the texts under a language the developer may never read. | |
| transport | No | Transport request number - the request itself, not a developer task. Not needed in $TMP. | |
| description | Yes | Short description. | |
| mainProgram | No | For PROG/I: the program the include belongs to. Required for an include, ignored otherwise. | |
| packageName | Yes | Development package. $TMP needs no transport. | |
| responsible | No | Responsible user; defaults to the logon user. | |
| functionGroup | No | For FUGR/FF and FUGR/I: the function group holding the object. |