SlideShare a Scribd company logo
Blackvard Management Consulting
SAP Persistence
Creating Source Code Automatically
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Blackvard Management Consultants
www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved
Erin Lett is the Operations Manager for Blackvard
Management Consulting. She holds a Bachelor’s Degree
from Stetson University in Communications and has been
working in the SAP, eLearning, and Software Development
industries for the past 6 years.
For further information please visit:
www.blackvard.com
elett@blackvard.com
Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com
Your Host
Erin Lett
Blackvard Management Consultants
www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved
Short Bio:
Lukas M. Dietzsch is managing director at Blackvard
Management Consulting, LLC. He is holding a Master’s
degree in Information Technology and is an experienced IT
solution architect and project lead.
His strong background in adapting to requirements and
standards in different industries and on various platforms are
valuable assets for Blackvard customers.
He is repeatedly commended by customers for driving
efficient solutions for complex problems in globally
distributed team environments and meeting tough deadlines.
For further information please visit:
www.blackvard.com
Lukas M. Dietzsch
lukas@blackvard.com
Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com
Managing Director
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Persistence Service Overview
 SAP Persistence Service Overview was previously covered in our
“Understanding Persistence” webinar.
 Overview
 Concepts Used In Persistence
 Transient vs. Persistent Data
 Data In Object-oriented Programming
 Persistence Service/Persistence Classes/Managed Objects
 The “Understanding Persistence” webinar can be viewed via the following link:
 http://www.blackvard.com/understanding-persistence/
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Agenda
What Will Be Covered:
1. Introduction
2. SAP Persistence Overview – Previous Webinar
3. Components of Persistence
1. Get A Flight Object
2. Create A Flight Object
4. Questions
5. About Us
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Let’s begin by talking a little bit about the basic architecture of SAP Persistence.
 To better understand how to create source code automatically.
Components Of Persistence
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Begin by using the SE24 transaction, in Class Builder, to create
a new Class with the name ZCL_MY_FLIGHT.
 Since it will be in the Persistent Class of the database table called SFLIGHT.
 Fill in all required fields and then select the Class Type
Persistent Class & click Save.
 Select where you wish to store the new class & click Save again.
Create Persistent Class
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 After saving the new class, verify your Persistent Class,
by clicking the Interfaces tab.
 It implements the interface IF_OS_STATE.
Interfaces
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Under the Friends tab, it also displays as a friend of the abstract
agent class, ZCB_MY_FLIGHT.
Friends
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Now connect the Persistent Class to an ABAP Dictionary object.
 2 ways for connecting & persistence mapping of a DDIC (depends on
Netweaver version):
 by clicking the Persistence button on top OR
 Navigate via “Goto > Persistence representant” to the mapping
Set Persistence Representation
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Now assign a Table/View/Structure to the Class.
 Select the database table that consists of flights, called SFLIGHT.
 Click the Continue icon to confirm.
Assign Table
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 After assigning the table, Class Builder loads metadata into the lower
Table/Fields section.
 Double-click on any one of the fields to load it into the Maintain Area.
Maintain Properties of Attributes
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Using the Maintain Area, you can now modify the ID, Description,
Field Visibility, etc.
 After completing the maintenance, simply press Enter to assign it to
the Persistent Class as an attribute.
Add Attribute To Persistent Class
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 After pressing Enter, the field appears under the Class as an Attribute &
loads the next field into the Maintain Area accordingly.
 Select each column/field you want to add to your class.
 Double-click on the name, then click the black arrow icon to add it to the class.
Add Attribute To Persistent Class
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 If all fields are not required, the unused columns can remain in the
lower area and be added later as needed.
 After applying the workflow to each field, the following appears:
Add Attribute To Persistent Class
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 After Saving the Persistence
Mapping, return to the Class
Definition using SE80 or SE24.
 Verify the Attributes & Methods.
New Attributes
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Along with the new attributes, GET & SET methods are also generated.
 Class Builder will activate the Actor Classes, along with the Persistent Class.
 Save your work! The Persistent Class is complete & can now be used.
