As you certainly know, SAP Profitability and Performance Management (PaPM) is a modern modeling application for covering business requirements beyond standardized best practices. It was designed for being used by business users and therefore strives for replacing coding and scripting (as often necessary in other solutions) with configuration enabling business users to become more independent from IT and to extend and optimize allocation and calculation models much faster.
However, in some situations it might still be helpful to include SQL coding (SAP HANA stored procedure) into a model, for instance in the initial implementation project when you can take it over from the predecessor application.The attached screen shots demonstrates how you can embed SQL code (an SAP HANA stored procedure) into a model of PaPM.
The same function (PaPM business function Remote Function Adapter) can of course also be used for connecting to other applications and systems including S/4HANA, web-services or an R server.
Find everything about PaPM in the application help under this link.