ABAP Keyword Documentation →  ABAP − Reference →  Calling and leaving program units →  Calling ABAP Programs →  Calling Transactions →  CALL TRANSACTION →  Transaction Call - Examples → 

Transaction Call, SPA/GPAParameters

The example shows how to call a transaction using SPA/GPA parameters.

Source Code

REPORT demo_call_transaction_spa_gpa.

PARAMETERS: carrid TYPE spfli-carrid,
            connid TYPE spfli-connid.

CLASS demo DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.

CLASS demo IMPLEMENTATION.
  METHOD main.

    SET PARAMETER ID: 'CAR' FIELD carrid,
                      'CON' FIELD connid.
    TRY.
        CALL TRANSACTION 'DEMO_TRANSACTION' WITH AUTHORITY-CHECK.
      CATCH cx_sy_authorization_error.
        RETURN.
    ENDTRY.

  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  demo=>main( ).

Description

The transaction DEMO_TRANSACTION displays the details for a flight uniquely identified by the airline and the flight number. It is called from within main using the CALL TRANSACTION statement and filled with SPA/GPA parameters as initial values using the SET PARAMETER statement.