New GET/SET Methods
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Requesting
data from
database
table
Adding
new data
to the
database
table
1stUsecase
2ndUsecase
Sample Use Cases for SFLIGHT
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 In the core of the TRY-CATCH block, reference the Agent Class & Save it in
the reference variable lo_flight_agent by querying the class attribute of the
zca_my_flight called agent.
Get A Flight Object
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Ask the agent to retrieve a persistent from
the database using the “BA” business key.
 Save the receiving reference
of the flight instance in the
reference variable, in the
local object called “lo_flight”.
 You now have an initialized
instance of the zcl_my_flight
& can call its GET- and
SET methods, e.g. such as
GET_CARRNAME().
Get A Flight Object
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 This process is very effective & reusable between various clients such as:
 ABAP classes,
 ABAP programs,
 Function Modules,
 etc.
 Now verify the results:
Get A Flight Object
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Create a flight object using the Persistent Class by referencing the Agent
Class & Saving it in the variable lo_flight_agent.
 Ask the agent to create a
persistent in the database
with the key parameters of:
 i_CARRID,
 i_CONNID and
 i_FLDATE
(the key values of the
database table SFLIGHT)
 Set a new price (set_price)
 Call the COMMIT statement.
 Save your work & Activate.
 Run the report.
Create A Flight Object
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Here you can see the results of the coding in the first line:
 Our newly created entry appears in database table SFLIGHT (check by using transaction SE11 or SE16n).
Create A Flight Object
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Have Additional Questions?
Want To get trained?
Please Set Up A Consultation.
Email: info@blackvard.com
Require A Consultation?
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 Technical project lead and ABAP architect responsible for quality in technical scope and budget in a global
roll-out of SAP Logistics applications (SAP LE / LO)
 Conducting multiple SAP ABAP and SAP HANA® trainings for various US companies
 Implementation of a standard SAP software solution for Spend Management within SAP AG & ARIBA (annual
spend volume 3 Bill. EUR) which can be used in all SAP systems
 Improved claims management using SAP FS-CM which is generating annual savings of 15 Mio € for a huge
German public healthcare organization
 Implemented a global solution for procurement processes at BMW AG using SAP SRM / B2B
 Blueprinting and implementation of SAP software for banking credit cancelations for VOLKSWAGEN
Key Achievements of Blackvard Management Consulting in Previous Projects
What We’ve Accomplished
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
An overview of current and previous customers:
Customers That Recommend Blackvard
Ad

More Related Content

What's hot (20)

Demo lan factserp
Demo lan factserpDemo lan factserp
Demo lan factserp
factscomputersoftware
 
Sap architecture
Sap architectureSap architecture
Sap architecture
Jugul Crasta
 
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2
SAP PartnerEdge program for Application Development
 
Pacmp
PacmpPacmp
Pacmp
Anuj Sharma
 
FDMEE Custom Reports
FDMEE Custom ReportsFDMEE Custom Reports
FDMEE Custom Reports
Francisco Amores
 
SAP BI Training in Chennai
SAP BI Training in ChennaiSAP BI Training in Chennai
SAP BI Training in Chennai
Raja AMEKS Infotech
 
Key Considerations for a Successful Hyperion Planning Implementation
Key Considerations for a Successful Hyperion Planning ImplementationKey Considerations for a Successful Hyperion Planning Implementation
Key Considerations for a Successful Hyperion Planning Implementation
Alithya
 
Digite eForm Custom Reporting Framework
Digite eForm Custom Reporting FrameworkDigite eForm Custom Reporting Framework
Digite eForm Custom Reporting Framework
Digite, Inc.
 
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updatedBHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
Bharat Padmanabhan
 
Abap rp2 3
Abap rp2 3Abap rp2 3
Abap rp2 3
susibaongoc
 
