The ABAP command introduces a block of ABAP statements. The block must end with ENDABAP. ABAP statements within an ABAP...ENDABAP block are called inline ABAP. Only ABAP statements are permitted within the block. No other statements are permitted on the same line as this command.
You can reference local variables from within an ABAP...ENDABAP block. If you want to pass values from inline ABAP to import or export parameters, do it through local variables.
We recommend that you place inline ABAP in a separate script and call it from the main script using the REF command. You can then assign a target system to the REF command and ensure that the referenced data types of the local variables exist in the specified target system.
You can have more than one inline ABAP block in a test script. Data declared locally in one inline ABAP block is not visible in the other inline ABAP blocks.
The inline ABAP is executed in the system to which the test script is allocated at runtime.
The contents of an inline ABAP block are not checked by the standard eCATT syntax checker. To check the ABAP syntax, choose Test script ® Check ® Extended.
In this example, inline ABAP is used to read a record from a table and assign a value to an eCATT-defined local variable (CARRIER_ID).
DATA wa_spfli TYPE spfli.
SELECT SINGLE * FROM spfli INTO wa_spfli.
CARRIER_ID = wa_spfli-carrid.
LOG ( CARRIER_ID ).