SlideShare a Scribd company logo
2
Most read
3
Most read
SQL-Script based Customer Exit for PAK Planning Functions on HANA.
Customers can implement own planning functionality by creating own planning function types and
assigning their own class to this planning function type. Such a class has to implement some
interfaces.
Starting from NW730 SP10 it is possible to implement customer planning logic in own SQL script
procedures which run in the HANA layer. Such procedures can be called by implementing the
Method TREX_EXECUTE in one of the following interfaces:
IF_RSPLFA_SRVTYPE_TREX_EXEC
IF_RSPLFA_SRVTYPE_TREX_EXEC_R
IF_RSPLFA_SRVTYPE_IMP_EXEC has to be implemented if no reference data shall be used
IF_RSPLFA_SRVTYPE_TREX_EXEC_R has to be implemented I reference data shall be available during
execution.
With NW740 once can also use ABAP managed database procedures to create SQL-Script.
Parameters for the SQL script procedure
The SQL script procedure must have an IN and an OUT table which have the structure of the
aggregation level. The procedure might have an additional table (with the same structure) which
contains the reference data (in case the interface IF_RSPLFA_SRVTYPE_TREX_EXEC_R was
implemented). Further the procedure might contain elementary IN parameters.
Infrastructure to Call SQL Script procedure
The SQL-script-procedure is called via the interface method:
if_rspls_sql_script->execute_sql_script.
This method has the following parameters:
I_VIEW Type Set to: i_view - importing parameter of
method TREX_EXECUTE
I_VIEW_REF Type Set to: i_view_ref - importing parameter of
method TREX_EXECUTE; in case you implement
IF_RSPLFA_SRVTYPE_TREX_EXEC_R
I_T_IOBJ_PARAM Type Each line in this table represents a parameter of
the SQL-script procedure. The fields are:
NAME Name of parameters
IOBJNM Info object (which defines the type of
the parameter)
VALUE value of the parameters
I_PROC_NAME Type SQL-Script-procedure name
I_R_MSG Type Ref To Set to: I_R_MSG - importing parameter of
method TREX_EXECUTE
R_RESULT_VIEW Type Move the value of the returning parameter to
r_s_view-view
An example how the method if_rsplfa_srvtype_trex_exec_r~trex_execute might be
implemented can look like this:
METHOD if_rsplfa_srvtype_trex_exec_r~trex_execute.
DATA: l_r_sql_script TYPE REF TO if_rspls_sql_script,
l_procedure_name TYPE string,
l_srvtypenm TYPE rsplf_srvtypenm,
l_t_iobj_param TYPE if_rsr_pe_adapter=>tn_t_iobj_param.
l_r_sql_script = cl_rspls_session_store_manager=>get_sql_script_instance( i_r_store = i_r_
store ).
* The method if_rspls_sql_script~get_parameter_values returns a table of parameters
* with the values given in the function definition
l_r_sql_script->get_parameter_values(
EXPORTING
i_r_param_set = i_r_param_set
i_para_name_for_procedure = 'HANA_PROCEDURE_NAME'
IMPORTING
e_procedure_name = l_procedure_name
e_t_iobj_param = l_t_iobj_param ).
* The function parameter given mehtod paramenter i_para_name_for_procedure
* will not be returned in the table e_t_iobj_param but the value of this
* function parameter will be returned int the mehtod parameter e_procedure_name
* This mechanisme can e.g. be used to define function specific HANA-procedure names.
* Other examples to get the name of the HANA-procedure name which will be called can be
* - you use the technical name of the planning function type:
l_srvtypenm = p_r_srv->get_srvtypenm( ).
l_procedure_name = l_srvtypenm.
* - or you simply give the HANA procedure name in a string:
l_procedure_name = 'MY_HANA_PROCEDURE'.
r_s_view-view = l_r_sql_script->execute_sql_script(
i_view = i_view
i_view_ref = i_view_ref
i_t_iobj_param = l_t_iobj_param
i_proc_name = l_procedure_name
i_r_msg = i_r_msg ).
ENDMETHOD. "IF_RSPLFA_SRVTYPE_TREX_EXEC_R~TREX_EXECUTE
Example for an implementation to call SQL script procedure
This example can be found in report RSPLS_SQL_SCRIPT_TOOL (please keep in mind that you have to
implement a public class in order to be able to assign the class to the planning function type in
transaction RSPLF1).
Blocking
Blocking has to be considered in the SQL script procedure itself.
Result table
The result table is treated as delta. So the values from the result table are aggregated to the original
values. This behavior is different from the behavior of the result table in the ABAP-Exit.
Tool Report
With the tool report RSPLS_SQL_SCRIPT_TOOL you can create the following Object on HANA
A table with the structure corresponding to the aggregation level. This table can be used to
give the type of the table parameters in your SQL script procedure
A body of the SQL script procedure. This procedure body contains the table parameters by
which data (on which the procedure shall operate) is passed and the returning table with the
procedure result. Additionally the elementary parameters from the function are listed with
the corresponding types.
Transportation of these objects between systems
In NetWeaver 7.30 and NetWeaever 7.31 you need to take care of transporting HANA Objects by
your own. With NetWeaver 7.4 onwards one can leverage ABAP managed database procedures to
transport them with other ABAP or BW objects using transport management system (transaction
STMS)

