Calling Programs, Transactions and Memory

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Real SAP applications are made of many small programs that start each other. A report that lists open expense claims may start a second report that prints one claim, or open the screen of a transaction for the claim the user has just selected. When the first program starts the second, it usually has to hand over a value, such as the number of the claim, and sometimes it has to get a result back. This page explains the three statements that start another program, what happens to the caller while the other program runs, how to hand over data in each direction, and what to check before you let a user run something. It is written for classic Standard ABAP release 8.16, as used on premise and in SAP S/4HANA Private Edition. The statements SUBMIT, CALL TRANSACTION, LEAVE TO TRANSACTION, SET PARAMETER and GET PARAMETER exist only in the Standard ABAP Keyword Documentation. In the ABAP for Cloud Development documentation (release 9.20, 2608) they have no entry, and EXPORT and IMPORT offer only a byte string and an internal table as medium, so in ABAP Cloud you call other code through released classes and APIs instead. After reading you can choose the right call and the right way to pass data, and you can say what each choice does to the caller’s memory.

Before you read

  • Memory Organization and Sessions: user sessions, main sessions and internal sessions, which this page uses without explaining them again.

  • Program Types and Structure: what an executable program (report) is and how the runtime starts it.

  • Data Types and Data Objects: structures and internal tables, which this page stores and passes.

  • Selection screens, the ABAP authorization concept and background processing have pages of their own that come later in this section; this page only names what it needs from them.

Key terms

  • Call sequence: the chain of programs in which each one has called the next and is waiting for it, with the newest at the end; it shares one ABAP memory.

  • Transaction code: a short name, for example SE80, that the system links to a program or a method so that users can start it by typing the name.

  • ABAP memory: the memory area that all programs of one call sequence in one main session can read and write.

  • SAP memory: the user memory that holds the SPA/GPA parameters and that all main sessions of one user session reach.

  • SPA/GPA parameter: a named value of up to 20 characters in the user memory, used to prefill input fields and to pass short values between programs.

  • Data cluster: a group of named data objects stored by EXPORT in a memory medium and read back by IMPORT.

  • Shared memory: an area of one application server instance that many users and programs can read, used for data that is costly to build.

  • Authorization object: a named set of fields that the system compares with the values assigned to a user before it allows an action.

Calling another program: the big picture

ABAP knows two kinds of things you can call by name from a running program. An executable program is a report that you start with SUBMIT. A transaction is a program or a class method that has been linked to a transaction code, and you start it with CALL TRANSACTION or LEAVE TO TRANSACTION. Calling a procedure, that is a method or function module, is a different thing: it runs inside the caller’s own internal session and is described on the pages about modularization.

When you call a program by name, two outcomes are possible for the caller.

  • The caller is interrupted. The new program starts in a new internal session, the caller’s internal session is kept as it was, and when the new program ends the caller continues after the call. The caller and everything it started form a call sequence, and the programs of one call sequence share the ABAP memory. A call sequence can hold at most nine internal sessions; a call that would make a tenth ends the program with a runtime error and deletes the whole call sequence.

  • The caller is ended. The new program takes its place and nothing after the call statement runs.

sequenceDiagram participant U as User participant A as Program A (caller) participant M as ABAP memory (call sequence) participant B as Program B (called) U->>A: start A->>M: EXPORT claim_id A->>B: SUBMIT b AND RETURN Note over A: interrupted, internal session kept B->>M: IMPORT claim_id B-->>A: program ends, session deleted Note over A: continues after SUBMIT A-->>U: finish

The following table puts the three calling statements side by side. All three are documented for classic Standard ABAP.

Statement What happens to the caller Authorization check made for you

SUBMIT rep AND RETURN

Interrupted; the report runs in a new internal session and a new SAP LUW, then control comes back.

Authorization object S_PROGRAM, for the authorization group in the program properties.

SUBMIT rep

Ended, together with its SAP LUW; the submitted report does not return to it.

The same.

CALL TRANSACTION ta

Interrupted; the transaction’s program runs in a new internal session, then control comes back.

