Ansicht
Dokumentation
ABAPHANDLER_METH_READ - HANDLER METH READ
BAL Application Log Documentation CPI1466 during BackupThis documentation is copyright by SAP AG.
FOR READ
Handler method definitions:
METHODS meth $[FINAL$]
FOR READ
$[IMPORTING$]
${ REFERENCE(im_par_read) $| im_par_read $}
FOR ${ READ bdef RESULT ${ REFERENCE(res_read) $| res_read $} $}
$| ${ READ bdef\_assoc FULL ${ REFERENCE(full_rba) $| full_rba $}
RESULT ${ REFERENCE(res_rba) $| res_rba $}
LINK ${ REFERENCE(link_rba) $| link_rba $} $}
$| ${ FUNCTION bdef~function $[REQUEST ${ REFERENCE(req_func) $| req_func $}$]
RESULT ${ REFERENCE(res_func)
$| res_func $} $}
$[CHANGING
${ $[failed TYPE data$]
$[reported TYPE data$] $}$].
Variants:
1. ... READ bdef ...
2. ... READ bdef\_assoc ...
3. ... FUNCTION bdef~function ...
Effect
Handler method that is used for read operations in RAP. It must be defined and implemented in a handler class of an ABAP behavior pool. The method name meth can be chosen freely. bdef is the name or the alias of the BDEF, assoc the name of the association, and function the name of a function.
The method parameters can be passed by reference (see REFERENCE), except for the predefined parameters failed and reported.
Additions
1. ... REQUEST ...
2. ... CHANGING ...
Variant 1
... READ bdef ...
Effect
Handles the read requests in RAP read operations. BDEF requirement for the read operations: The entities to be read from must be declared after the notation define behavior for.
Method parameters:
- IMPORTING parameter:
- im_par_read: Includes the entities to be read. It is an internal table of type TYPE TABLE FOR READ IMPORT bdef.
- CHANGING parameters:
- res_read: Mandatory parameter used to store the read result. It must be specified after the ABAP word RESULT and is an internal table of type TYPE TABLE FOR READ RESULT bdef.
- failed and reported are further changing parameters that return information. See the details in section ... CHANGING ....
Variant 2
... READ bdef\_assoc ...
Effect
Handles the read requests in RAP read-by-association operations. BDEF requirement for read-by-association operations: The entities to be read from must be declared after the notation define behavior for.
Method parameters:
- IMPORTING parameters:
- im_par_read: Includes the entities to be read. It is an internal table of type TYPE TABLE FOR READ IMPORT bdef\_assoc.
- full_rba: Used to indicate whether the res_rba parameter, i. e. all target instances, or just the links, i. e. the link_rba parameter, should be retrieved in the context of read-by-association operations. It is a Boolean value of type c with length 1. full_rba specified with 'X' respects all target instances. Note that the explicit specification of the FULL parameter with is only possible for the dynamic form of the READ statement (READ ENTITIES OPERATIONS). With the short form (READ ENTITY) and long form (READ ENTITIES), the explicit specification of the full_rba parameter is not possible. In these cases, the specification is irrelevant because it is specified anyway if the links (link_rba parameter) or the data are requested.
- CHANGING parameters.
- res_rba: Used to store the read result. It must be specified after the ABAP word RESULT and is an internal table of type TYPE TABLE FOR READ RESULT bdef\_assoc.
- link_rba: Used to store the keys of the source and target entities. It is an internal table of type TYPE TABLE FOR READ LINK bdef\_assoc.
- failed and reported are further changing parameters that return information positioned after the CHANGING. See the details in section ... CHANGING ....
The parameters must be specified in the method definition in the following sequence: ... IMPORTING ... FULL ... RESULT ... LINK ... CHANGING ...
Variant 3
... FUNCTION bdef~function ...
Effect
Handles the read requests in the context of functions. See the required BDEF notations for functions in topic CDS BDL - function.
Method parameters:
- IMPORTING parameters:
- im_par_read: Includes the RAP BO instances to be read. It is an internal table of type TYPE TABLE FOR FUNCTION IMPORT bdef~function.
- req_func: Additional parameter whose availability depends on the BDEF specification. See ... REQUEST ...
- CHANGING parameters.
- res_func: Used to store the read result. It must be specified after the ABAP word RESULT and is an internal table of type TYPE TABLE FOR READ RESULT bdef\_assoc.
- failed and reported are further changing parameters that return information positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....
The parameters must be specified in the method definition in the following sequence: ... IMPORTING ... FULL ... RESULT ... LINK ... CHANGING ...
Addition 1
... REQUEST ...
Effect
The addition and the parameter req_func are only available in the context of functions that are
specified with the notation
result selective in the BDEF. req_func is a structure of type TYPE STRUCTURE FOR FUNCTION REQUEST bdef~function.
Addition 2
... CHANGING ...
Effect
The CHANGING parameters failed
and reported are implicitly
available. They are used to return information on failures or messages respectively. It is possible
to specify the parameters with the predefined names failed and reported explicitly following
the ABAP word CHANGING. In this case, the generic type DATA
is used. At runtime, the typed parameters implicitly have the BDEF derived type TYPE RESPONSE FOR.
Example
Examples for RAP handler method definitions. Find demonstrations of method implementations in the executable examples further down.
METHODS read FOR READ
IMPORTING keys FOR READ bdef RESULT result.
METHODS rba_assoc FOR READ
IMPORTING keys_rba FOR READ bdef\_assoc
FULL result_requested RESULT result LINK association_links.
METHODS function1 FOR READ
IMPORTING keys FOR READ bdef~function1 RESULT result.
METHODS function2 FOR READ
IMPORTING keys FOR READ bdef~function2
REQUEST requested_fields RESULT result.
- Example for RAP Handler Methods: Demonstrates this RAP handler method within a RAP handler class using a simple unmanaged RAP BO that is draft-enabled.
RFUMSV00 - Advance Return for Tax on Sales/Purchases CPI1466 during Backup
This documentation is copyright by SAP AG.
Length: 14023 Date: 20240424 Time: 020639 sap01-206 ( 173 ms )