Approaches for Changing the Chart of Accounts - Eliminating the Risk
Approaches for Changing the Chart of Accounts - Eliminating the RiskApproaches for Changing the Chart of Accounts - Eliminating the Risk
Approaches for Changing the Chart of Accounts - Eliminating the Risk
eprentise
 
Best Practices for Writing Financial Reports
Best Practices for Writing Financial ReportsBest Practices for Writing Financial Reports
Best Practices for Writing Financial Reports
Alithya
 
Togaf v9-sample-catalogs-matrics-diagrams-v2
Togaf v9-sample-catalogs-matrics-diagrams-v2Togaf v9-sample-catalogs-matrics-diagrams-v2
Togaf v9-sample-catalogs-matrics-diagrams-v2
Raissa Quintero
 
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
eCapital Advisors
 
Yasser_Farag-CV
Yasser_Farag-CVYasser_Farag-CV
Yasser_Farag-CV
Yasser Farag Sayed
 
Anjan SAP ABAP Resume with PAN Card
Anjan SAP ABAP Resume with PAN CardAnjan SAP ABAP Resume with PAN Card
Anjan SAP ABAP Resume with PAN Card
Anjan Bera
 
Hyperion planning integration with odi
Hyperion planning integration with odiHyperion planning integration with odi
Hyperion planning integration with odi
Amit Sharma
 
Finit solutions getting the most out of financial reporting january 2011
Finit solutions   getting the most out of financial reporting  january 2011Finit solutions   getting the most out of financial reporting  january 2011
Finit solutions getting the most out of financial reporting january 2011
finitsolutions
 
SAP
SAPSAP
SAP
guest349c20
 
Sap transport procedures and best practices
Sap transport procedures and best practicesSap transport procedures and best practices
Sap transport procedures and best practices
MILUDW
 
Key Considerations for a Successful Hyperion Planning Implementation
Key Considerations for a Successful Hyperion Planning ImplementationKey Considerations for a Successful Hyperion Planning Implementation
Key Considerations for a Successful Hyperion Planning Implementation
Alithya
 
Digite eForm Custom Reporting Framework
Digite eForm Custom Reporting FrameworkDigite eForm Custom Reporting Framework
Digite eForm Custom Reporting Framework
Digite, Inc.
 
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updatedBHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
BHARAT_PADMANABHA_SAP_ABAP_resume- Last updated
Bharat Padmanabhan
 
Approaches for Changing the Chart of Accounts - Eliminating the Risk
Approaches for Changing the Chart of Accounts - Eliminating the RiskApproaches for Changing the Chart of Accounts - Eliminating the Risk
Approaches for Changing the Chart of Accounts - Eliminating the Risk
eprentise
 
Best Practices for Writing Financial Reports
Best Practices for Writing Financial ReportsBest Practices for Writing Financial Reports
Best Practices for Writing Financial Reports
Alithya
 
Togaf v9-sample-catalogs-matrics-diagrams-v2
Togaf v9-sample-catalogs-matrics-diagrams-v2Togaf v9-sample-catalogs-matrics-diagrams-v2
Togaf v9-sample-catalogs-matrics-diagrams-v2
Raissa Quintero
 
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
Managing Your Hyperion Environment – Performance Tuning, Problem Solving and ...
eCapital Advisors
 
Anjan SAP ABAP Resume with PAN Card
Anjan SAP ABAP Resume with PAN CardAnjan SAP ABAP Resume with PAN Card
Anjan SAP ABAP Resume with PAN Card
Anjan Bera
 
Hyperion planning integration with odi
Hyperion planning integration with odiHyperion planning integration with odi
Hyperion planning integration with odi
Amit Sharma
 
Finit solutions getting the most out of financial reporting january 2011
Finit solutions   getting the most out of financial reporting  january 2011Finit solutions   getting the most out of financial reporting  january 2011
Finit solutions getting the most out of financial reporting january 2011
finitsolutions
 
Sap transport procedures and best practices
Sap transport procedures and best practicesSap transport procedures and best practices
Sap transport procedures and best practices
MILUDW
 