Only when you write WITH AUTHORITY-CHECK.

LEAVE TO TRANSACTION ta

Ended; the whole call sequence is left and the ABAP memory is deleted.

Always, and a missing authorization sends an abort message.

An SAP LUW (logical unit of work) is the group of changes that belong together and are saved together. SUBMIT ... AND RETURN and CALL TRANSACTION open a new one for the called program, but they do not start a new database transaction, and the Keyword Documentation therefore advises a COMMIT WORK before the call when update function modules are still registered.

SUBMIT: starting a report

SUBMIT starts an executable program. In its shortest form it names the report and, normally, adds AND RETURN.

SUBMIT zexp_claim_report AND RETURN.

This is a sketch of the call only. It requires an SAP system; not run here.

Three rules from the documentation are worth remembering from the start. The name of the program must be in uppercase when it is held in a variable and written in parentheses, such as SUBMIT (name). If the program does not exist, or is not an executable program, the call ends with a runtime error that you cannot catch. And a name that reaches the program from outside, for example from an input field, is a serious security risk, because the user could start any report; check such a name with the system class CL_ABAP_DYN_PRG before you use it.

Filling the selection screen of the called report

Most reports show a selection screen, the input screen on which a user enters the parameters and the ranges that limit the data. SUBMIT can fill that screen for the user. The Keyword Documentation calls these additions selscreen_options and selscreen_parameters. It names a hierarchy: the values of a variant given with USING SELECTION-SET come first, then the table of WITH SELECTION-TABLE, and last the single values of WITH sel value, so that a later source overwrites an earlier one. The values are passed between the events INITIALIZATION and AT SELECTION-SCREEN OUTPUT of the called report.

Addition Meaning

USING SELECTION-SET variant

Fill every parameter and selection criterion from a saved selection screen variant of the called program.

WITH SELECTION-TABLE rspar

Fill them from a standard table of line type RSPARAMS (or RSPARAMSL_255 for long values) with the columns SELNAME, KIND, SIGN, OPTION, LOW and HIGH.

WITH p_claim EQ value

Set a parameter to one value, or add one line to a selection criterion; the operator may be EQ, NE, CP, NP, GT, GE, LT or LE.

WITH s_date BETWEEN d1 AND d2

Add one interval line to a selection criterion; NOT BETWEEN excludes it.

WITH s_status IN range_tab

Add all lines of a ranges table to a selection criterion.

VIA SELECTION-SCREEN

Show the selection screen to the user, with the values filled in; without it the selection screen events run in the background and the screen is not shown.

The values must be in the internal format of ABAP, for example a date as 20261113, not as the user sees it on the screen. Passing more than one value to a plain PARAMETERS field ends in a runtime error, and so does a value that cannot be converted to the type of the field. The additions take effect only the first time the called program runs: if the called report shows its selection screen, the runtime calls the program again after the screen ends and replaces the values with the user’s input.

A selection criterion, declared with SELECT-OPTIONS, is internally a ranges table: a table whose lines each have sign (include or exclude), option (the comparison, such as EQ or BT), low and high. WITH s_status IN range_tab needs a standard table of exactly that shape, and the statement DATA ... TYPE RANGE OF creates one. The next listing builds the table that you would hand to a report. This listing runs in the local playground; it builds and prints the table but does not call SUBMIT, which the playground does not support. Its output is exactly the three lines shown.

REPORT zp_rng.

* The shape that SUBMIT ... WITH sel IN range_tab expects: a standard table with sign, option, low and high.
TYPES ty_status TYPE c LENGTH 9.
DATA status_range TYPE RANGE OF ty_status.

status_range = VALUE #(
  ( sign = 'I' option = 'EQ' low = 'SUBMITTED' )
  ( sign = 'I' option = 'EQ' low = 'APPROVED' ) ).

LOOP AT status_range INTO DATA(line).
  WRITE / |{ line-sign } { line-option } { line-low }|.
ENDLOOP.

