2007 Mar 11 6:02 AM
hi,
i need the explanation and sample how to apply the parameter 'sender' in abap object. why it is called implicit parameter?
thanks
Hi el,
sender is an implicit import parameter of an event handler method. It is not declared in the interface but gives the event handler a reference to the object where the event was raised.
CLASS flight_attendant DEFINITION.
PUBLIC SECTION.
METHODS: constructor
IMPORTING i_id TYPE string,
help_the_pilot FOR EVENT
call_button_pressed OF pilot IMPORTING sender,
help_a_passenger FOR EVENT
call_button_pressed OF passenger
IMPORTING e_seatnumber sender.
PRIVATE SECTION.
DATA id TYPE string.
ENDCLASS.
* Class Implementations
CLASS pilot IMPLEMENTATION.
METHOD call_flight_attendant.
RAISE EVENT call_button_pressed.
ENDMETHOD.
ENDCLASS.
If the method call_flight_attendant is raised by an instance of class pilot, event call_button_pressed is raised. The event handler method help_the_pilot imports the field sender which carries a reference to the calling pilot instance.
Regards,
Clemens
2007 Mar 11 12:22 PM
Hi el,
sender is an implicit import parameter of an event handler method. It is not declared in the interface but gives the event handler a reference to the object where the event was raised.
CLASS flight_attendant DEFINITION.
PUBLIC SECTION.
METHODS: constructor
IMPORTING i_id TYPE string,
help_the_pilot FOR EVENT
call_button_pressed OF pilot IMPORTING sender,
help_a_passenger FOR EVENT
call_button_pressed OF passenger
IMPORTING e_seatnumber sender.
PRIVATE SECTION.
DATA id TYPE string.
ENDCLASS.
* Class Implementations
CLASS pilot IMPLEMENTATION.
METHOD call_flight_attendant.
RAISE EVENT call_button_pressed.
ENDMETHOD.
ENDCLASS.
If the method call_flight_attendant is raised by an instance of class pilot, event call_button_pressed is raised. The event handler method help_the_pilot imports the field sender which carries a reference to the calling pilot instance.
Regards,
Clemens
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |