Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abap objects

Former Member
0 Likes
1,034

hi,

what is set handler .

what CLASS cls_definition DEFINITION DEFERRED .

what is the explanation of the below statement:

CALL METHOD grid1->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified.

thanks,

ganesh

Message was edited by:

ganesh ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
995

Hi Ganesh,

Set Handler statement is used for registering and deregistering event handler methods dynamically at runtime.

CLASS cls_definition DEFINITION DEFERRED is used to declare a class first & then define it later.

The last statement basically registers a event for modifying a Editable grid.

Regards,

Chetan.

PS: Reward points if this helps.

7 REPLIES 7
Read only

Former Member
0 Likes
995

Hi ,

The command set handler is used to set a handler for an event , so that the event can be handled.

Class definition defered means that you can use the class even if it is not defined now , it will be defined later in the code.

Regards

Arun

Read only

Former Member
0 Likes
995

SET HANDLER - Set the event handler(Method that is to be called on a trigger of an event) for a particular event

CLASS cls_definition DEFINITION DEFERRED.

--- DEFINITION DEFERRED : Class's method definition are not completed/defined. They are to be defined in a later part of a program.

grid1->register_edit_event - To raise an event when the ALV grid data is being modified.

Regards

Wenceslaus

Read only

Former Member
0 Likes
995

Hello Ganesh,

Check this..

I would like to add the following remarks:

(1) Special registration of an event for ALV grid control (see sample report BCALV_EDIT_03)

*§3.Optionally register ENTER to raise event DATA_CHANGED.

  • (Per default the user may check data by using the check icon).

call method g_grid->register_edit_event

exporting

i_event_id = cl_gui_alv_grid=>mc_evt_enter.

(2) Coding of method SET_REGISTERED_EVENTS in CL_GUI_ALV_GRID:

METHOD SET_REGISTERED_EVENTS.

*!!! Do not use for ALV Grid Control !!!!

RAISE ILLEGAL_EVENT_COMBINATION.

ENDMETHOD.

reward if usefull..

Regards,

srini

Read only

Former Member
Read only

Former Member
0 Likes
995

Hello,

Set Handler is used to register/deregsiter the event handler method for all/selected objects of a class.

DEFERRED addition is used with the class definition to indicate to the compiler that the definition of the class available later. This allows you to use the class before it is actually defined.

Regards,

Manoj

Read only

Former Member
0 Likes
995

Hi Ganesh,

SET HANDLER h1 h2 ... ...

It links a list of handler methods with corresponding trigger methods. There are four different types of event.

It can be

· An instance event declared in a class

· An instance event declared in an interface

· A static event declared in a class

· A static event declared in an interface

The syntax and effect of the SET HANDLERdepends on which of the four cases listed above applies.

For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler. You can either specify a single instance as the trigger, using a reference variable ref:

SET HANDLER h1 h2 ... FOR ref.

or you can register the handler for all instances that can trigger the event:

SET HANDLER h1 h2 ... FOR ALL INSTANCES.

The registration then applies even to triggering instances that have not yet been created when you register the handler.

You cannot use the FOR addition for static events:

SET HANDLER h1 h2 ...

The registration applies automatically to the whole class, or to all of the classes that implement the interface containing the static event. In the case of interfaces, the registration also applies to classes that are not loaded until after the handler has been registered

http://help.sap.com/saphelp_nw2004s/helpdata/en/71/a8a77955bc11d194aa0000e8353423/content.htm

Read only

Former Member
0 Likes
996

Hi Ganesh,

Set Handler statement is used for registering and deregistering event handler methods dynamically at runtime.

CLASS cls_definition DEFINITION DEFERRED is used to declare a class first & then define it later.

The last statement basically registers a event for modifying a Editable grid.

Regards,

Chetan.

PS: Reward points if this helps.