* The call that would hand this table to a report named zexp_report (not run here):
*   SUBMIT zexp_report WITH s_status IN status_range AND RETURN.
WRITE / |lines to pass: { lines( status_range ) }|.

Real output of the listing in the local playground:

I EQ SUBMITTED
I EQ APPROVED
lines to pass: 2

The full call, with a parameter, the ranges table and an extra interval, looks like this. It requires an SAP system; not run here. zexp_claim_report is an example report with PARAMETERS p_claim and SELECT-OPTIONS s_status and s_date.

DATA claim_id TYPE c LENGTH 10 VALUE 'C000000042'.
DATA from_date TYPE d VALUE '20260101'.
DATA to_date TYPE d VALUE '20261231'.
DATA status_range TYPE RANGE OF c.

status_range = VALUE #( ( sign = 'I' option = 'EQ' low = 'SUBMITTED' ) ).

SUBMIT zexp_claim_report
  WITH p_claim  EQ claim_id
  WITH s_status IN status_range
  WITH s_date   BETWEEN from_date AND to_date
  AND RETURN.

Getting the list back

A report normally writes a list to the screen. Two additions change where the basic list goes. EXPORTING LIST TO MEMORY, which works only together with AND RETURN, stores the list in the ABAP memory as an internal table of line type ABAPLIST. After the call you read it with the function module LIST_FROM_MEMORY and can write it into your own list with WRITE_LIST, show it separately with DISPLAY_LIST, or turn it into text with LIST_TO_ASCI. The documentation adds that this works only if the Enter key is not linked to a function code in the called program’s GUI status. TO SAP-SPOOL sends the list to the spool system, and LINE-SIZE and LINE-COUNT set the width and page length of the list. These additions also act only the first time the called program runs, so the documentation advises against combining them with VIA SELECTION-SCREEN. The next sketch requires an SAP system; not run here.

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT zexp_claim_report
  WITH p_claim EQ 'C000000042'
  EXPORTING LIST TO MEMORY
  AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = list_tab
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.
IF sy-subrc = 0.
  CALL FUNCTION 'WRITE_LIST'
    TABLES
      listobject = list_tab.
ENDIF.

Running a report as a background job

VIA JOB job NUMBER n schedules the called program as a background task instead of running it now. It works only with AND RETURN. You obtain the number n from the function module JOB_OPEN, and you finish the job request with JOB_CLOSE. After the call, sy-subrc is 0 when the task was scheduled, 4 when the user cancelled the selection screen, 8 on an error during scheduling and 12 on an error in the number assignment. The background run has its own session, so neither the ABAP memory nor the user memory of the calling program is available there. Background jobs have their own page, Background Processing, in this section; the point here is only that SUBMIT is the statement that connects a program to them.

CALL TRANSACTION: starting a transaction

CALL TRANSACTION starts the program or method linked to a transaction code, in a new internal session of the current call sequence. The caller and its data are kept, and when the transaction is finished the caller continues after the statement. The transaction code must be a flat character-like value in uppercase. If the transaction does not exist, if it is an area menu or if it is locked, the program ends with a runtime error you cannot catch.

The statement has two forms. The simple form takes AND SKIP FIRST SCREEN to hide the first screen. The second form takes a batch input table (USING bdc_tab), which scripts the screens of the transaction; it belongs to data migration and is covered on the batch input page of this section. In both forms, you decide whether the system checks the user’s authorization for the transaction by writing WITH AUTHORITY-CHECK or WITHOUT AUTHORITY-CHECK. Leaving both out is obsolete.

The authority check

With WITH AUTHORITY-CHECK, the system checks the user against the authorization object S_TCODE and against any authorization object that was entered for the transaction code in its definition (transaction SE93) before the transaction starts. If an authorization is missing, it raises the class-based exception CX_SY_AUTHORIZATION_ERROR, which you can catch. The documentation calls this the recommended method; it replaces the older checks with the statement AUTHORITY-CHECK, the function module AUTHORITY_CHECK_TCODE and the table TCDCOUPLES. WITHOUT AUTHORITY-CHECK says openly that no check is needed, and it also stops the extended program check from reporting a missing check; use it only when the transaction is meant for everybody, for example because it only shows public data. The next sketch requires an SAP system; not run here. ZEXP_SHOW is the code of an example transaction that shows one claim.