More Related Content

PDF
Trends in interactive design 2013
PPTX
An introduction to microsoft office 2007 lecture
PPT
The Power Of Mail Merge!
PDF
Microsoft Word Advance Features
PPTX
Be ready for opportunities in life
PPT
Training On Microsoft Excel
PPTX
Outlook Meeting Presentation
PDF
Design Systems at Scale
Trends in interactive design 2013
An introduction to microsoft office 2007 lecture
The Power Of Mail Merge!
Microsoft Word Advance Features
Be ready for opportunities in life
Training On Microsoft Excel
Outlook Meeting Presentation
Design Systems at Scale

Similar to Planning function on BPC hana system (20)

PPTX
ADVANCED MODELLING.pptx
ODP
PDF
BAPI - Criação de Ordem de Manutenção
PDF
Oracle_Analytical_function.pdf
PPT
Overview of query evaluation
ODP
PPTX
Presentation1
PPTX
Anchor data type,cursor data type,array data type
PDF
PBDL.pdf
PPTX
Part3 Explain the Explain Plan
DOC
3963066 pl-sql-notes-only
PPT
Module04
PPTX
Ground Breakers Romania: Explain the explain_plan
PDF
Regular%20 expression%20processing%20in%20abap
PPTX
Relational Database Management System
PPT
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
PDF
An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...
PPTX
Get started with R lang
PPT
Lecture 3. MS SQL. Cursors.
ADVANCED MODELLING.pptx
BAPI - Criação de Ordem de Manutenção
Oracle_Analytical_function.pdf
Overview of query evaluation
Presentation1
Anchor data type,cursor data type,array data type
PBDL.pdf
Part3 Explain the Explain Plan
3963066 pl-sql-notes-only
Module04
Ground Breakers Romania: Explain the explain_plan
Regular%20 expression%20processing%20in%20abap
Relational Database Management System
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...
Get started with R lang
Lecture 3. MS SQL. Cursors.
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
01-Introduction-to-Information-Management.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Classroom Observation Tools for Teachers
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Presentation on HIE in infants and its manifestations
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Lesson notes of climatology university.
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
master seminar digital applications in india
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
01-Introduction-to-Information-Management.pdf
A systematic review of self-coping strategies used by university students to ...
102 student loan defaulters named and shamed – Is someone you know on the list?
Classroom Observation Tools for Teachers
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra
Presentation on HIE in infants and its manifestations
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
GDM (1) (1).pptx small presentation for students
Lesson notes of climatology university.
human mycosis Human fungal infections are called human mycosis..pptx
VCE English Exam - Section C Student Revision Booklet
master seminar digital applications in india
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Ad