Viewers also liked (8)

Introduction To Big Data & Hadoop
Introduction To Big Data & HadoopIntroduction To Big Data & Hadoop
Introduction To Big Data & Hadoop
Blackvard
 
Scrum vs Kanban
Scrum vs KanbanScrum vs Kanban
Scrum vs Kanban
Blackvard
 
Introduction to Design Thinking
Introduction to Design ThinkingIntroduction to Design Thinking
Introduction to Design Thinking
Blackvard
 
Introduction Into SAP Fiori
Introduction Into SAP FioriIntroduction Into SAP Fiori
Introduction Into SAP Fiori
Blackvard
 
Agile Software Development with Scrum – Introduction
Agile Software Development with Scrum – IntroductionAgile Software Development with Scrum – Introduction
Agile Software Development with Scrum – Introduction
Blackvard
 
HANA XS Web Service
HANA XS Web ServiceHANA XS Web Service
HANA XS Web Service
Blackvard
 
How to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in FioriHow to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in Fiori
Blackvard
 
Consuming Data With HANA XS
Consuming Data With HANA XSConsuming Data With HANA XS
Consuming Data With HANA XS
Blackvard
 
Introduction To Big Data & Hadoop
Introduction To Big Data & HadoopIntroduction To Big Data & Hadoop
Introduction To Big Data & Hadoop
Blackvard
 
Scrum vs Kanban
Scrum vs KanbanScrum vs Kanban
Scrum vs Kanban
Blackvard
 
Introduction to Design Thinking
Introduction to Design ThinkingIntroduction to Design Thinking
Introduction to Design Thinking
Blackvard
 
Introduction Into SAP Fiori
Introduction Into SAP FioriIntroduction Into SAP Fiori
Introduction Into SAP Fiori
Blackvard
 
Agile Software Development with Scrum – Introduction
Agile Software Development with Scrum – IntroductionAgile Software Development with Scrum – Introduction
Agile Software Development with Scrum – Introduction
Blackvard
 
HANA XS Web Service
HANA XS Web ServiceHANA XS Web Service
HANA XS Web Service
Blackvard
 
How to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in FioriHow to Create "Hello, World!" in Fiori
How to Create "Hello, World!" in Fiori
Blackvard
 
Consuming Data With HANA XS
Consuming Data With HANA XSConsuming Data With HANA XS
Consuming Data With HANA XS
Blackvard
 
Ad

Similar to SAP Persistence - Creating Source Code Automatically (20)

CA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Project & Portfolio Management—Jaspersoft Studio for the Report DeveloperCA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Technologies
 
Asset accounting
Asset accountingAsset accounting
Asset accounting
Nguyễn Kiên
 
Details and Set-up of Other FlexFields in Oracle E-Business Suite
Details and Set-up of Other FlexFields in Oracle E-Business SuiteDetails and Set-up of Other FlexFields in Oracle E-Business Suite
Details and Set-up of Other FlexFields in Oracle E-Business Suite
eprentise
 
TekRADIUS Rate Editor
TekRADIUS Rate EditorTekRADIUS Rate Editor
TekRADIUS Rate Editor
Yasin KAPLAN
 
Salesforce for Beginners
Salesforce for BeginnersSalesforce for Beginners
Salesforce for Beginners
Edureka!
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
Salesforce Developers
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummies
dreamforce2006
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummies
dreamforce2006
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
Salesforce Developers
 
How to create_an_ecatt
How to create_an_ecattHow to create_an_ecatt
How to create_an_ecatt
Mohammed Azhad
 
Introduction to Salesforce.com
Introduction to Salesforce.comIntroduction to Salesforce.com
Introduction to Salesforce.com
Edureka!
 
Salesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web ComponentSalesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web Component
Accenture Hungary
 
Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
Sanchit Dua
 
CO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdfCO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdf
ssuser878ec2
 
Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
Sanchit Dua
 
