What is a behavior pool? Explain handler and saver classes and the method types you use.
Say your answer out loud first.
Practise another way
A behavior pool is the ABAP class that holds the code for a behavior definition. Its logic lives in local classes in the CCIMP include.
The local handler class inherits from CL_ABAP_BEHAVIOR_HANDLER and serves the interaction phase, with methods typed FOR MODIFY, FOR READ, FOR VALIDATE, FOR DETERMINE, FOR LOCK and the authorization and feature methods. The local saver class inherits from CL_ABAP_BEHAVIOR_SAVER and serves the save sequence.
A behavior pool (ABP) is a special global class, named for the BDEF, declared FOR BEHAVIOR OF <bdef>. Its global part is usually empty. The code sits in the local types include (CCIMP).
Handler class (INHERITING FROM cl_abap_behavior_handler)
- Runs in the interaction phase and works on the buffer.
- Methods are typed by
FOR ...and receivekeysorentitiesplusfailed,reported:FOR MODIFY: create, update, delete, actions, create-by-association (unmanaged needs all of them).FOR READ: unmanaged reads and read-by-association.FOR VALIDATE ON SAVE,FOR DETERMINE ON MODIFY|ON SAVE: validations and determinations.FOR LOCK: only whenlock master unmanaged.FOR GLOBAL AUTHORIZATION,FOR INSTANCE AUTHORIZATION: authorization.FOR INSTANCE FEATURES,FOR GLOBAL FEATURES: dynamic feature control.FOR NUMBERING: unmanaged early numbering.
Saver class (INHERITING FROM cl_abap_behavior_saver)
- Runs in the save sequence, in this order:
finalize,check_before_save, then (late phase)adjust_numbers,saveorsave_modified, andcleanup.cleanup_finalizeruns if an early save method failed. - There is one saver class per BO, even if each entity has its own behavior pool.
What managed needs
- Usually only handler methods for your own logic. Saver methods appear only with additional or unmanaged save, or late numbering.
CLASS lhc_travel DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
METHODS check_dates FOR VALIDATE ON SAVE
IMPORTING keys FOR Travel~check_dates.
ENDCLASS.
CLASS lhc_travel IMPLEMENTATION.
METHOD check_dates.
READ ENTITIES OF zr_travel IN LOCAL MODE
ENTITY Travel FIELDS ( BeginDate EndDate )
WITH CORRESPONDING #( keys ) RESULT DATA(travels).
LOOP AT travels INTO DATA(t) WHERE EndDate < BeginDate.
APPEND VALUE #( %tky = t-%tky ) TO failed-travel.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
Tip: ADT generates the method declarations and empty implementations from the BDEF with a quick fix, so you do not type the signatures by hand.
Separates handler and saver by phase, names the method types by purpose, and knows managed needs few of them.
Says 'handler class for create/update and saver class for saving' and cannot name the validation or authorization methods.
Putting database writes into handler methods. Handlers only change the buffer, and data goes to the database in the saver.
- Why is there only one saver class per BO?
- What is save_modified and when is it called?
- When do you need FOR LOCK?
- Where can you declare the behavior pool for a single entity?
2 official pages and 1 prep guide. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.