TRY.
    CALL TRANSACTION 'ZEXP_SHOW' WITH AUTHORITY-CHECK.
  CATCH cx_sy_authorization_error.
    MESSAGE 'You are not allowed to display claims.' TYPE 'I'.
ENDTRY.

Skipping the first screen

Often the user has already chosen the claim, and the first screen of the transaction would ask for it again. Many initial screens have input fields linked to an SPA/GPA parameter, so you can fill the field first with SET PARAMETER and then call with AND SKIP FIRST SCREEN. The first screen is skipped only when its own number is not its static next screen and all its mandatory fields are filled correctly by parameters; otherwise it is shown as usual. This variant does not set sy-subrc. The sketch requires an SAP system; not run here, and it assumes that ZEXP_CLAIM is registered as a parameter ID (see below) and linked to the claim field of the first screen of ZEXP_SHOW.

DATA claim_id TYPE c LENGTH 10 VALUE 'C000000042'.

SET PARAMETER ID 'ZEXP_CLAIM' FIELD claim_id.

TRY.
    CALL TRANSACTION 'ZEXP_SHOW' WITH AUTHORITY-CHECK
                                 AND SKIP FIRST SCREEN.
  CATCH cx_sy_authorization_error.
    RETURN.
ENDTRY.

LEAVE TO TRANSACTION: ending the current work

LEAVE TO TRANSACTION ta starts a transaction and leaves the current call sequence completely. All earlier internal sessions of the sequence are deleted, and the ABAP memory is deleted as well, so you cannot pass data this way with EXPORT and IMPORT; the SPA/GPA parameters of the user memory remain. When the new transaction ends, the runtime returns to the place where the first program of the call sequence was called, and the current SAP LUW is ended. LEAVE TO CURRENT TRANSACTION restarts the running transaction, with its parameters or variant if it is a parameter or variant transaction. Unlike CALL TRANSACTION, LEAVE TO TRANSACTION always checks S_TCODE and the authorization object of the transaction code, and if the user lacks the authorization the system sends an abort message of type A. If the transaction does not exist, or the code is initial, the call sequence is still ended. The call is therefore a one-way jump, useful at the end of a workflow, and it needs a COMMIT WORK or ROLLBACK WORK before it when update function modules are registered. The next line requires an SAP system; not run here.

LEAVE TO TRANSACTION 'ZEXP_SHOW' AND SKIP FIRST SCREEN.

Passing data to a called program

A called program cannot see the variables of its caller, because each internal session has its own data. There are four common ways to hand over data. Pick the one whose reach matches your need.

Way Reach Use it when

Selection screen values (SUBMIT ... WITH)

From the caller to one report, on start only.

You start a report and the values are exactly its parameters and ranges.

ABAP memory (EXPORT and IMPORT with MEMORY ID)

All programs of one call sequence in one main session.

A called program needs structured data or a table that is no selection value, or has to return a result.

SAP memory (SET PARAMETER and GET PARAMETER)

All sessions of one user, but only reliably within one session.

A short value should prefill an input field of a transaction.

Data clusters in other media, shared objects

A byte string, a database table, or the shared memory of one application server instance.

Data must outlive a call sequence, or be shared among users.

For the nesting of user session, main session and internal session, read Memory Organization and Sessions. This page adds the statements in detail.

ABAP memory: EXPORT, IMPORT and DELETE

EXPORT stores a data cluster: one or more data objects, each under a name you choose, in a memory medium. IMPORT reads them back, and DELETE FROM removes them. For the ABAP memory the medium is written MEMORY ID id. The ID is a flat character-like value, case-sensitive and up to 60 characters long; a cluster stored under the same ID overwrites the earlier one completely. A cluster in the ABAP memory is available to all programs of the call sequence, which is what makes it a way to pass data to a called program.

