FPP or the emperors
new (object-oriented)
cloths
Jan Krieg, (FI-CA) SAP AG
Boris Greven, (ICM) SAP AG
Marina Plag, (FI-CA) SAP AG
Christian Mahr, (ICM) SAP AG
FPP: Framework for Parallel Processing
FPP: Maintenance and Administration
Definition of parallel runs
Parallelization Object
(persistence of run data)
Intervals
Intervals Status management for parallel runs
Intervals
Status management for Intervals
UI for maintenance of parallelization
Application Logs
objects and parallel runs
PPF: Parallel Processing Framework (software layer ABA)
Execution of parallel jobs
SAP AG 2005, Title of Presentation / Speaker Name / 2
FPP: Architecture
Package FPP
Package FPPUI (User Interface)
Package FPPIL (Interaction)
Package FPPCO (Controlling)
SAP AG 2005, Title of Presentation / Speaker Name / 3
Get rid of adjustment
IMPORT/EXPORT
ABAP (adjustment
RFDT could be necessary)
IMPORT/EXPORT
XML-Serialization
FPP_CLUST ABAP
Advance „MOVE-CORRESPONDING“
CL_DATA_CONTAINER
Example (AIR): Report ZGET_RID_OF_ADJUSTMENT
SAP AG 2005, Title of Presentation / Speaker Name / 4
Parallelization Object
GPART
ParallelObject 2
VTREF VKONT
ParallelObject 1 ParallelObject 3
Inheriting from
Basis class: CL_FPP_PARALLEL_OBJ
SAP AG 2005, Title of Presentation / Speaker Name / 5
Creation of a parallelization object I
Step 1: Create a database table for the interval distribution
Example: business partner
Foreign key relation
Interval distribution BUT000
Necessary for automatic
interval distribution
These data elements are mandatory
These data elements are specific to
the actual application
These fieldnames are mandatory
SAP AG 2005, Title of Presentation / Speaker Name / 6
Creation of a parallelization object II
Step 2: Create a class and implement the constructor
This is mandatory
Name of the interval distribution.
Name of the table for the interval distributions
If set, it is not possible to create interval
distribution with gaps between intervals
SAP AG 2005, Title of Presentation / Speaker Name / 7
Creation of a parallelization object III
Call transaction FPPOBJ and enjoy the
creation of interval distributions
SAP AG 2005, Title of Presentation / Speaker Name / 8
Parallel Run (Definition)
Data container
(replaces the
ADDONS)
CL_FPP_RUNS Customizing (FPP_CUST)
CL_FPP_PARALLEL_OBJ
CL_DATA_CONTAINER
CL_FPP_INTERVAL
CL_FPP_INTERVAL
CL_FPP_INTERVAL
CL_FPP_BAL
Parallelization
object and interval Application Log
distribution
SAP AG 2005, Title of Presentation / Speaker Name / 9
Definition of a mass activity
Viewcluster
• VC_FPP_CUST
• VC_NEW_MASS_ACT (Viewcluster for FI-CA)
Examples:
• Transaction FPP_SAMPLE
• Transaction FPP_SAMPLE_FICA
Some technical information:
• In the database tables the field MID replaces the FI-CA field AKTYP
• The new field APPL should be set to ‘FI-CA’
SAP AG 2005, Title of Presentation / Speaker Name / 10
Administration of a mass activity
SE93 : Create Transaction.
This transaction starts the report
FPP_UI_START_2
Set these parameters to the current
values of your mass activity
SAP AG 2005, Title of Presentation / Speaker Name / 11
Parallel Jobs = 2*N + 2 (N: level of parallelization)
N=4
Job 1 End 1
Job 2 End 2
FPP: Start PPF: Start
Job 3 End 3
Job 4 End 4
Time
SAP AG 2005, Title of Presentation / Speaker Name / 12
Exits (before or after an execution of the run)
All BADIs are assigned to the enhancement spot FPP_FRAMEWORK (SE18)
Class CL_FPP_RUNS:
Creation of a run (Constructor) BADI: FPP_INITIAL_RUN_DATA
Add external run ID (method SET_RUN_DATA) BADI: FPP_CHECK_EXT_RUNID
Saving of a run (method SAVE) BADI: FPP_RUN_SAVE
Class CL_FPP_SERVICES:
Copy of a run (method COPY_RUN) BADI: FPP_COPY_RUN
SAP AG 2005, Title of Presentation / Speaker Name / 13
Exits (during an execution of a run)
Start of a run
BADI: FPP_BEFORE_RUN
Function module: Begin parallelization
BADI: FPP_AT_JOB_START BADI: FPP_AT_JOB_START
Function module: Begin job Function module: Begin job
Job1 Job2
BADI: FPP_AT_JOB_END BADI: FPP_AT_JOB_END
Function module: End job Function module: End job
End
BADI: FPP_AFTER_RUN
Function module: End parallelization
SAP AG 2005, Title of Presentation / Speaker Name / 14
Exit for dynamic creation of interval distributions
If a parallel run is started and no parallelization object or no interval distribution is
provided, the following BADI is called:
BADI: FPP_FPP_CREATE_INTERVALS
This BADI provides two methods:
• GET_OBJECT Returns a parallelization object
• GET_INSTANCE
Returns an interval distribution
SAP AG 2005, Title of Presentation / Speaker Name / 15
Important database tables
FPP_RUNS Run data
FPP_RUN_INTERVAL Status management for intervals
FPP_CUST Customizing (there are 6 tables, please
look at the viewcluster VC_FPP_CUST)
All tables start with FPP_
SAP AG 2005, Title of Presentation / Speaker Name / 16
From old to new
The next slides are addressed to developers who
have to switch mass activities to the new framework
SAP AG 2005, Title of Presentation / Speaker Name / 17
From old to new (Interval function)
IMPORTING Run
parameter
ICL_RUN type ref to CL_FPP_RUNS
Application
ICL_APPL_LOG type ref to CL_FPP_BAL Log
ICL_INTERVAL type ref to CL_FPP_INTERVAL Actual
interval
ICL_COUNTER type ref to CL_FPP_COUNTER
Counter
EXPORTING
Complete,
failed, retry
EV_RESULT type FPP_RESULT
Application
EV_APPL_LOG type BALLOGHNDL Log
SAP AG 2005, Title of Presentation / Speaker Name / 18
From old to new (Interval function – parameters)
CALL FUNCTION t_fbstab-funcc
EXPORTING
i_low = intlo ICL_INTERVAL
i_high = inthi
i_basics = g_basics ICL_RUN All run data (ADDONS)
TABLES
t_counter = itab_counter
CHANGING
c_test_num = test_num ICL_COUNTER
c_success_num = success_num
c_error_num = error_num
c_itvl_rest = h_interval_restart_necessary
EV_RESULT
c_itvl_stat = h_itvl_status
EXCEPTIONS
error_message = 1
OTHERS = 2. No additional interval status
(table INTSTAT) in FPP
No ROLLBACK WORK in FPP
SAP AG 2005, Title of Presentation / Speaker Name / 19
From old to new (Interval status and restart)
• open
• in process
• cancelled To be set by the interval function (EV_RESULT)
• completed
• retry
Restart possible if no. of cancelled intervals > 0 and/or no. of open intervals > 0
Intervals with status retry will be executed in the same run if there are no
more open intervals.
New Customizing:
retry
restart
SAP AG 2005, Title of Presentation / Speaker Name / 20
From old to new (application log)
Import parameter of the interval function
ICL_APPL_LOG
Export parameter Linked to the interval
EV_APPL_LOG
• Additional logs for all other run exits (BEFORE_RUN, AT_JOB_START,
AT_JOB_END and AFTER_RUN)
• If there is no customizing for the application log the interval function can
provide a log handle (EV_APPL_LOG) which will be linked to the interval
SAP AG 2005, Title of Presentation / Speaker Name / 21
From old to new (closing of intervals)
Problem: A,B B,C C,D D,Z
Executed on job 1 Executed on job 2 Locking problem on object B
Solution: CL_FPP_INTERVAL->CLOSE_INTERVAL( ) Only if no gaps are allowed!
A,B B1,C C1,D D1,Z
Left boundary is shifted to the next physically existing database entry
• first interval won’t be changed
• right boundary of the last interval is set to the highest value (code page dependent)
SAP AG 2005, Title of Presentation / Speaker Name / 22
From old to new: User Interface for parallel runs
There are three possibilities to interact with the framework
1. By providing a DDIC-structure (replaces the TAMLAYA stuff)
2. By defining own screens (like FI-CA ADDONS)
3. By providing a DDIC-structure for free selections (identical to FI-CA)
SAP AG 2005, Title of Presentation / Speaker Name / 23
From old to new: Generated screen
DDIC structure
• Fieldname (without prefix) : Displayed as a simple field
• SEL_fieldname : Displayed as SELECT-OPTIONS
• FLG_fieldname : Displayed as a flag
The fields of the structure have to be grouped into frames
SAP AG 2005, Title of Presentation / Speaker Name / 24
From old to new: How to read data set by the generated screen?
Signature of method ICL_RUN->GET_STANDARD_DATA
This is a structure identical to the structure for standard data
• only simple fields and flags are stored in that structure
The system creates a structure for the SELECT_OPTIONS
• The fieldnames are identical to SEL_fieldname (as in the structure for
standard data)
• The type of a certain field is a table of the corresponding SELECT-OPTIONS
SAP AG 2005, Title of Presentation / Speaker Name / 25
From old to new: application specific screens
Report or function group
Screen number
Name of the tab strip
Three different application specific screen are possible
SAP AG 2005, Title of Presentation / Speaker Name / 26
From old to new: application specific screens
PBO:
lcl_run = cl_fpp_interaction_runs=>get_run( ). Get run data from
lcl_cont = lcl_run->get_data_container( ). interaction layer
CALL METHOD lcl_cont->getdata
EXPORTING
name = 'ANY_NAME'
CHANGING
data = ANY_DATA. All application specific data
is stored in a data container
PAI:
lcl_run = cl_fpp_interaction_runs=>get_run( ).
lcl_cont = lcl_run->get_data_container( ).
CALL METHOD lcl_cont->setdata
EXPORTING
iv_name = ‘ANY_NAME'
data = ANY_DATA.
Example: Function group FPP_SAMPLE, screen 1234
SAP AG 2005, Title of Presentation / Speaker Name / 27
From old to new: LAUFD and LAUFI
FPP knows nothing about LAUFD and LAUFI, but….
Method CL_FPP_RUNS->GET_RUN_DATA returns an “EXTERNAL_RUNID”
If APPL (customizing) is set to “FI-CA”
• it is possible to enter LAUFD and LAUFI via UI
• the external run ID is set to LAUFD/LAUFI
This is the only part in the Framework where we hard coded on FI-CA!
SAP AG 2005, Title of Presentation / Speaker Name / 28
How to use all the new stuff
\\dwdf034\FICA_INT\New Mass Activities\FPP- How To.doc
\\dwdf034\FICA_INT\New Mass Activities\OpenPoints.xls
Demo program for the data container (AIR): ZGET_RID_OF_ADJUSTMENT
Demo for mass activities: Transaction FPP_SAMPLE or FPP_SAMPLE_FICA
SAP AG 2005, Title of Presentation / Speaker Name / 29
SAP AG 2005, Title of Presentation / Speaker Name / 30
SAP AG 2005, Title of Presentation / Speaker Name / 31