SAP AC020 - Investment Management
SAP AC020 - Investment ManagementSAP AC020 - Investment Management
SAP AC020 - Investment Management
Vannak9
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Aviv
sready
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
Amit Sharma
 
CA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Project & Portfolio Management—Jaspersoft Studio for the Report DeveloperCA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Project & Portfolio Management—Jaspersoft Studio for the Report Developer
CA Technologies
 
Details and Set-up of Other FlexFields in Oracle E-Business Suite
Details and Set-up of Other FlexFields in Oracle E-Business SuiteDetails and Set-up of Other FlexFields in Oracle E-Business Suite
Details and Set-up of Other FlexFields in Oracle E-Business Suite
eprentise
 
TekRADIUS Rate Editor
TekRADIUS Rate EditorTekRADIUS Rate Editor
TekRADIUS Rate Editor
Yasin KAPLAN
 
Salesforce for Beginners
Salesforce for BeginnersSalesforce for Beginners
Salesforce for Beginners
Edureka!
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
Salesforce Developers
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummies
dreamforce2006
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummies
dreamforce2006
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
Salesforce Developers
 
How to create_an_ecatt
How to create_an_ecattHow to create_an_ecatt
How to create_an_ecatt
Mohammed Azhad
 
Introduction to Salesforce.com
Introduction to Salesforce.comIntroduction to Salesforce.com
Introduction to Salesforce.com
Edureka!
 
Salesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web ComponentSalesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web Component
Accenture Hungary
 
Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
Sanchit Dua
 
CO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdfCO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdf
ssuser878ec2
 
Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
Sanchit Dua
 
SAP AC020 - Investment Management
SAP AC020 - Investment ManagementSAP AC020 - Investment Management
SAP AC020 - Investment Management
Vannak9
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Aviv
sready
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
Amit Sharma
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
Amit Sharma
 
Ad

Recently uploaded (20)

Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 

