SlideShare uma empresa Scribd logo
1 de 5
Event is a mechanism by which method of one class can raise method of another class, without the hazard of
instantiating that class. It provides to raise the method (event handler method) of one class with help of another
method in the same or different class (triggering method).
The below steps is required to have the event handler in the class:-
 Create an event in a class.
 Create a triggering method in the same class which will raise the event.
 Create an event handler method for the event in same/other class.
 Register the event handler method in the program.
Now, the above settings are complete for event handler in class. Create an object from the class containing the
event and call the triggering method to raise the event.
By taking the above steps, the following sample examples will demonstrate the event handler technique in Class.
1. Events with Handler Method in the same class.
This example tells that how to raise method, if the triggering method and event handler method presents in the
same class.
Sample code and Output.
Output.
Now select the method.
And also copy the parameters of the event method.
By pressing this copy event parameter we can get the parameters.
Save and go back to the earlier screen..
Then double click on the method name.
Then provide the following logic for triggering the event.
METHOD METHOD_EVENT .
*check the condition
IF S_LIFNR_LOW < 1000 AND S_LIFNR_HIGH > 2000.
MESSAGE I000(0) WITH 'enter the values betw een 1000 and 2000'.
RAISE EVENT ZEVENT_METHOD.
ENDIF.
*provide select statement
SELECT *
FROM LFA1
INTO TABLE IT_LFA1
WHERE LIFNR BETWEEN S_LIFNR_LOW AND S_LIFNR_HIGH.
*transfer the values to another internal table
IT_LFA11 = IT_LFA1.
ENDMETHOD.
After that provide the logic in se38.
REPORT ZCL_EVENT_OPERATION .
*provide data objects
DATA: LFA1 TYPE LFA1,
OBJ TYPE REF TO ZCL_EVENT_OPERATION,
IT_LFA1 TYPE Z_LFA1,
IT_LFA11 TYPE Z_LFA1,
WA_LFA1 TYPE LFA1.
*provide select statement
SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR.
*provide create object
START-OF-SELECTION.
CREATE OBJECT OBJ.
*call the method
CALL METHOD OBJ->METHOD_EVENT
EXPORTING
S_LIFNR_LOW = S_LIFNR-LOW
S_LIFNR_HIGH = S_LIFNR-HIGH
IT_LFA1 = IT_LFA1.
*provide attribute value
IT_LFA11 = OBJ->IT_LFA11.
*display the data
LOOP AT IT_LFA11 INTO WA_LFA1.
WRITE:/ WA_LFA1-LIFNR,
WA_LFA1-LAND1,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.
Save it, check it, activate it and execute it.
Then the output is like this.
If lifnr value is <1000 and >2000.
Then press execute it.
The output is like this.
Then press enter.
The output is like this.

Mais conteúdo relacionado

Destaque

Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
 
Abap query
Abap queryAbap query
Abap query
brtkow
 
Abap 7 02 new features - new string functions
Abap 7 02   new features - new string functionsAbap 7 02   new features - new string functions
Abap 7 02 new features - new string functions
Cadaxo GmbH
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abap
alienscorporation
 
Abap coding standards
Abap coding standardsAbap coding standards
Abap coding standards
surendra1579
 
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.docManikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
manikanta sai kumar karri
 
Abap course chapter 5 dynamic programs
Abap course   chapter 5 dynamic programsAbap course   chapter 5 dynamic programs
Abap course chapter 5 dynamic programs
Milind Patil
 

Destaque (20)

Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
 
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScriptLotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScript
 
Abap objects
Abap objectsAbap objects
Abap objects
 
Design patterns in_object-oriented_abap_-_igor_barbaric
Design patterns in_object-oriented_abap_-_igor_barbaricDesign patterns in_object-oriented_abap_-_igor_barbaric
Design patterns in_object-oriented_abap_-_igor_barbaric
 
ABAP Test & Troubleshooting @SITMuc 2013
ABAP Test & Troubleshooting @SITMuc 2013ABAP Test & Troubleshooting @SITMuc 2013
ABAP Test & Troubleshooting @SITMuc 2013
 
ITSS Trainning | Curso de SAP ABAP Foundations
ITSS Trainning | Curso de SAP ABAP FoundationsITSS Trainning | Curso de SAP ABAP Foundations
ITSS Trainning | Curso de SAP ABAP Foundations
 
Web dynpro for abap
Web dynpro for abapWeb dynpro for abap
Web dynpro for abap
 
Abap query
Abap queryAbap query
Abap query
 
Analista programador SAP ABAP IV
Analista programador SAP ABAP IVAnalista programador SAP ABAP IV
Analista programador SAP ABAP IV
 
Qué es abap
Qué es abapQué es abap
Qué es abap
 
Abap 7 02 new features - new string functions
Abap 7 02   new features - new string functionsAbap 7 02   new features - new string functions
Abap 7 02 new features - new string functions
 
View - Tutorial ABAP
View - Tutorial ABAPView - Tutorial ABAP
View - Tutorial ABAP
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abap
 
Icones - ABAP
Icones - ABAPIcones - ABAP
Icones - ABAP
 
