ABAP - Keyword Documentation → ABAP RAP Business Objects → ABAP for RAP Business Objects → ABAP for Providing RAP Business Objects → ABAP Behavior Pools (ABP) → RAP Handler Classes and Methods → METHODS, FOR, RAP Handler Methods → 

    FOR VALIDATE, RAP Handler Method

    Syntax


    Handler method definitions:

    METHODS meth [FINAL] 
       FOR VALIDATE ON SAVE
       [IMPORTING] { REFERENCE(im_par_val) | im_par_val } 
       FOR bdef~val
       [CHANGING { [failed TYPE data] [reported TYPE data] }].

    Description


    Handler method that is used for the validations. 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 and val is the name of the validation.

    Method Parameters

    • IMPORTING parameters:
    • CHANGING parameters:
      • The CHANGING parameters failed and reported (RAP response parameters) are implicitly available. It is possible to specify the parameters with the predefined names failed and reported explicitly following the ABAP word CHANGING. The generic type DATA can be specified. At runtime, the typed parameters implicitly have the BDEF derived type TYPE RESPONSE FOR. Instead of DATA, a data type of type TYPE RESPONSE FOR can be specified.

    BDEF Requirements

    See the required BDEF notations for both variants in the topic RAP - validation.

    Example


    Example for a RAP handler method definition. Find demonstrations of method implementations in the executable examples further down.

    ...
    METHODS det_on_save FOR VALIDATE ON SAVE
        IMPORTING keys FOR bdef~val.
    ...

    Executable Examples