The parameter list of EXPORT has the form name = dobj, and the name on the left is what IMPORT uses to select an object, so the receiving variable may have a different name than the sending one, as long as the types fit. IMPORT sets sy-subrc to 0 when the data cluster was found and 4 when it was not; names that are not in the cluster are ignored. DELETE FROM MEMORY ID sets sy-subrc the same way, and FREE MEMORY ID has the same effect as that statement. The older short forms without ID are obsolete and dangerous: every EXPORT without an ID overwrites the same cluster, and FREE MEMORY without an ID deletes all clusters of the ABAP memory.

The caller and the called report below show the whole cycle for an expense claim. The listings require an SAP system; not run here, because the local playground does not support EXPORT, IMPORT or SUBMIT.

REPORT zexp_caller.

TYPES: BEGIN OF ty_claim,
         claim_id TYPE c LENGTH 10,
         status   TYPE c LENGTH 9,
       END OF ty_claim.

DATA claim TYPE ty_claim.

claim = VALUE #( claim_id = 'C000000042' status = 'SUBMITTED' ).

EXPORT claim = claim TO MEMORY ID 'ZEXP_CLAIM'.

SUBMIT zexp_callee AND RETURN.

* The callee has changed its own copy only; ours is untouched. Clean up the cluster.
DELETE FROM MEMORY ID 'ZEXP_CLAIM'.
REPORT zexp_callee.

TYPES: BEGIN OF ty_claim,
         claim_id TYPE c LENGTH 10,
         status   TYPE c LENGTH 9,
       END OF ty_claim.

DATA received TYPE ty_claim.

IMPORT claim = received FROM MEMORY ID 'ZEXP_CLAIM'.
IF sy-subrc = 0.
  WRITE / |Claim { received-claim_id } has status { received-status }.|.
ELSE.
  WRITE / 'No claim passed in ABAP memory.'.
ENDIF.

The same pattern returns a result: the called report exports a value under an agreed ID and the caller imports it after the SUBMIT ... AND RETURN. It does not work across main sessions, because each has its own ABAP memory, and it does not work after LEAVE TO TRANSACTION or after a SUBMIT that replaces the caller’s session, because the call sequence is gone. Choose an ID with a prefix of your own, such as ZEXP_, so that standard programs do not use the same one.

SAP memory: SET PARAMETER and GET PARAMETER

SAP memory is the user memory that belongs to a whole logon. It stores SPA/GPA parameters: values of up to 20 characters each, named by a parameter ID. The ID is case-sensitive and must exist in the database table TPARA, which acts as a reservation table; you create new IDs in the Object Navigator of the ABAP Workbench in uppercase letters. This reservation is also what lets an input field of a screen name its parameter: a field with the property Set parameter writes its value to the parameter when the user confirms it, and a field with Get parameter is filled from it when the screen is shown. That is why SET PARAMETER can prefill the first screen of a transaction.

GET PARAMETER sets sy-subrc to 0 when the parameter exists and to 4 when it does not, in which case the target field is initialized. The next sketch requires an SAP system; not run here.

DATA claim_ref TYPE c LENGTH 10.

SET PARAMETER ID 'ZEXP_CLAIM' FIELD 'C000000042'.

GET PARAMETER ID 'ZEXP_CLAIM' FIELD claim_ref.
IF sy-subrc <> 0.
  CLEAR claim_ref.
ENDIF.

The statements do not read and write the user memory directly. When a program is rolled in, all parameters are copied to its own session memory, and the two statements work on that local copy. When the program is rolled out, which happens at its end, when it calls another program with SUBMIT, CALL TRANSACTION or LEAVE TO TRANSACTION, at a work process change and at COMMIT WORK, the local copy is written back and replaces the user memory. This has a consequence that the documentation states clearly: parallel sessions of one user can overwrite each other’s parameters, so SAP memory is suited for passing data within one session, not between two windows open at the same time.

Data clusters in other media

EXPORT and IMPORT work with more media than the ABAP memory. The medium is the part after TO or FROM, and the documentation lists six.

