ABAP
CONF
2024
Lessons Learned
Building a Product
with Clean Core ABAP
on S/4HANA Cloud, public edition
Robert Eijpe MSc.
Strategic Enterprise
Architect for SAP
Octavian Savu
SAP Developer
ABAP
CONF
2024
Agenda
• The opportunity
• Our feeling starting with ABAP Cloud
• ABAP Clean Core challenges and workarounds
• Take away points
ABAP
CONF
2024 S/4HANA Extensibility Options
Custom Build Solution
More info:
Which S/4HANA Extensibility Options should I use as a SAP customer?
ABAP
CONF
2024 S/4HANA Partner Solutions
On-stack or Side-by-Side or API enabled
More info:
Which S/4HANA extensibility option is the best for thriving as an SAP partner in the cloud space?
ABAP
CONF
2024 Partner Opportunity
SAP shift to the cloud
SAP ECC 6.0 S/4HANA Cloud
Private Edition
S/4HANA Cloud
Public Edition
Cloud ABAP
on SAP BTP
Runtime On-stack On-stack On-stack Side-by-side
Partner Software Partner Add-on Partner Add-on Partner Add-on Partner Add-on or
SAAS
ABAP Codeline
‘Classic` ABAP
Cloud ABAP
‘Classic` ABAP
Cloud ABAP Cloud ABAP
SAP Certified Certify ABAP Code Certify ABAP Clean
Core
Certify ABAP Clean
Core or
Multi-off delivery
Certify ABAP Clean
Core or Certified
SAAS
Update ABAP Stack Yearly Every 2 years Every half year Every quarter
Partner Software
Delivery
Transports Transports Transports or
Partner Git-Delivery
Transports
- SAP Addon partners should shift their code and
- New Cloud Vendors can easily enter SAP Partner network
ABAP
CONF
2024 Clean Core Code with Cloud ABAP
ABAP
CONF
2024 S/4HANA Cloud Private and Public Edition
ABAP
CONF
2024 Our opportunity
FEXS API Connect
ABAP
CONF
2024 FEXS API Connect
One delivery codeline
as add-on
product
as BTP SAAS
solution
ABAP
CONF
2024
Agenda
• The opportunity
• Our feeling starting with ABAP Cloud
• ABAP Clean Core challenges and workarounds
• Take away points
ABAP
CONF
2024 ABAP Cloud Experience
ABAP Cloud and Clean Core ABAP
ABAP
CONF
2024 Existing ABAP Knowledge
ABAP Cloud and Clean Core ABAP
ABAP
CONF
2024 Forget your classic ABAP Knowledge
ABAP Cloud and Clean Core ABAP
ABAP
CONF
2024 Forget your classic ABAP Knowledge
ABAP Cloud and Clean Core ABAP
No SAPGui ->
No SE80 or other SAP
GUI development tools
Fiori only ->
No Dynpro, ALV, BSP,
WDA, Reports
No ABAP Reports ->
No selection screen
and write statements
New ABAP syntax ->
a lot of obsolete
statements and
syntaxes
No direct SAP table access ->
learn CDS and new RAP model
ABAP
CONF
2024 Extend our ABAP knowledge
ABAP Cloud and Clean Core ABAP
ABAP
CONF
2024 Cloud ABAP
ABAP RESTful Application Programming Model (RAP)
Source:
ABAP RESTful Application Programming Model (RAP) – Overview
ABAP
CONF
2024 Coding Cloud ABAP
New syntax is sometimes a labyrinth
ABAP
CONF
2024 Coding Cloud ABAP
New syntax is sometimes a labyrinth
‘Classic’ ABAP Cloud ABAP Statement Remarks
DATA reason type string.
reason = 'REASON_100'.
DATA(reason) = `REASON_100`. - Inline declaration
- Type of fielddepends on quote type
DATA customer_name TYPE string.
SELECT SINGLEname1
INTO customer_name
FROM kna1
WHERE kunnr = '0037100081'.
SELECT SINGLE FROM i_customer
FIELDS customername
WHERE customer = '0037100081'
INTO @DATA(customer_name).
- Inline declaration
- New Syntax
- No tables but CDS access
FIELD-SYMBOLS: <fs> TYPE any.
ASSIGN ('IF_HTTP_STATUS=>REASON_100') TO<fs>.
FIELD-SYMBOLS: <fs> TYPE any.
ASSIGN ('IF_WEB_HTTP_STATUS')=>('REASON_100') TO <fs>.
- Other interface
- New syntax
DATA(user_datum) = sy-datlo. DATA(user_datum) = xco_cp=>sy->date( xco_cp_time=>time_zone-
>user )->as( xco_cp_time=>format->abap )->value.
DATA(lo_datetime) = xco_cp_time=>get_current_utctimestamp( )-
>to_local( xco_cp_time=>time_zone->user )->get_date( )
- Obsolete system variables
- New XCO libraries
Working with business objects COMMIT ENTITIES.
COMMIT WORK.
- SAP LUW versus DB LUW
- Modify phase versus Save phase inRAP
Usages of DDIC Artifacts A lot ofthem are obsolete - Create your own
… and much more
ABAP
CONF
2024 ABAP Statements and libraries
ABAP Cloud and Clean Core ABAP
ABAP
CONF
2024 ABAP Stack Capabilities
with wrapped and limited/restricted functionality
‘Classic’ ABAP Cloud ABAP
ABAP Classes and Function Modules renamed and wrapped Classes and XCO libraries
bgRFC bgPF
Background Jobs Application Job Framework
ABAP Workbench and ADT ADT and SAP Build Code
BALOG functions Application Log Framework
Reports, Dynpro, ITS, BSP, WebDynpro, Fiori Fiori only
TMS - Transport Management System gCTS - git-enabled Change and Transport System
ABAP
CONF
2024 Multi-off delivery
Following Clean Core ABAP syntax
More info:
SAP Help Multi-Off Delivery
ABAP
CONF
2024 Clean Core ABAP
Cloud ABAP is not by default Clean Core ABAP
• Clean ABAP style guide
• ADT Plugin for ABAP Cleaner
• ATC check for Partner Developments
• Create ABAP Unit tests
ABAP
CONF
2024
Agenda
• The opportunity
• Our feeling starting with ABAP Cloud
• ABAP Clean Core challenges and workarounds
• Take away points
ABAP
CONF
2024 Make use of S/4HANA Business Eventing
ABAP Clean Core challenges and workarounds
• Our products should be run on any Cloud ABAP supported
environment
Challenge
• Cloud ABAP release is not the same on all environments
• S/4HANA Cloud, private edition every 2 years an updated
release
• S/4HANA Cloud, public edition every 6 month an updated
release
• ABAP Cloud on BTP every 3 month an
updated release
Solution
• We don’t use SAP artifacts directly in the products, but use an intermediate
layer FEXS Cloud SDK
• Starting development on S/4HANA Cloud, public edition
ABAP
CONF
2024 Make use of S/4HANA Business Eventing
ABAP Clean Core challenges and workarounds
• Event Mesh is needed to handle S/4HANA business events
• Need a Event Mesh subscription on BTP
• Activate scope item 1NN in S/4HANA Cloud, public edition
Challenge
• By default scope item 1NN is not
available in a SAP S/4HANA TTD
system
Solution
• Request the scope item using a SAP ticket
ABAP
CONF
2024 Sending alert to multiple streams including email
ABAP Clean Core challenges and workarounds
Challenge
● S/4HANA Cloud ABAP provided a class cl_bcs_mail_message which works without
an error but didn’t sent out any email
Solution
• Setup Output Management for email (see sap note 2941522)
• Sent a ticket to SAP to setup DomainKeys Identified Mail (DKIM) records
for your domain
ABAP
CONF
2024 Showing application logs in custom Fiori App
ABAP Clean Core challenges and workarounds
• There is a standard Fiori application for showing the
Application Log
• This Fiori App uses a standard OData version 2 service
named APL_LOG_MANAGEMENT_SRV
Challenge
● SAP doesn’t allowed the usages of OData version 2 service when deploying
custom build Fiori App to S/4HANA
Solution
• Creating a custom entity to read
the Application Log and
expose as OData version 4
ABAP
CONF
2024 Show logo on the Fiori tiles and app headers
ABAP Clean Core challenges and workarounds
Challenge
● FEXS API Connect is an OEM product, so it must be easily to change the logo of
the tiles and the header of the app just by configuration.
Solution
• Creating a http service which provides dynamically the logo and a css file
based on configuration
• Extend the Fiori application with a header for the logo
ABAP
CONF
2024 Custom XML handler
ABAP Clean Core challenges and workarounds
Challenge
● Not all SAP ECC releases can handle JSON and we want to be sure that we can
convert XML as easy as we can do with JSON into an ABAP structure, ignoring
tags we don’t need and use booleans and timestamps in the right way.
Solution
• Build our own XML handler based
ABAP
CONF
2024 bgRFC queue in bgPF Framework is very slow
ABAP Clean Core challenges and workarounds
• Local handling of a RAP business event is performed by a
controlled bgPF unit.
Challenges
• Using RAP business events to perform sequential
tasks is leading a lot of bgPF calls and for high
number of calls is very slow.
• Tracking bgPF units in the Fiori app.
Solutions
• Use uncontrolled bgPF units instead of business
events.
• Raise ticket to SAP to increase the number of WP
assigned for bgRFC processing.
• Custom track ABAP internal sessions.
ABAP
CONF
2024 Restrictions for Working with SAP Controlled LUW
ABAP Clean Core challenges and workarounds
SAP Controlled LUW
RAP & local consumption of business events
bgPF controlled units
Challenge
● Cannot perform several tasks in the same ABAP session with COMMIT WORK in
between.
Partial Solutions
• Use uncontrolled bgPF units instead of raising RAP Business Events.
• Trigger an HTTP call for a custom HTTP web service on the ABAP application server.
ABAP
CONF
2024 Tracking Internal Sessions in ABAP Cloud
ABAP Clean Core challenges and workarounds
• Each call of an ABAP program creates a new internal session, in which
the called program is loaded.
Challenges
• Cannot get get real time information about an ABAP internal session
• Cannot catch a short-dump at runtime.
Solution
• Session tracker functionality to follow ABAP internal sessions.
ABAP
CONF
2024 ABAP Cloud Application Jobs
ABAP Clean Core challenges and workarounds
• The application job framework is the only option available in ABAP
Cloud to run and manage a jobs.
Challenges
• Debug an application job.
• Cannot start a job with a technical user.
• Prevent multiple instances of the same job to
run simultaneously.
Solutions
• Utility tool to trace variables during a job run .
• Use a 3rd job run by a business user to start the initial job.
• Utility method to check if another instance of the same
job is running.
ABAP
CONF
2024
Agenda
• The opportunity
• Our feeling starting with ABAP Cloud
• ABAP Clean Core challenges and workarounds
• Take away points
ABAP
CONF
2024 Take away points
• ABAP Cloud is a challenge for ‘classic’ ABAP developers
• ABAP Cloud is still under construction but the existing feature set is rich and proven
• Many roads lead to Rome, but decide first which S/4HANA editions you want to support for your
partner solution
• We can help you to speedup and simplify your Cloud ABAP development and partner solution
with our knowledge
Thank you Robert Eijpe MSc.
Strategic Enterprise Architect for SAP
Octavian
Savu
SAP Developer
ABAP
CONF
2024 More info…
• FEXS API Connect and Cloud SDK
• Blog: Which S/4HANA extensibility option is the best for
thriving as an SAP partner in the cloud space?
• Blog: ABAP Cloud Application Jobs: Overcoming Key
Challenges
• Blog: Working with Internal Sessions in ABAP Cloud
• YouTube: What’s New in the ABAP RESTful Application
Programming Model (RAP)?
Create barcodes
https://barcode.tec-
it.com/en/MobileQRUrl
ABAP
CONF
2024 Application Challenges
• Sending alert to multiple streams
• Sending mail -> request SAP to setup
• Showing application logs in ODATA version 4
• Creating a custom entity
• bgRFC queue BGPF is very slow and has a lot of units in error ⇒
Solution: reduced the number of bgPF sessions by replacing standard RAP events with bgPF
uncontrolled units, and also raised a ticket to SAP to increase the number of WP assigned to
the bgPF engine from 10 to 20.
• Unable to delete or activate database table and the TR could not be
released -> After changing the data element for a field in an structure from character
to integer, the database table including this structure can no longer be activated or
deleted. ⇒ Solution we opened a ticket to SAP and they deleted it for us.
ABAP
CONF
2024 ABAP Related Challenges and workarounds (to be
redefined)
• A lot of standard ABAP ddic artifacts may not be used
• COMMIT WORK in controlled LUWs
• local event handlers
• controlled bgPF units
• RAP LUW’s
• actions and functions
• save modified
• Scheduling background jobs with technical user
• Debugging
• Events
• Background Jobs
• Adding an dynamic logo on the fiori tiles
• To find out if a bgPF session is dumped
• Finding the bgrfc unit id when starting a bgRFC
• Preventing multiple instances of a job running simultaneously
• Custom XML handler built to make XML handling easier
ABAP
CONF
2024 Restrictions for Working with SAP Controlled LUW -
Octav - make the slides more compact
SAP Controlled LUW → by default enforced in RAP, local consumption of RAP Business Events and bgPF controlled units.
Challenges:
- cannot bundle several SAP LUWs in one single ABAP internal session;
- no possibility to perform several business tasks (i.e. creating a business partner and then an order for it) in the same
ABAP session with COMMIT WORK in between;
- no possibility to call synchronous RFCs.
Partial solutions:
- use uncontrolled background Processing Framework - bgPF units instead of raising RAP Business Events and
handling them locally;
- in an uncontrolled bgPF unit decide based on the processing needs when to perform COMMIT WORK and if there is
the need to impose the transactional phases using class CL_ABAP_TX;
- trigger an HTTP call of a custom HTTP web service on the ABAP application server, which will be unrestricted and
decide how much control to impose similar to uncontrolled bgPF units;
- trigger and handle a Business Event through Event Mesh to start a new ABAP internal session without restriction.
DEMO : CLASS /fexs/lec_i_producttp_2
ABAP
CONF
2024 Tracking Internal Sessions in ABAP Cloud - Octav
Internal session → Each call of an ABAP program creates a new internal session, in which the called program is loaded.
Challenges:
- no possibility to get real time information about an ABAP internal session at runtime (EPP passport,
CL_SESSION_INFO or others);
- no option to catch a short dump at runtime by calling a RFC with destination ‘NONE’;
- no straightforward functionality to track the bgPF units (which based on bgRFC calls).
Partial solutions:
- creation of a session tracker functionality that will track ABAP internal sessions handled both by dialog and
background work processes;
- using the session tracker one can identify potential runtime errors/ short-dumps for the ABAP sessions that are
running uncontrolled SAP LUWs;
- with the session tracker one can follow-up programmatically the status of the execution of application jobs or bgPF
units and issue notifications automatically in case of problems;
- track the performance of sessions.
DEMO : Demo from Postman
ABAP
CONF
2024 ABAP Cloud Application Jobs - Octav
Application jobs → a new framework available both on premise and in the cloud used to manage background job
processing. At the same time, the only option available in ABAP Cloud to run and manage a job.
Challenges:
- no possibility to schedule an application job with an technical user;
- prevent multiple instances of the same job to run simultaneously;
- debug an application job.
Partial solutions:
- use a another 3rd job executed by a business user to start the job that should have been started by the technical user;
- create a small utility method that checks if another instance of the same job is running;
- create own utility tool to trace any kind variables during a job run and then display the content in a Fiori app .
DEMO : Run a demo job and show the result in the Fiori App