SAP Persistence - Creating Source Code Automatically

  • 1. Blackvard Management Consulting SAP Persistence Creating Source Code Automatically Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 2. Blackvard Management Consultants www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved Erin Lett is the Operations Manager for Blackvard Management Consulting. She holds a Bachelor’s Degree from Stetson University in Communications and has been working in the SAP, eLearning, and Software Development industries for the past 6 years. For further information please visit: www.blackvard.com [email protected] Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com Your Host Erin Lett
  • 3. Blackvard Management Consultants www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved Short Bio: Lukas M. Dietzsch is managing director at Blackvard Management Consulting, LLC. He is holding a Master’s degree in Information Technology and is an experienced IT solution architect and project lead. His strong background in adapting to requirements and standards in different industries and on various platforms are valuable assets for Blackvard customers. He is repeatedly commended by customers for driving efficient solutions for complex problems in globally distributed team environments and meeting tough deadlines. For further information please visit: www.blackvard.com Lukas M. Dietzsch [email protected] Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com Managing Director
  • 4. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Persistence Service Overview  SAP Persistence Service Overview was previously covered in our “Understanding Persistence” webinar.  Overview  Concepts Used In Persistence  Transient vs. Persistent Data  Data In Object-oriented Programming  Persistence Service/Persistence Classes/Managed Objects  The “Understanding Persistence” webinar can be viewed via the following link:  http://www.blackvard.com/understanding-persistence/
  • 5. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Agenda What Will Be Covered: 1. Introduction 2. SAP Persistence Overview – Previous Webinar 3. Components of Persistence 1. Get A Flight Object 2. Create A Flight Object 4. Questions 5. About Us
  • 6. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Let’s begin by talking a little bit about the basic architecture of SAP Persistence.  To better understand how to create source code automatically. Components Of Persistence
  • 7. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Begin by using the SE24 transaction, in Class Builder, to create a new Class with the name ZCL_MY_FLIGHT.  Since it will be in the Persistent Class of the database table called SFLIGHT.  Fill in all required fields and then select the Class Type Persistent Class & click Save.  Select where you wish to store the new class & click Save again. Create Persistent Class
  • 8. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  After saving the new class, verify your Persistent Class, by clicking the Interfaces tab.  It implements the interface IF_OS_STATE. Interfaces
  • 9. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Under the Friends tab, it also displays as a friend of the abstract agent class, ZCB_MY_FLIGHT. Friends
  • 10. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Now connect the Persistent Class to an ABAP Dictionary object.  2 ways for connecting & persistence mapping of a DDIC (depends on Netweaver version):  by clicking the Persistence button on top OR  Navigate via “Goto > Persistence representant” to the mapping Set Persistence Representation
  • 11. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Now assign a Table/View/Structure to the Class.  Select the database table that consists of flights, called SFLIGHT.  Click the Continue icon to confirm. Assign Table
  • 12. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  After assigning the table, Class Builder loads metadata into the lower Table/Fields section.  Double-click on any one of the fields to load it into the Maintain Area. Maintain Properties of Attributes
  • 13. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Using the Maintain Area, you can now modify the ID, Description, Field Visibility, etc.  After completing the maintenance, simply press Enter to assign it to the Persistent Class as an attribute. Add Attribute To Persistent Class
  • 14. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  After pressing Enter, the field appears under the Class as an Attribute & loads the next field into the Maintain Area accordingly.  Select each column/field you want to add to your class.  Double-click on the name, then click the black arrow icon to add it to the class. Add Attribute To Persistent Class
  • 15. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  If all fields are not required, the unused columns can remain in the lower area and be added later as needed.  After applying the workflow to each field, the following appears: Add Attribute To Persistent Class
  • 16. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  After Saving the Persistence Mapping, return to the Class Definition using SE80 or SE24.  Verify the Attributes & Methods. New Attributes
  • 17. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Along with the new attributes, GET & SET methods are also generated.  Class Builder will activate the Actor Classes, along with the Persistent Class.  Save your work! The Persistent Class is complete & can now be used. New GET/SET Methods
  • 18. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Requesting data from database table Adding new data to the database table 1stUsecase 2ndUsecase Sample Use Cases for SFLIGHT
  • 19. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  In the core of the TRY-CATCH block, reference the Agent Class & Save it in the reference variable lo_flight_agent by querying the class attribute of the zca_my_flight called agent. Get A Flight Object
  • 20. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Ask the agent to retrieve a persistent from the database using the “BA” business key.  Save the receiving reference of the flight instance in the reference variable, in the local object called “lo_flight”.  You now have an initialized instance of the zcl_my_flight & can call its GET- and SET methods, e.g. such as GET_CARRNAME(). Get A Flight Object
  • 21. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  This process is very effective & reusable between various clients such as:  ABAP classes,  ABAP programs,  Function Modules,  etc.  Now verify the results: Get A Flight Object
  • 22. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Create a flight object using the Persistent Class by referencing the Agent Class & Saving it in the variable lo_flight_agent.  Ask the agent to create a persistent in the database with the key parameters of:  i_CARRID,  i_CONNID and  i_FLDATE (the key values of the database table SFLIGHT)  Set a new price (set_price)  Call the COMMIT statement.  Save your work & Activate.  Run the report. Create A Flight Object
  • 23. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Here you can see the results of the coding in the first line:  Our newly created entry appears in database table SFLIGHT (check by using transaction SE11 or SE16n). Create A Flight Object
  • 24. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Have Additional Questions? Want To get trained? Please Set Up A Consultation. Email: [email protected] Require A Consultation?
  • 25. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  Technical project lead and ABAP architect responsible for quality in technical scope and budget in a global roll-out of SAP Logistics applications (SAP LE / LO)  Conducting multiple SAP ABAP and SAP HANA® trainings for various US companies  Implementation of a standard SAP software solution for Spend Management within SAP AG & ARIBA (annual spend volume 3 Bill. EUR) which can be used in all SAP systems  Improved claims management using SAP FS-CM which is generating annual savings of 15 Mio € for a huge German public healthcare organization  Implemented a global solution for procurement processes at BMW AG using SAP SRM / B2B  Blueprinting and implementation of SAP software for banking credit cancelations for VOLKSWAGEN Key Achievements of Blackvard Management Consulting in Previous Projects What We’ve Accomplished
  • 26. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com An overview of current and previous customers: Customers That Recommend Blackvard

