SlideShare a Scribd company logo
1 of 3
Download to read offline
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

What's hot

Enhancing data sources with badi in SAP ABAP
Enhancing data sources with badi in SAP ABAPEnhancing data sources with badi in SAP ABAP
Enhancing data sources with badi in SAP ABAP
Aabid Khan
 
Customer exit variables in sap
Customer exit variables in sapCustomer exit variables in sap
Customer exit variables in sap
saborhade
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
 

What's hot (20)

Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Backend roles for sap bpc
Backend roles for sap bpcBackend roles for sap bpc
Backend roles for sap bpc
 
sap script overview
sap script overviewsap script overview
sap script overview
 
Enhancing data sources with badi in SAP ABAP
Enhancing data sources with badi in SAP ABAPEnhancing data sources with badi in SAP ABAP
Enhancing data sources with badi in SAP ABAP
 
Customer exit variables in sap
Customer exit variables in sapCustomer exit variables in sap
Customer exit variables in sap
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
 
Bapi programming
Bapi programmingBapi programming
Bapi programming
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
SAP Cloud Platform - Integration, Extensibility & Services
SAP Cloud Platform - Integration, Extensibility & ServicesSAP Cloud Platform - Integration, Extensibility & Services
SAP Cloud Platform - Integration, Extensibility & Services
 
Abap proxies
Abap proxiesAbap proxies
Abap proxies
 
Introduction to BOL programming
Introduction to BOL programmingIntroduction to BOL programming
Introduction to BOL programming
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questions
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
Sap implementation
Sap implementationSap implementation
Sap implementation
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
How to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selectionHow to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selection
 
Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3
 
HANA Modeling
HANA Modeling HANA Modeling
HANA Modeling
 
What's New in SAP HANA View Modeling
What's New in SAP HANA View ModelingWhat's New in SAP HANA View Modeling
What's New in SAP HANA View Modeling
 

Similar to Planning function on BPC hana system

Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
avniS
 
Presentation1
Presentation1Presentation1
Presentation1
Jay Patel
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
dhruv patel
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
Ashwin Kumar
 
Regular%20 expression%20processing%20in%20abap
Regular%20 expression%20processing%20in%20abapRegular%20 expression%20processing%20in%20abap
Regular%20 expression%20processing%20in%20abap
abaperscnjavasdn
 

Similar to Planning function on BPC hana system (20)

ADVANCED MODELLING.pptx
ADVANCED MODELLING.pptxADVANCED MODELLING.pptx
ADVANCED MODELLING.pptx
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
BAPI - Criação de Ordem de Manutenção
BAPI - Criação de Ordem de ManutençãoBAPI - Criação de Ordem de Manutenção
BAPI - Criação de Ordem de Manutenção
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdf
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Presentation1
Presentation1Presentation1
Presentation1
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
 
Database programming
Database programmingDatabase programming
Database programming
 
PBDL.pdf
PBDL.pdfPBDL.pdf
PBDL.pdf
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain Plan
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
 
Module04
Module04Module04
Module04
 
Ground Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planGround Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_plan
 
Regular%20 expression%20processing%20in%20abap
Regular%20 expression%20processing%20in%20abapRegular%20 expression%20processing%20in%20abap
Regular%20 expression%20processing%20in%20abap
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...
An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...
An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Qu...
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
Lecture 3. MS SQL. Cursors.
Lecture 3. MS SQL. Cursors.Lecture 3. MS SQL. Cursors.
Lecture 3. MS SQL. Cursors.
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

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)