Can I call functions in ABAP proxy?

The scenario is JDBC to ABAP proxy.
PI reads data from the external database and writes the data into SAP tables. Besides I need to call functions, such as retrieving sales organization, in the proxy.

After I add the codes, data was not inserted into SAP table. It looks like the proxy is not executed.
Then I set a Breakpoint and try again. Debugging is not triggered.

And then set an external Breakpoint. Go to 'Utilities', 'Settings':

Here enter user PIAPPLUSER.  The proxy is executed by PIAPPLUSER in background. I find out why:

PIAPPLUSER has no authorization to debug.

PIAPPLUSER has no authorization to call the functions.

PIAPPLUSER only has a role of SAP_XI_APPL_SERV_USER be default.

So modify the profile of PIAPPLUSER in the SAP system.

At last, I can debug the proxy, and the scenario works out.

SAP Developer Network SAP Weblogs: SAP Process Integration (PI)