Editor's Notes

  • #7: So, now let’s take a look at some of the key components of the Persistence Service. The SAP Persistence Service consists of global classes and interfaces. The upper four interfaces, that you see here outlined in red, are shared between all Persistent Classes. The lower three classes, outlined in red, are specific, and automatically generated for each Persistent Class created. The ZCL_MY_FLIGHT, outlined there in the bottom right-hand corner, is the Persistent Class that we are going to create in just a few moments. It has to implement the IF_OS_STATE interface, which ensures that all persistent objects can be accessed in the same way. As you can see, this class has numerous attributes and GET/SET methods as many fields exist in its connected persistent structure that was generated by the Class Builder. For each Persistent Class two agent classes are generated by the Class Builder, an abstract and a final. As you can see here, the ZCA_MY_FLIGHT, on the bottom left, is one of our Agent classes, and its responsibility is to manage the ZCL_MY_FLIGHT Persistent Objects on the bottom right- (actually all the SQL statements take place in this ZCA Agent class), so it serves as a kind of data repository. ZCB_MY_FLIGHT, located right above ZCA_MY_FLIGHT, is the super class of ZCA_MY_FLIGHT and is also generated by the Class Builder. It implements the following interfaces: IF_OS_FACTORY, IF_OS_CA_PERSISTENCY, IF_OS_CA_INSTANCE.
  • #8: So now that we’re a little more familiar with the concepts and components of persistence, let’s take a look at a few examples. Let’s begin by using the transaction SE24 to start the Class Builder. There you want to create a new class with the name, ZCL_MY_FLIGHT… as you can see we have done here in the screenshot. It is going to be the Persistent Class of the database table, called SFLIGHT. So, after filling in all the required fields such as “Class Name” and “Description” make sure to then select the class type, Persistent Class. Then click “SAVE” and select the package where you want to store the new class. In our example here, we are creating our classes in the temporary directory “$TMP” Once that is done- click Save again. So now, if you start transaction SE80 and navigate to your local temporary directory you will see the list of the newly created classes: ZCA_... ZCB_.... ZCL_......
  • #9: After saving the new class, we can verify exactly what Persistent Class means. As you can see, under the Interface tab, it implements the interface, IF_OS_STATE (like I showed you a few moments ago in the diagram).
  • #10: It is also friend of our abstract Agent class, ZCB_MY_FLIGHT, as seen here under the Friends tab.
  • #11: Now that we’re a little more familiar with the basics of our Persistent Class, let’s connect it to an ABAP Dictionary object. Begin by setting its Persistence Mapping, by pushing the Persistence button.
  • #12: After clicking on the persistence button (cp. Previous slide) the Pop-Up featured here will appear. Now we want to assign a table/view/ or structure to our class. So choose the database table that consists of flights, called SFLIGHT. You can do this by simply entering the name of the data dictionary you want to map - again it is the table: SFLIGHT Click the Continue icon, which is the green checkmark you see here, to confirm.
  • #13: After assigning the table, Class Builder loads its metadata into the lower Tables/Fields section. Now double-click on any one of the fields in order to load it into the Maintain Area.
  • #14: Using the Maintain Area, you can now modify the ID, description, and visibility of a field individually. After completing the maintenance of the given field, simply press ENTER in order to assign it to the Persistent Class as an attribute.
  • #15: After pressing ENTER, the given field appears under the class as an attribute and loads the next field into the Maintain Area, where you perform the same workflow. So again, select each column / field you want to add to your class in the lower area of the screen. Double click on the name, then it appears in the middle Maintain Area section of the screen. Click the black arrow icon to add it to the class then it appears in the upper area Repeat this process for each field from the table (here: SFLIGHT) that you wish to add In our example, we want to add all columns from table SFLIGHT to our class (in the next slide you’ll see that once we do this, the lower area is empty and all columns are listed in the upper area)
  • #16: If not all fields from a table are required no worries, the unused columns can remain in the lower area. The fields can be added later again in the same way like we did here. After applying the same workflow for each field, the attributes under our class appear, as seen here:
  • #17: After saving the persistence mapping, return to the class definition using transaction SE80 or SE24 to see the components of the class. Navigate to the directory where you have created the classes to view the structure and components. Verify the generated attributes, based on the mappings you have selected.
  • #18: Along with the new attributes, GET and SET methods are also generated. Please note that besides the Persistent Class, the Class Builder activates the Actor classes and all generated objects also. This will run automatically by saving your work! That's it! Now, you have a Persistent Class, called ZCL_MY_FLIGHT that you can use in the system.
  • #19: Along with the new attributes, GET and SET methods are also generated. Please note that besides the Persistent Class, the Class Builder activates the Actor classes and all generated objects also. This will run automatically by saving your work! That's it! Now, you have a Persistent Class, called ZCL_MY_FLIGHT that you can use in the system.
  • #20: For the sake of simplicity, I’ll now show you the basic use of persistent objects in some easy to understand examples. I'm going to show you two different operations, displaying and creating. Let's first check the display operation via the sample screenshot here. In the core of the TRY-CATCH block in line 9, you can see that we ask a reference of our agent class and save it in the reference variable lo_flight_agent by querying the class attribute of the ZCA_MY_FLIGHT called agent.
  • #21: Then, we simply ask the agent to retrieve a persistent entry from the database with the “BA” business key. That can be seen here in lines 12 – 14. The “get_persitent”-call requires all primary keys from the database in order to identify a unique entry – here you see Carrier ID, Connection ID and Flight Date. Save the receiving reference of the flight instance in the reference variable, in the local object, called lo_flight (cp. Here you can see that in Line 12). From now on, you have an initialized instance of the ZCL_MY_FLIGHT(that is, the data came from the database), and can call its GET/SET methods, such as GET_PRICE() (cp. As seen in Line 17).
  • #22: This process is very effective, and reusable among various clients, such as ABAP programs, ABAP classes, Function Modules, and so on. Here, as you can see here, you can verify the result:
  • #23: The next example I want to share is to create a flight object using the Persistent Class, by referencing the agent class in the same way as we did previously, and saving it in the variable, lo_flight_agent. Ask the agent to create a persistent in the database with key export parameters (= these are the primary keys of the database table SFLIGHT): So that would be: ‘i_CARRID’ for key field Carrier ID, ‘i_CONNID’ for key field Connection ID ‘i_FLDATE‘ for key field Flight Date Then set a new price. 999999999 Again, these are the key values of the database table SFLIGHT. You can see that here, in the screenshot. At last, there is nothing left to do but commit the work (using the COMMIT statement), then save it. Now run the report- and a new record appears in the table.
  • #24: Here you can check the result of the code: You can see our new entry in the first line – the price we set in our sample program shows, that we’ve created it -> 999999999 (cp. Code snippet from previous slide, line16).
  • #25: QUESTIONS TO BE ANSWERED: Question: I created a new class and now I want to add a new column to the flight table – How do I do this? Or is it automatically created as an attribute? Answer: Sure – showcase…. Question: You talked about two object status, one is persistent and the other one is transient – Is it possible to use a transient object? Could you clarify please?! Answer: Persistent objects will be stored / changed and persisted on the database for later use for example Transient object will only have a livetime during the runtime e.g. like objects that support the process and that are not required to be stored on database, e.g. service objects etc. Question: Can I define a dedicated time when the data is stored or does this happen automatically? Answer: You can force persisting the data by sending a commit statement in your coding or you leave it to the process / LUW you are in. The final commit of your LUW will store the data.