Sap Ooabap
Sap Ooabap
For events we will have to raise the event and then we will handle the event.
Syntax :-
SET HANDLER lo_object1→ EVENT_HANDLER for lo_object2.
Requirement :-
We will create a executable program where we will pass a input parameter for
user.
And if user do not pass any input, We will give a message on the Selection
screen to pass the input to the parameter.
Solution :-
Step 1 :- Go to ABAP Editor ( SE38 ) and create a executable program.
Step 2 :- Now we need to create few fields from VBAK as a local variable in
which we will get the details on the basis of Sales document number provided
by user as a input.
Step 4 :- Now we need to implement the method and raise the event of the
above class.
Step 5 :- Now we will create a class which will handle the event of the Class1
which we have created above.
Step 8 :- call method display and use the write statement to display the output.
Code :-
*&--------------------------------------------------------------
*& Report ZAR_OOPS_EVENTS
*&--------------------------------------------------------------
*&
*&--------------------------------------------------------------
REPORT zar_oops_events.
endif.
ENDMETHOD.
ENDCLASS.
ENDCLASS.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA(lo_obj1) = new CLASS1( ).
DATA(lo_obj2) = new CLASS2( ).
*&--------------------------------------------------------------
*&End Of Program
*&--------------------------------------------------------------
Press F8.