Sap abap Q&A
Sap abap Q&A Sap abap Q&A
Sap abap Q&A
 
Funções - Tutorial ABAP
Funções - Tutorial ABAPFunções - Tutorial ABAP
Funções - Tutorial ABAP
 
Abap coding standards
Abap coding standardsAbap coding standards
Abap coding standards
 
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.docManikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
 
Abap course chapter 5 dynamic programs
Abap course   chapter 5 dynamic programsAbap course   chapter 5 dynamic programs
Abap course chapter 5 dynamic programs
 
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
 

Semelhante a Basic abap oo

Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
dplunkett
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
helpido9
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
allenbailey
 
Delegates and events
Delegates and eventsDelegates and events
Delegates and events
Iblesoft
 

Semelhante a Basic abap oo (20)

CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in Java
 
ax2012
 ax2012 ax2012
ax2012
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
 
GIS AUTOMATION
GIS AUTOMATIONGIS AUTOMATION
GIS AUTOMATION
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
procedures and arrays
procedures and arraysprocedures and arrays
procedures and arrays
 
Diifeerences In C#
Diifeerences In C#Diifeerences In C#
Diifeerences In C#
 
EclipseCon 2009: TmL Tutorial Exercises
EclipseCon 2009: TmL Tutorial ExercisesEclipseCon 2009: TmL Tutorial Exercises
EclipseCon 2009: TmL Tutorial Exercises
 
AJP Event classes.pptx
AJP Event classes.pptxAJP Event classes.pptx
AJP Event classes.pptx
 
Intake 38 5 1
Intake 38 5 1Intake 38 5 1
Intake 38 5 1
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VB
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
 
Create an other activity lesson 3
Create an other activity lesson 3Create an other activity lesson 3
Create an other activity lesson 3
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
 
Validate maximum expiration date for items lots
Validate maximum expiration date for items lotsValidate maximum expiration date for items lots
Validate maximum expiration date for items lots
 
Delegates and events
Delegates and eventsDelegates and events
Delegates and events
 
Refactoring Chapter11
Refactoring Chapter11Refactoring Chapter11
Refactoring Chapter11
 
Notification android
Notification androidNotification android
Notification android
 
Android App Development - 02 Activity and intent
Android App Development - 02 Activity and intentAndroid App Development - 02 Activity and intent
Android App Development - 02 Activity and intent
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

Basic abap oo

  • 1. Event is a mechanism by which method of one class can raise method of another class, without the hazard of instantiating that class. It provides to raise the method (event handler method) of one class with help of another method in the same or different class (triggering method). The below steps is required to have the event handler in the class:-  Create an event in a class.  Create a triggering method in the same class which will raise the event.  Create an event handler method for the event in same/other class.  Register the event handler method in the program. Now, the above settings are complete for event handler in class. Create an object from the class containing the event and call the triggering method to raise the event. By taking the above steps, the following sample examples will demonstrate the event handler technique in Class. 1. Events with Handler Method in the same class. This example tells that how to raise method, if the triggering method and event handler method presents in the same class. Sample code and Output.
  • 3. Now select the method. And also copy the parameters of the event method. By pressing this copy event parameter we can get the parameters. Save and go back to the earlier screen.. Then double click on the method name. Then provide the following logic for triggering the event. METHOD METHOD_EVENT . *check the condition IF S_LIFNR_LOW < 1000 AND S_LIFNR_HIGH > 2000. MESSAGE I000(0) WITH 'enter the values betw een 1000 and 2000'. RAISE EVENT ZEVENT_METHOD. ENDIF. *provide select statement SELECT * FROM LFA1 INTO TABLE IT_LFA1 WHERE LIFNR BETWEEN S_LIFNR_LOW AND S_LIFNR_HIGH.
  • 4. *transfer the values to another internal table IT_LFA11 = IT_LFA1. ENDMETHOD. After that provide the logic in se38. REPORT ZCL_EVENT_OPERATION . *provide data objects DATA: LFA1 TYPE LFA1, OBJ TYPE REF TO ZCL_EVENT_OPERATION, IT_LFA1 TYPE Z_LFA1, IT_LFA11 TYPE Z_LFA1, WA_LFA1 TYPE LFA1. *provide select statement SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR. *provide create object START-OF-SELECTION. CREATE OBJECT OBJ. *call the method CALL METHOD OBJ->METHOD_EVENT EXPORTING S_LIFNR_LOW = S_LIFNR-LOW S_LIFNR_HIGH = S_LIFNR-HIGH IT_LFA1 = IT_LFA1. *provide attribute value IT_LFA11 = OBJ->IT_LFA11. *display the data LOOP AT IT_LFA11 INTO WA_LFA1. WRITE:/ WA_LFA1-LIFNR, WA_LFA1-LAND1, WA_LFA1-NAME1, WA_LFA1-ORT01. ENDLOOP.
  • 5. Save it, check it, activate it and execute it. Then the output is like this. If lifnr value is <1000 and >2000. Then press execute it. The output is like this. Then press enter. The output is like this.