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

implicit parameter SENDER

Former Member
0 Likes
383

hi,

i need the explanation and sample how to apply the parameter 'sender' in abap object. why it is called implicit parameter?

thanks

1 REPLY 1
Read only

Clemenss
Active Contributor
0 Likes
327

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