Medium Where the cluster is stored

DATA BUFFER xstr

In a variable of type xstring; usable in ABAP Cloud as well.

INTERNAL TABLE itab

In a standard table whose first column is of type s or i and whose second column is of type x; usable in ABAP Cloud as well.

MEMORY ID id

The ABAP memory, as above.

DATABASE dbtab(ar) ID id

In a database table with a predefined export/import structure, in a row area ar of two characters. It is saved by the next database commit.

SHARED MEMORY dbtab(ar) ID id

In a cross-transaction application buffer of the current application server instance; space is freed with DELETE FROM SHARED MEMORY.

SHARED BUFFER dbtab(ar) ID id

In a second application buffer of that instance; when the buffer is full, the system displaces the least used objects itself.

A cluster written to one medium can usually be read only with the matching IMPORT, because the binary content depends on the medium. By default compression is off for every medium except a database table, and COMPRESSION ON or OFF overrides that. A cluster can be at most 2 GB. The documentation notes that EXPORT ... TO DATABASE sets a database lock until the next commit or rollback, which can cause a deadlock when used incorrectly, and that CLIENT must not be used in application programs.

The DATA BUFFER medium is the one to prefer in modern code, because it needs no ID, no memory and no table: you turn a structure or table into a byte string, and the string can be stored in a table column or sent to another system. The sketch requires an SAP system; not run here, because the local playground does not implement EXPORT.

TYPES: BEGIN OF ty_item,
         item_no  TYPE i,
         category TYPE c LENGTH 12,
       END OF ty_item.
TYPES ty_items TYPE STANDARD TABLE OF ty_item WITH EMPTY KEY.

DATA items  TYPE ty_items.
DATA back   TYPE ty_items.
DATA buffer TYPE xstring.

items = VALUE #( ( item_no = 1 category = 'TRAVEL' ) ( item_no = 2 category = 'MEALS' ) ).

EXPORT items = items TO DATA BUFFER buffer.
IMPORT items = back FROM DATA BUFFER buffer.

The DATABASE medium is how some standard applications keep results between runs. It needs a table that has the export/import layout, with the key columns between RELID and SRTF2 and the cluster itself in CLUSTR; you hand the non-cluster columns over with FROM wa and TO wa. The old way, a table work area declared with TABLES, is obsolete. The next sketch requires an SAP system; not run here. zexp_indx stands for a table you created with that layout.

DATA wa TYPE zexp_indx.
DATA items TYPE STANDARD TABLE OF i WITH EMPTY KEY.

items = VALUE #( ( 1 ) ( 2 ) ( 3 ) ).

EXPORT numbers = items TO DATABASE zexp_indx(zz) FROM wa ID 'EXPENSE_RUN_01'.
COMMIT WORK.

IMPORT numbers = items FROM DATABASE zexp_indx(zz) TO wa ID 'EXPENSE_RUN_01'.

Shared objects: data for many users

A data cluster is a copy: each IMPORT builds a new copy in the program’s own memory. Shared objects avoid the copy. They are instances of classes, or anonymous data objects, that live in the shared memory of an application server instance, in the area whose size the profile parameter abap/shared_objects_size_MB sets. Programs of all users on that instance can read them in place. They suit data that is costly to build and rarely changes, such as a table of currencies or the parsed form of a configuration file.

The concepts are these.

  • An area is the template, created with transaction SHMA. Several named area instances can be made from one area, and versioning can keep several versions of an instance.

  • Each area has a global area root class, which holds the data or references to other shared objects. The class of every shared object must be declared SHARED MEMORY ENABLED.

  • The system generates a global area class, a subclass of CL_SHM_AREA, for the area. A program uses an area only through the methods of that class: the static attach methods bind the program to an area instance and return an area handle, and the binding also sets a lock.

  • A read lock, set by ATTACH_FOR_READ, may be held by many sessions at once and ends with DETACH. A change lock, set by ATTACH_FOR_WRITE or ATTACH_FOR_UPDATE, is exclusive: no reader can bind during it unless versioning is on. It ends with DETACH_COMMIT or DETACH_ROLLBACK.

  • The shared memory is limited. When the area is full, the program receives the catchable exception CX_SHM_OUT_OF_MEMORY, so the design should say who writes, when, and how often the data is rebuilt.

