comp 271
TRANSCRIPT
-
5/28/2018 Comp 271
1/43
COMP271
Effective Utilization of bgRFC
Wolfgang Baur, NW ABAP ConnectivityOmar-Alexander Al-Hujaj, NW ABAP Connectivity
Kai Baumgarten, NW ABAP Language
September/October 2008
-
5/28/2018 Comp 271
2/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 2
Disclaimer
This presentation outlines our general product direction and should not be
relied on in making a purchase decision. This presentation is not subject to
your license agreement or any other agreement with SAP. SAP has no
obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This
presentation and SAP's strategy and possible future developments are
subject to change and may be changed by SAP at any time for any reasonwithout notice. This document is provided without a warranty of any kind,
either express or implied, including but not limited to, the implied warranties
of merchantability, fitness for a particular purpose, or non-infringement. SAP
assumes no responsibility for errors or omissions in this document, except if
such damages were caused by SAP intentionally or grossly negligent.
-
5/28/2018 Comp 271
3/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 3
1. Motivation
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
4/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 4
Motivation
How to synchronize a system which is not always up?
In system landscapes a system may be down
But application needs to be synchronized with other systems
The application program should be finished in a reasonable time
How to send delta information in order?
How can be assured that the update reach the server after the creation
How to avoid overload situations on destination systems?
-
5/28/2018 Comp 271
5/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 5
1. Motivation
2. Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
6/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 6
Prerequisites
ABAP programming
ABAP OO
Remote Function Calls (RFC)
-
5/28/2018 Comp 271
7/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 7
Types of RFC
Synchronous RFCSerial execution
Immediate error handling after execution
System load control
Asynchronous RFC with/without responseParallel execution
Error handling has to be programmed
No system load control
Parallel RFCParallel execution
Error handling has to be programmed
System load control has to be programmed
Background RFC (bgRFC)Parallel execution
Error handling is provided by bgRFC runtime
System load control is provided by bgRFC runtime
-
5/28/2018 Comp 271
8/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 8
Background Remote Function Call (bgRFC)
bgRFC is a scalable and transactional middleware framework
Transactional processing
The database changes of a unit define a Logical Unit of Work
Asynchronous
Creation and execution completely decoupled
Unit states can be monitored Downtime of destination systems is managed by the bgRFC runtime
Resource optimization
Individual configurable
Highly scalable
-
5/28/2018 Comp 271
9/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 9
Basic Terms
Destination
Remote system (Outbound scenario)
Distinct name for an application (Inbound scenario)
Unit
Recorded sequence of function calls which are processed
Stored in database with statement COMMIT WORK
Queue
Sequence of units by using EOIO
Scheduler
Fetches units from database and processes them
Checks system resources continual
Different scheduler for inbound and outbound scenario
-
5/28/2018 Comp 271
10/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 10
Quality of Service
Exactly Once (EO)
Exactly Once in Order (EOIO)
bgRFC runtime ensures that database changes of a unit will be
committed only once
In bgRFC environment this is also called Type T
bgRFC runtime ensures that units are called EO and in a
specified order
In bgRFC environment this is also called Type Q
Function database
changes
data
error
Program RFC
error
-
5/28/2018 Comp 271
11/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 11
1. Motivation
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
12/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 12
Use Case bgRFC Inbound
Client System
Server System
Inbound Scheduler
Inbound databasecreate
units
fetch units
process units
FM calls
In the inbound scenario client and server system are identical.
-
5/28/2018 Comp 271
13/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 13
Use Case bgRFC Outbound
Client System
Server System
Outbound schedulerprocess
units
databasecreate
units
fetch units
FM calls
Outbound
In the outbound scenario client and server system are different.
-
5/28/2018 Comp 271
14/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 14
Client System
Server System
Use Case bgRFC OutInbound
Inbound Scheduler
transfer
units
OutInbound databasecreate
units
fetch units
FM calls
databaseOutbound Scheduler
fetch units
process unitsIn the OutInbound scenario unit data is only
transferred to the server system.
The execution will be done locally by the
inbound scheduler of the server system.
-
5/28/2018 Comp 271
15/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 15
bgRFC Unit as LOGICAL UNIT OF WORK
Create a unit of type T/Q
Call function module 1 ... n as part of the unit
bgRFC Scheduler
database
Commit work
sequential execution
Unit
Function Module n
Function Module 1
Function Module 2
Function Module n
Function Module 1
Function Module 2
-
5/28/2018 Comp 271
16/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 16
bgRFC Unit Type T: Creation Phase
Transactional Remote Function Call
Quality of service EO
Supported scenarios
Inbound
Outbound
Each unit is an independent thread
1
2
3
-
5/28/2018 Comp 271
17/43
-
5/28/2018 Comp 271
18/43
-
5/28/2018 Comp 271
19/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 19
1. Remote Function Call (RFC)
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
20/43
-
5/28/2018 Comp 271
21/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 21
Main Configuration Transaction SBGRFCCONF
-
5/28/2018 Comp 271
22/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 22
DEMO 1
-
5/28/2018 Comp 271
23/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 23
1. Motivation
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
24/43
-
5/28/2018 Comp 271
25/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 25
bgRFC Monitor SBGRFCMON Detail
-
5/28/2018 Comp 271
26/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 26
DEMO 2
-
5/28/2018 Comp 271
27/43 SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 27
1. Motivation
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring6. Programming
6.1 bgRFC Inbound Type T
6.2 Exercise 1
6.3 bgRFC Inbound Type Q
6.4 Exercise 2
6.5 bgRFC Outbound Type T
6.6 bgRFC Outbound Type Q6.7 Exercise 3
7. Summary
8. Q&A
Agenda
-
5/28/2018 Comp 271
28/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 28
bgRFC Inbound Type T
DATA: my_destination TYPE REF TO if_bgrfc_destination_inbound, my_unit_1 TYPE REF TO if_trfc_unit_inbound,
my_unit_2 TYPE REF TO if_trfc_unit_inbound.
my_destination= cl_bgrfc_destination_inbound=>create(MY_DEST).
my_unit_1 = my_destination->create_trfc_unit( ).
my_unit_2 = my_destination->create_trfc_unit( ).
CALL FUNCTION RFC_FUNCTION_1 IN BACKGROUND UNITmy_unit_1.
CALL FUNCTION RFC_FUNCTION_2 IN BACKGROUND UNITmy_unit_2.
COMMIT WORK.
Contained FM
RFC_FUNCTION_1
RFC_FUNCTION_2
my_unit_1
my_unit_2
database
-
5/28/2018 Comp 271
29/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 29
EXERCISE 1
-
5/28/2018 Comp 271
30/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 30
System Landscape
AS ABAP
M17
AS ABAP
M17
Client/Server Server
Logon Dataclient 000
user COMP271_##
Password in i t ia l
Client ProgramABAP Program
ZCOMP271_BGRFC_TYPE_T_IN_##
in PackageTEST_COMP271_EXERCISES_##
Same s ystem
RFC
! ## = Group Number !
-
5/28/2018 Comp 271
31/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 31
bgRFC Inbound Type Q
DATA: my_destination TYPE REF TO if_bgrfc_destination_inbound,my_unit_1 TYPE REF TO if_qrfc_unit_inbound,
my_unit_2 TYPE REF TO if_qrfc_unit_inbound,my_queue_name TYPE qrfc_queue_name.
my_destination = cl_bgrfc_destination_inbound=>create( MY_DEST ).
my_unit_1 = my_destination->create_qrfc_unit( ).
my_unit_2 = my_destination->create_qrfc_unit( ).
my_queue_name = Q1.
my_unit_1->add_queue_name_inbound( my_queue_name ).
my_unit_2->add_queue_name_inbound( my_queue_name ).
CALL FUNCTION RFC_FUNCTION_1 IN BACKGROUND UNIT my_unit_1.
CALL FUNCTION RFC_FUNCTION_2 IN BACKGROUND UNIT my_unit_2.
COMMIT WORK.
Contained FM
Q1
RFC_FUNCTION_1
RFC_FUNCTION_2
my_unit_1
my_unit_2
database
Contained FM
-
5/28/2018 Comp 271
32/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 32
EXERCISE 2
-
5/28/2018 Comp 271
33/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 33
System Landscape
AS ABAP
M17
AS ABAP
M17
Client/Server Server
Logon Dataclient 000
user COMP271_##
Password in i t ia l
Client ProgramABAP Program
ZCOMP271_BGRFC_TYPE_Q_IN_##
in PackageTEST_COMP271_EXERCISES_##
Same system
RFC
! ## = Group Number !
b RFC O tb d T T
-
5/28/2018 Comp 271
34/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 34
bgRFC Outbound Type T
DATA: my_destination TYPE REF TO if_bgrfc_destination_outbound,
my_unit TYPE REF TO if_trfc_unit_outbound.dest_name = 'MY_DEST'.my_destination = cl_bgrfc_destination_outbound=>create( MY_DEST ).my_unit = my_destination->create_trfc_unit( ).
CALL FUNCTION RFC_FUNCTION_1 IN BACKGROUND UNITmy_unit.CALL FUNCTION RFC_FUNCTION_2 IN BACKGROUND UNITmy_unit.
COMMIT WORK.
Contained FM
RFC_FUNCTION_1
RFC_FUNCTION_2my_unit
database
b RFC O tb d T Q
-
5/28/2018 Comp 271
35/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 35
bgRFC Outbound Type Q
DATA: my_destination TYPE REF TO if_bgrfc_destination_outbound,my_unit_1 TYPE REF TO if_qrfc_unit_outbound,
my_unit_2 TYPE REF TO if_qrfc_unit_outbound,my_queue_name TYPE qrfc_queue_name.
my_destination = cl_bgrfc_destination_outbound=>create( MY_DEST ).
my_unit_1 = my_destination->create_qrfc_unit( ).
my_unit_2 = my_destination->create_qrfc_unit( ).
my_queue_name = Q1.
my_unit_1->add_queue_name_outbound( my_queue_name ).
my_unit_2->add_queue_name_outbound( my_queue_name ).
CALL FUNCTION RFC_FUNCTION_1 IN BACKGROUND UNIT my_unit_1.
CALL FUNCTION RFC_FUNCTION_2 IN BACKGROUND UNIT my_unit_2.
COMMIT WORK.
Contained FM
Q1
RFC_FUNCTION_1
RFC_FUNCTION_2
my_unit_1
my_unit_2
database
Contained FM
-
5/28/2018 Comp 271
36/43
S t L d
-
5/28/2018 Comp 271
37/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 37
System Landscape
AS ABAP
M17
AS ABAP
M17
Client/Server Server
Logon Dataclient 000
user COMP271_##
Password in i t ia l
Client ProgramABAP Program
ZCOMP271_BGRFC_TYPE_Q_OUT_##
in PackageTEST_COMP271_EXERCISES_##
Logon Dataclient 800
user COMP271_##
Password in i t ia l
RFC
! ## = Group Number !
A d
-
5/28/2018 Comp 271
38/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 38
1. Motivation
2. bgRFC Overview
3. Scenarios
4. Configuration
5. Monitoring
6. Programming
7. Summary
8. Q&A
Agenda
b RFC Ad t
-
5/28/2018 Comp 271
39/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 39
bgRFCAdvantages
For the Developer
Object-oriented and easy to use API
Clear programming model, no implicit assumptions
For the Administrator
Effective toolssupport monitoring and error analysisEasy to configuresystem resources for bgRFC
For the System Workload
Optimizeddependency handling
Support of load balancingConfigurable number of schedulers
F rther Information
-
5/28/2018 Comp 271
40/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 40
Further Information
Related Workshops/Lectures at SAP TechEd 2008
COMP209, News In ABAP, Session Type lecture
Related SAP Education and Certification Opportunities
http://www.sap.com/education/
SAP Professional Journal, May/June 2007, Increase the efficiency of
your RFC communications with bgRFC.
SAP Public Web:
SAP Developer Network (SDN): www.sdn.sap.com
Agenda
http://www.sap.com/education/http://www.sdn.sap.com/http://www.sdn.sap.com/http://www.sap.com/education/ -
5/28/2018 Comp 271
41/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 41
Questions ?
Agenda
-
5/28/2018 Comp 271
42/43
SAP 2008 / SAP TechEd 08 / COMP271 / Effective Utilization of bgRFC Page 42
Thank you!
-
5/28/2018 Comp 271
43/43
Please complete your session evaluation.
Be courteous deposit your trash,and do not take the handouts for the following session.
Thank You
Feedback