Get Example source ABAP code based on a different SAP table
Calling Function Modules This example demonstrates how function modules are called.
ABAP_SOURCE_CODE DEMO CL_DEMO_CALL_FUNCTION
ABAP_DESCRIPTION The function modules READ_SPFLI_INTO_TABLE>> and READ_SPFLI_INTO_TABLE_NEW>> read all data from the database table SPFLI>> where the key field CARRID> matches the import parameter id> into the internal tables itab> or jtab>. If no suitable data can be found, exceptions are raised.
In READ_SPFLI_INTO_TABLE>, the non-class-based exception NOT_FOUND> is raised by MESSAGE ... RAISING>>.
In READ_SPFLI_INTO_TABLE_NEW>, the class-based exception is raised CX_NO_FLIGHT_FOUND>> by RAISE EXCEPTION ... MESSAGE>>. CX_NO_FLIGHT_FOUND> implements the interface IF_T100_DYN_MSG>>. Otherwise, the table is passed to the caller as an export parameter. The actual parameters carrier> and itab> or itab> have the same data types as the corresponding interface parameters of the function module. The exceptions are handled. The relevant exception text is accessed in different ways.
In non-class-based exceptions, it is implicitly available via system fields.
In class-based exceptions, it is specified by attributes of the exception object.