Skip to Content

How to debug javascript function which is defined in .xsjslib?

Nov 07, 2017 at 01:54 PM


avatar image

I am facing an issue with debugging a javascript function which is defined and implemented in .xsjslib file. I am using SAP HANA web based development workbench tools trail version.

how to attach function defiined in .xsjslib to .xsjs file?

Please help me

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
Nov 07, 2017 at 02:32 PM

What is your question here? Are you asking for debugging a function in an xsjslib or how you can use an xsjslib function in your xsjs service?

Regarding the debugging: Debugging of functions in a xsjslib is possible, but the functions have to be called from an xsjs service, because an xsjslib function is not executable standalone. So set your breakpoint in the xsjslib function and then call the xsjs service in which you have called the function. The debugger stops then on the defined breakpoint (if everything else regarding debugging is configured correctly in your system).


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Florian,

Here is my .xsodata service


"KENGUVA"."EMPLOYEE" as "Employees"

create using "xsjsLibDemo::testProc"

events ( before "xsjsLibDemo:dbUpdate.xsjslib::insert_data" );


and code in dbUpdate.xsjslib is follows:


function insert_data(param) {

let after = param.afterTableName;

let pStmt = param.connection.prepareStatement('update "' + after + '" set EMPID = "KENGUVA"."EMPID".NEXTVAL');





I am using SAPUI5 ODATA batch request to this service, So can you please help me how to attach .xsjs service for this to do debugging?


Ok, that is a new information that your specific case is an OData exit.

I don't know any option debug it via the Web Based dev workbench, just via HANA Studio -> check the post Is it possible to debug XSJSLIB?