Planning function on BPC hana system

  • 1. SQL-Script based Customer Exit for PAK Planning Functions on HANA. Customers can implement own planning functionality by creating own planning function types and assigning their own class to this planning function type. Such a class has to implement some interfaces. Starting from NW730 SP10 it is possible to implement customer planning logic in own SQL script procedures which run in the HANA layer. Such procedures can be called by implementing the Method TREX_EXECUTE in one of the following interfaces: IF_RSPLFA_SRVTYPE_TREX_EXEC IF_RSPLFA_SRVTYPE_TREX_EXEC_R IF_RSPLFA_SRVTYPE_IMP_EXEC has to be implemented if no reference data shall be used IF_RSPLFA_SRVTYPE_TREX_EXEC_R has to be implemented I reference data shall be available during execution. With NW740 once can also use ABAP managed database procedures to create SQL-Script. Parameters for the SQL script procedure The SQL script procedure must have an IN and an OUT table which have the structure of the aggregation level. The procedure might have an additional table (with the same structure) which contains the reference data (in case the interface IF_RSPLFA_SRVTYPE_TREX_EXEC_R was implemented). Further the procedure might contain elementary IN parameters. Infrastructure to Call SQL Script procedure The SQL-script-procedure is called via the interface method: if_rspls_sql_script->execute_sql_script. This method has the following parameters: I_VIEW Type Set to: i_view - importing parameter of method TREX_EXECUTE I_VIEW_REF Type Set to: i_view_ref - importing parameter of method TREX_EXECUTE; in case you implement IF_RSPLFA_SRVTYPE_TREX_EXEC_R I_T_IOBJ_PARAM Type Each line in this table represents a parameter of the SQL-script procedure. The fields are: NAME Name of parameters IOBJNM Info object (which defines the type of the parameter) VALUE value of the parameters I_PROC_NAME Type SQL-Script-procedure name I_R_MSG Type Ref To Set to: I_R_MSG - importing parameter of method TREX_EXECUTE R_RESULT_VIEW Type Move the value of the returning parameter to r_s_view-view An example how the method if_rsplfa_srvtype_trex_exec_r~trex_execute might be implemented can look like this:
  • 2. METHOD if_rsplfa_srvtype_trex_exec_r~trex_execute. DATA: l_r_sql_script TYPE REF TO if_rspls_sql_script, l_procedure_name TYPE string, l_srvtypenm TYPE rsplf_srvtypenm, l_t_iobj_param TYPE if_rsr_pe_adapter=>tn_t_iobj_param. l_r_sql_script = cl_rspls_session_store_manager=>get_sql_script_instance( i_r_store = i_r_ store ). * The method if_rspls_sql_script~get_parameter_values returns a table of parameters * with the values given in the function definition l_r_sql_script->get_parameter_values( EXPORTING i_r_param_set = i_r_param_set i_para_name_for_procedure = 'HANA_PROCEDURE_NAME' IMPORTING e_procedure_name = l_procedure_name e_t_iobj_param = l_t_iobj_param ). * The function parameter given mehtod paramenter i_para_name_for_procedure * will not be returned in the table e_t_iobj_param but the value of this * function parameter will be returned int the mehtod parameter e_procedure_name * This mechanisme can e.g. be used to define function specific HANA-procedure names. * Other examples to get the name of the HANA-procedure name which will be called can be * - you use the technical name of the planning function type: l_srvtypenm = p_r_srv->get_srvtypenm( ). l_procedure_name = l_srvtypenm. * - or you simply give the HANA procedure name in a string: l_procedure_name = 'MY_HANA_PROCEDURE'. r_s_view-view = l_r_sql_script->execute_sql_script( i_view = i_view i_view_ref = i_view_ref i_t_iobj_param = l_t_iobj_param i_proc_name = l_procedure_name i_r_msg = i_r_msg ). ENDMETHOD. "IF_RSPLFA_SRVTYPE_TREX_EXEC_R~TREX_EXECUTE Example for an implementation to call SQL script procedure This example can be found in report RSPLS_SQL_SCRIPT_TOOL (please keep in mind that you have to implement a public class in order to be able to assign the class to the planning function type in transaction RSPLF1). Blocking Blocking has to be considered in the SQL script procedure itself. Result table The result table is treated as delta. So the values from the result table are aggregated to the original values. This behavior is different from the behavior of the result table in the ABAP-Exit. Tool Report With the tool report RSPLS_SQL_SCRIPT_TOOL you can create the following Object on HANA A table with the structure corresponding to the aggregation level. This table can be used to give the type of the table parameters in your SQL script procedure
  • 3. A body of the SQL script procedure. This procedure body contains the table parameters by which data (on which the procedure shall operate) is passed and the returning table with the procedure result. Additionally the elementary parameters from the function are listed with the corresponding types. Transportation of these objects between systems In NetWeaver 7.30 and NetWeaever 7.31 you need to take care of transporting HANA Objects by your own. With NetWeaver 7.4 onwards one can leverage ABAP managed database procedures to transport them with other ABAP or BW objects using transport management system (transaction STMS)