The sketch below follows the pattern of the official example: write a value into an area and read it back. zcl_exp_area is the area class generated for an area you define, and zcl_exp_root is its root class with a write and a read method. The sketch requires an SAP system; not run here.

DATA area_handle TYPE REF TO zcl_exp_area.
DATA area_root   TYPE REF TO zcl_exp_root.

TRY.
    " Write once: bind for writing, create the root object in the area, store it, commit.
    zcl_exp_area=>attach_for_write(
      EXPORTING inst_name = 'CATEGORIES'
      RECEIVING handle    = area_handle ).
    CREATE OBJECT area_root AREA HANDLE area_handle.
    area_handle->set_root( area_root ).
    area_root->write( 'TRAVEL' ).
    area_handle->detach_commit( ).

    " Read many times, by any user of this application server instance.
    zcl_exp_area=>attach_for_read(
      EXPORTING inst_name = 'CATEGORIES'
      RECEIVING handle    = area_handle ).
    DATA(category) = area_handle->root->read( ).
    area_handle->detach( ).
  CATCH cx_shm_attach_error.
    " The area could not be bound, for example because a writer holds the lock.
ENDTRY.

The parameter inst_name names the area instance, as in the official example.

What to use instead in ABAP Cloud

The ABAP for Cloud Development Keyword Documentation has no entry for SUBMIT, CALL TRANSACTION, LEAVE TO TRANSACTION, SET PARAMETER or GET PARAMETER. The replacement is not a statement but a design.

  • Pass data in the parameters of a method, and let the calling code create the object it needs.

  • Use EXPORT and IMPORT with DATA BUFFER or INTERNAL TABLE when you have to turn data into a byte string, for example to store or send it.

  • Start follow-up work through a released class or API instead of starting a program by name.

The statements in this page remain valid, and you will keep meeting them, in classic Standard ABAP: on premise, in SAP S/4HANA Private Edition and in the many custom programs that migrate to a clean core only gradually.

Older material you may meet

Books and code written for earlier releases describe the same statements, and they have not changed in substance. What the books show differently are the short forms: EXPORT and IMPORT without ID, FREE MEMORY without ID, a CALL TRANSACTION without WITH or WITHOUT AUTHORITY-CHECK, and a transaction check by the function module AUTHORITY_CHECK_TCODE. All of them still run, and all of them are marked obsolete in the current documentation; write the explicit form in new code. The classic book chapters on the ABAP memory, the SAP memory and data clusters also predate the shared-objects documentation in its current form and say little about the cloud restrictions above.

Summary

  • SUBMIT starts a report, CALL TRANSACTION starts a transaction, and both interrupt the caller, which resumes afterwards when you use SUBMIT ... AND RETURN or CALL TRANSACTION; LEAVE TO TRANSACTION and SUBMIT without AND RETURN end the caller.

  • SUBMIT fills the selection screen of the called report with WITH, WITH SELECTION-TABLE or a variant, can take the list back with EXPORTING LIST TO MEMORY, and can schedule the run with VIA JOB.

  • Write WITH AUTHORITY-CHECK on every CALL TRANSACTION that a user can trigger, and catch CX_SY_AUTHORIZATION_ERROR; LEAVE TO TRANSACTION always checks.

  • Pass structured data through the ABAP memory with EXPORT ... TO MEMORY ID, check sy-subrc after IMPORT, and delete the cluster afterwards; pass short values for screens with SET PARAMETER, but not between parallel windows.

  • A data cluster can also go to a byte string, a table, the database or an application buffer, and shared objects keep one copy of costly data for all users of an application server instance.

  • ABAP Cloud has none of these call statements: use method parameters, released APIs and, for bytes, EXPORT ... TO DATA BUFFER.