Lessons Learned building a product with clean core abap

  • 1.
    ABAP CONF 2024 Lessons Learned Building aProduct with Clean Core ABAP on S/4HANA Cloud, public edition Robert Eijpe MSc. Strategic Enterprise Architect for SAP Octavian Savu SAP Developer
  • 2.
    ABAP CONF 2024 Agenda • The opportunity •Our feeling starting with ABAP Cloud • ABAP Clean Core challenges and workarounds • Take away points
  • 3.
    ABAP CONF 2024 S/4HANA ExtensibilityOptions Custom Build Solution More info: Which S/4HANA Extensibility Options should I use as a SAP customer?
  • 4.
    ABAP CONF 2024 S/4HANA PartnerSolutions On-stack or Side-by-Side or API enabled More info: Which S/4HANA extensibility option is the best for thriving as an SAP partner in the cloud space?
  • 5.
    ABAP CONF 2024 Partner Opportunity SAPshift to the cloud SAP ECC 6.0 S/4HANA Cloud Private Edition S/4HANA Cloud Public Edition Cloud ABAP on SAP BTP Runtime On-stack On-stack On-stack Side-by-side Partner Software Partner Add-on Partner Add-on Partner Add-on Partner Add-on or SAAS ABAP Codeline ‘Classic` ABAP Cloud ABAP ‘Classic` ABAP Cloud ABAP Cloud ABAP SAP Certified Certify ABAP Code Certify ABAP Clean Core Certify ABAP Clean Core or Multi-off delivery Certify ABAP Clean Core or Certified SAAS Update ABAP Stack Yearly Every 2 years Every half year Every quarter Partner Software Delivery Transports Transports Transports or Partner Git-Delivery Transports - SAP Addon partners should shift their code and - New Cloud Vendors can easily enter SAP Partner network
  • 6.
    ABAP CONF 2024 Clean CoreCode with Cloud ABAP
  • 7.
    ABAP CONF 2024 S/4HANA CloudPrivate and Public Edition
  • 8.
  • 9.
    ABAP CONF 2024 FEXS APIConnect One delivery codeline as add-on product as BTP SAAS solution
  • 10.
    ABAP CONF 2024 Agenda • The opportunity •Our feeling starting with ABAP Cloud • ABAP Clean Core challenges and workarounds • Take away points
  • 11.
    ABAP CONF 2024 ABAP CloudExperience ABAP Cloud and Clean Core ABAP
  • 12.
    ABAP CONF 2024 Existing ABAPKnowledge ABAP Cloud and Clean Core ABAP
  • 13.
    ABAP CONF 2024 Forget yourclassic ABAP Knowledge ABAP Cloud and Clean Core ABAP
  • 14.
    ABAP CONF 2024 Forget yourclassic ABAP Knowledge ABAP Cloud and Clean Core ABAP No SAPGui -> No SE80 or other SAP GUI development tools Fiori only -> No Dynpro, ALV, BSP, WDA, Reports No ABAP Reports -> No selection screen and write statements New ABAP syntax -> a lot of obsolete statements and syntaxes No direct SAP table access -> learn CDS and new RAP model
  • 15.
    ABAP CONF 2024 Extend ourABAP knowledge ABAP Cloud and Clean Core ABAP
  • 16.
    ABAP CONF 2024 Cloud ABAP ABAPRESTful Application Programming Model (RAP) Source: ABAP RESTful Application Programming Model (RAP) – Overview
  • 17.
    ABAP CONF 2024 Coding CloudABAP New syntax is sometimes a labyrinth
  • 18.
    ABAP CONF 2024 Coding CloudABAP New syntax is sometimes a labyrinth ‘Classic’ ABAP Cloud ABAP Statement Remarks DATA reason type string. reason = 'REASON_100'. DATA(reason) = `REASON_100`. - Inline declaration - Type of fielddepends on quote type DATA customer_name TYPE string. SELECT SINGLEname1 INTO customer_name FROM kna1 WHERE kunnr = '0037100081'. SELECT SINGLE FROM i_customer FIELDS customername WHERE customer = '0037100081' INTO @DATA(customer_name). - Inline declaration - New Syntax - No tables but CDS access FIELD-SYMBOLS: <fs> TYPE any. ASSIGN ('IF_HTTP_STATUS=>REASON_100') TO<fs>. FIELD-SYMBOLS: <fs> TYPE any. ASSIGN ('IF_WEB_HTTP_STATUS')=>('REASON_100') TO <fs>. - Other interface - New syntax DATA(user_datum) = sy-datlo. DATA(user_datum) = xco_cp=>sy->date( xco_cp_time=>time_zone- >user )->as( xco_cp_time=>format->abap )->value. DATA(lo_datetime) = xco_cp_time=>get_current_utctimestamp( )- >to_local( xco_cp_time=>time_zone->user )->get_date( ) - Obsolete system variables - New XCO libraries Working with business objects COMMIT ENTITIES. COMMIT WORK. - SAP LUW versus DB LUW - Modify phase versus Save phase inRAP Usages of DDIC Artifacts A lot ofthem are obsolete - Create your own … and much more
  • 19.
    ABAP CONF 2024 ABAP Statementsand libraries ABAP Cloud and Clean Core ABAP
  • 20.
    ABAP CONF 2024 ABAP StackCapabilities with wrapped and limited/restricted functionality ‘Classic’ ABAP Cloud ABAP ABAP Classes and Function Modules renamed and wrapped Classes and XCO libraries bgRFC bgPF Background Jobs Application Job Framework ABAP Workbench and ADT ADT and SAP Build Code BALOG functions Application Log Framework Reports, Dynpro, ITS, BSP, WebDynpro, Fiori Fiori only TMS - Transport Management System gCTS - git-enabled Change and Transport System
  • 21.
    ABAP CONF 2024 Multi-off delivery FollowingClean Core ABAP syntax More info: SAP Help Multi-Off Delivery
  • 22.
    ABAP CONF 2024 Clean CoreABAP Cloud ABAP is not by default Clean Core ABAP • Clean ABAP style guide • ADT Plugin for ABAP Cleaner • ATC check for Partner Developments • Create ABAP Unit tests
  • 23.
    ABAP CONF 2024 Agenda • The opportunity •Our feeling starting with ABAP Cloud • ABAP Clean Core challenges and workarounds • Take away points
  • 24.
    ABAP CONF 2024 Make useof S/4HANA Business Eventing ABAP Clean Core challenges and workarounds • Our products should be run on any Cloud ABAP supported environment Challenge • Cloud ABAP release is not the same on all environments • S/4HANA Cloud, private edition every 2 years an updated release • S/4HANA Cloud, public edition every 6 month an updated release • ABAP Cloud on BTP every 3 month an updated release Solution • We don’t use SAP artifacts directly in the products, but use an intermediate layer FEXS Cloud SDK • Starting development on S/4HANA Cloud, public edition
  • 25.
    ABAP CONF 2024 Make useof S/4HANA Business Eventing ABAP Clean Core challenges and workarounds • Event Mesh is needed to handle S/4HANA business events • Need a Event Mesh subscription on BTP • Activate scope item 1NN in S/4HANA Cloud, public edition Challenge • By default scope item 1NN is not available in a SAP S/4HANA TTD system Solution • Request the scope item using a SAP ticket
  • 26.
    ABAP CONF 2024 Sending alertto multiple streams including email ABAP Clean Core challenges and workarounds Challenge ● S/4HANA Cloud ABAP provided a class cl_bcs_mail_message which works without an error but didn’t sent out any email Solution • Setup Output Management for email (see sap note 2941522) • Sent a ticket to SAP to setup DomainKeys Identified Mail (DKIM) records for your domain
  • 27.
    ABAP CONF 2024 Showing applicationlogs in custom Fiori App ABAP Clean Core challenges and workarounds • There is a standard Fiori application for showing the Application Log • This Fiori App uses a standard OData version 2 service named APL_LOG_MANAGEMENT_SRV Challenge ● SAP doesn’t allowed the usages of OData version 2 service when deploying custom build Fiori App to S/4HANA Solution • Creating a custom entity to read the Application Log and expose as OData version 4
  • 28.
    ABAP CONF 2024 Show logoon the Fiori tiles and app headers ABAP Clean Core challenges and workarounds Challenge ● FEXS API Connect is an OEM product, so it must be easily to change the logo of the tiles and the header of the app just by configuration. Solution • Creating a http service which provides dynamically the logo and a css file based on configuration • Extend the Fiori application with a header for the logo
  • 29.
    ABAP CONF 2024 Custom XMLhandler ABAP Clean Core challenges and workarounds Challenge ● Not all SAP ECC releases can handle JSON and we want to be sure that we can convert XML as easy as we can do with JSON into an ABAP structure, ignoring tags we don’t need and use booleans and timestamps in the right way. Solution • Build our own XML handler based
  • 30.
    ABAP CONF 2024 bgRFC queuein bgPF Framework is very slow ABAP Clean Core challenges and workarounds • Local handling of a RAP business event is performed by a controlled bgPF unit. Challenges • Using RAP business events to perform sequential tasks is leading a lot of bgPF calls and for high number of calls is very slow. • Tracking bgPF units in the Fiori app. Solutions • Use uncontrolled bgPF units instead of business events. • Raise ticket to SAP to increase the number of WP assigned for bgRFC processing. • Custom track ABAP internal sessions.
  • 31.
    ABAP CONF 2024 Restrictions forWorking with SAP Controlled LUW ABAP Clean Core challenges and workarounds SAP Controlled LUW RAP & local consumption of business events bgPF controlled units Challenge ● Cannot perform several tasks in the same ABAP session with COMMIT WORK in between. Partial Solutions • Use uncontrolled bgPF units instead of raising RAP Business Events. • Trigger an HTTP call for a custom HTTP web service on the ABAP application server.
  • 32.
    ABAP CONF 2024 Tracking InternalSessions in ABAP Cloud ABAP Clean Core challenges and workarounds • Each call of an ABAP program creates a new internal session, in which the called program is loaded. Challenges • Cannot get get real time information about an ABAP internal session • Cannot catch a short-dump at runtime. Solution • Session tracker functionality to follow ABAP internal sessions.
  • 33.
    ABAP CONF 2024 ABAP CloudApplication Jobs ABAP Clean Core challenges and workarounds • The application job framework is the only option available in ABAP Cloud to run and manage a jobs. Challenges • Debug an application job. • Cannot start a job with a technical user. • Prevent multiple instances of the same job to run simultaneously. Solutions • Utility tool to trace variables during a job run . • Use a 3rd job run by a business user to start the initial job. • Utility method to check if another instance of the same job is running.
  • 34.
    ABAP CONF 2024 Agenda • The opportunity •Our feeling starting with ABAP Cloud • ABAP Clean Core challenges and workarounds • Take away points
  • 35.
    ABAP CONF 2024 Take awaypoints • ABAP Cloud is a challenge for ‘classic’ ABAP developers • ABAP Cloud is still under construction but the existing feature set is rich and proven • Many roads lead to Rome, but decide first which S/4HANA editions you want to support for your partner solution • We can help you to speedup and simplify your Cloud ABAP development and partner solution with our knowledge Thank you Robert Eijpe MSc. Strategic Enterprise Architect for SAP Octavian Savu SAP Developer
  • 36.
    ABAP CONF 2024 More info… •FEXS API Connect and Cloud SDK • Blog: Which S/4HANA extensibility option is the best for thriving as an SAP partner in the cloud space? • Blog: ABAP Cloud Application Jobs: Overcoming Key Challenges • Blog: Working with Internal Sessions in ABAP Cloud • YouTube: What’s New in the ABAP RESTful Application Programming Model (RAP)? Create barcodes https://barcode.tec- it.com/en/MobileQRUrl
  • 37.
    ABAP CONF 2024 Application Challenges •Sending alert to multiple streams • Sending mail -> request SAP to setup • Showing application logs in ODATA version 4 • Creating a custom entity • bgRFC queue BGPF is very slow and has a lot of units in error ⇒ Solution: reduced the number of bgPF sessions by replacing standard RAP events with bgPF uncontrolled units, and also raised a ticket to SAP to increase the number of WP assigned to the bgPF engine from 10 to 20. • Unable to delete or activate database table and the TR could not be released -> After changing the data element for a field in an structure from character to integer, the database table including this structure can no longer be activated or deleted. ⇒ Solution we opened a ticket to SAP and they deleted it for us.
  • 38.
    ABAP CONF 2024 ABAP RelatedChallenges and workarounds (to be redefined) • A lot of standard ABAP ddic artifacts may not be used • COMMIT WORK in controlled LUWs • local event handlers • controlled bgPF units • RAP LUW’s • actions and functions • save modified • Scheduling background jobs with technical user • Debugging • Events • Background Jobs • Adding an dynamic logo on the fiori tiles • To find out if a bgPF session is dumped • Finding the bgrfc unit id when starting a bgRFC • Preventing multiple instances of a job running simultaneously • Custom XML handler built to make XML handling easier
  • 39.
    ABAP CONF 2024 Restrictions forWorking with SAP Controlled LUW - Octav - make the slides more compact SAP Controlled LUW → by default enforced in RAP, local consumption of RAP Business Events and bgPF controlled units. Challenges: - cannot bundle several SAP LUWs in one single ABAP internal session; - no possibility to perform several business tasks (i.e. creating a business partner and then an order for it) in the same ABAP session with COMMIT WORK in between; - no possibility to call synchronous RFCs. Partial solutions: - use uncontrolled background Processing Framework - bgPF units instead of raising RAP Business Events and handling them locally; - in an uncontrolled bgPF unit decide based on the processing needs when to perform COMMIT WORK and if there is the need to impose the transactional phases using class CL_ABAP_TX; - trigger an HTTP call of a custom HTTP web service on the ABAP application server, which will be unrestricted and decide how much control to impose similar to uncontrolled bgPF units; - trigger and handle a Business Event through Event Mesh to start a new ABAP internal session without restriction. DEMO : CLASS /fexs/lec_i_producttp_2
  • 40.
    ABAP CONF 2024 Tracking InternalSessions in ABAP Cloud - Octav Internal session → Each call of an ABAP program creates a new internal session, in which the called program is loaded. Challenges: - no possibility to get real time information about an ABAP internal session at runtime (EPP passport, CL_SESSION_INFO or others); - no option to catch a short dump at runtime by calling a RFC with destination ‘NONE’; - no straightforward functionality to track the bgPF units (which based on bgRFC calls). Partial solutions: - creation of a session tracker functionality that will track ABAP internal sessions handled both by dialog and background work processes; - using the session tracker one can identify potential runtime errors/ short-dumps for the ABAP sessions that are running uncontrolled SAP LUWs; - with the session tracker one can follow-up programmatically the status of the execution of application jobs or bgPF units and issue notifications automatically in case of problems; - track the performance of sessions. DEMO : Demo from Postman
  • 41.
    ABAP CONF 2024 ABAP CloudApplication Jobs - Octav Application jobs → a new framework available both on premise and in the cloud used to manage background job processing. At the same time, the only option available in ABAP Cloud to run and manage a job. Challenges: - no possibility to schedule an application job with an technical user; - prevent multiple instances of the same job to run simultaneously; - debug an application job. Partial solutions: - use a another 3rd job executed by a business user to start the job that should have been started by the technical user; - create a small utility method that checks if another instance of the same job is running; - create own utility tool to trace any kind variables during a job run and then display the content in a Fiori app . DEMO : Run a demo job and show the result in the Fiori App