Ansicht
Dokumentation

ABAPHANDLER_METH_MODIFY - HANDLER METH MODIFY

ABAPHANDLER_METH_MODIFY - HANDLER METH MODIFY

ABAP Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

FOR MODIFY

Handler method definitions:

METHODS meth $[FINAL$]
   FOR MODIFY
   $[IMPORTING$] ${ REFERENCE(im_par_mod) $| im_par_mod $}
   FOR ${ CREATE bdef $}
     $| ${ CREATE bdef\_assoc $}
     $| ${ UPDATE bdef $}
     $| ${ DELETE bdef $}
     $| ${ ACTION bdef~action
          $[REQUEST ${ REFERENCE(req_act) $| req_act $} $]
          $[RESULT ${ REFERENCE(res_act) $| res_act $}$] $}
     $| ${ ACTION ${ bdef~activate
                $| bdef~edit
                $| bdef~discard
                $| bdef~resume $} $}
   $[CHANGING ${ $[ failed TYPE data$] $[reported TYPE data$] $[mapped TYPE data$] $}$].


Variants:

1. ... CREATE bdef ...

2. ... CREATE bdef\_assoc ...

3. ... UPDATE ...

4. ... DELETE ...

5. ... ACTION bdef~action ...

6. ... ACTION bdef~activate ...

7. ... ACTION bdef~edit ...

8. ... ACTION bdef~discard ...

9. ... ACTION bdef~resume ...



Additions

1. ... REQUEST ...

2. ... RESULT ...

3. ... CHANGING ...

Effect

Handler methods that are used for changing operations on RAP BO entities and operation augmentation. They must be defined and implemented in a handler class of an ABAP behavior pool. A single method can include multiple, different operations during one processing step. 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 action the name of an action. It is possible to combine operations in one method.

Variant 1

... CREATE bdef ...


Effect

Handles create operations.

See more details and the required BDEF notations for the variant in the following topics:

Method parameters:

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 2

... CREATE bdef\_assoc ...


Effect

Handles create-by-association operations.

See more details and the required BDEF notations for the variant in the following topics:

Method parameters:

  • im_par_mod: Includes the RAP BO instances to be created. It is an internal table of type TYPE TABLE FOR CREATE bdef\_assoc. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 3

... UPDATE bdef ...


Effect

Handles update operations.

See more details and the required BDEF notations for the variant in the following topics:

Method parameters:

  • im_par_mod: Includes the RAP BO instances to be updated. It is an internal table of type TYPE TABLE FOR UPDATE bdef. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 4

... DELETE bdef ...


Effect

Handles delete operations.

See more details and the required BDEF notations for the variant in the following topic: CDS BDL - standard operations.

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances to be deleted. It is an internal table of type TYPE TABLE FOR DELETE bdef. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 5

... ACTION bdef~action ...


Effect

Handles actions.

See more details and the required BDEF notations for the variant in the following topics:

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances for which an action should be executed. It is an internal table of type TYPE TABLE FOR ACTION IMPORT bdef~action. The parameter can also be passed by reference.

  • req_act: See the details in section ... REQUEST ....

  • res_act: See the details in section ... RESULT ....

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 6

... ACTION bdef~activate ...


Effect

Handles the activate action in draft scenarios.

See more details and the required BDEF notations for the variant in the following topic: CDS BDL - draft actions.

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances for which the activate action should be executed. It is an internal table of type TYPE TABLE FOR ACTION IMPORT bdef~activate. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 7

... ACTION bdef~edit ...


Effect

Handles the edit action in draft scenarios.

See more details and the required BDEF notations for the variant in the following topic: CDS BDL - draft actions.

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances for which the edit action should be executed. It is an internal table of type TYPE TABLE FOR ACTION IMPORT bdef~edit. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 8

... ACTION bdef~discard ...


Effect

Handles the discard action in draft scenarios.

See more details and the required BDEF notations for the variant in the following topic: CDS BDL - draft actions.

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances for which the discard action should be executed. It is an internal table of type TYPE TABLE FOR ACTION IMPORT bdef~discard. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Variant 9

... ACTION bdef~resume ...


Effect

Handles the resume action in draft scenarios.

See the required BDEF notations for the variant in the following topic: CDS BDL - draft actions.

Method parameters:

  • im_par_mod: Includes the keys of the RAP BO instances for which the resume action should be executed. It is an internal table of type TYPE TABLE FOR ACTION IMPORT bdef~resume. The parameter can also be passed by reference.

  • failed, reported and mapped are implicit and predefined changing parameters that return information. They are positioned after the ABAP word CHANGING. See the details in section ... CHANGING ....

Addition 1

... REQUEST ...

Effect

The addition and the parameter req_act are only available in the context of non-draft actions that are specified with a parameter in the BDEF. req_act is a structure of type TYPE STRUCTURE FOR GLOBAL FEATURES REQUEST bdef~action.

See more details and the required BDEF notations for the variant in the following topics:

Addition 2

... RESULT ...

Effect

The addition and the parameter res_act are only available in the context of non-draft actions that are specified with a result in the BDEF. res_act is an internal table of type TYPE TABLE FOR ACTION RESULT bdef~action. The parameter can also be passed by reference.

See more details and the required BDEF notations for the variant in the following topics:

Addition 3

... 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. The first example in the code below shows a handler method definition combining multiple operations in one method.

METHODS modify FOR MODIFY
    IMPORTING ent_cr FOR CREATE bdef
              ent_upd FOR UPDATE bdef
              keys FOR DELETE bdef.


METHODS create FOR MODIFY
    IMPORTING entities FOR CREATE bdef.


METHODS cba_child FOR MODIFY
    IMPORTING entities_cba FOR CREATE bdef\_child.


METHODS update FOR MODIFY
    IMPORTING entities FOR UPDATE bdef.


METHODS delete FOR MODIFY
    IMPORTING keys FOR DELETE bdef.


METHODS action1 FOR MODIFY
    IMPORTING keys FOR CREATE bdef~action1.


METHODS action2 FOR MODIFY
    IMPORTING keys FOR CREATE bdef~action2 RESULT result.


METHODS action3 FOR MODIFY
    IMPORTING keys FOR CREATE bdef~action3
    REQUEST requested_fields RESULT result.


METHODS activate FOR MODIFY
    IMPORTING keys FOR ACTION bdef~activate.


METHODS discard FOR MODIFY
    IMPORTING keys FOR ACTION bdef~discard.


METHODS create FOR MODIFY
    IMPORTING entities FOR CREATE bdef.


METHODS edit FOR MODIFY
    IMPORTING keys FOR ACTION bdef~edit.


METHODS resume FOR MODIFY
    IMPORTING keys FOR ACTION bdef~resume.

  • The example ABAP EML - MODIFY AUGMENTING ENTITY demonstrates the three handler methods augment_create, augment_update and augment_cba_assoc (assoc refers to the name of the association) with a RAP projection business object.





Fill RESBD Structure from EBP Component Structure   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 24167 Date: 20240616 Time: 102010     sap01-206 ( 472 ms )