cancel
Showing results for 
Search instead for 
Did you mean: 

how i can pass this sy-mandt value in HANA XSJS File

Former Member
0 Kudos

Dear Colleagues,

I am using an ABAP Managed Database Procedure in a HANA XSJS Service.

The system i use has HANA as its Primary DB.

I need to pass the client (sy-mandt) and bp id to this procedure and get the customer info.

This client can vary depending depending on the system.

I want to know how i can pass this sy-mandt value in HANA XSJS File or would i need to hardcode it in the xsjs file for the systems .

Code as below:

var body = '{'; 

         var bpid = $.request.parameters.get("BPID"); 

          var conn = $.db.getConnection();

     try{

  var client = '800';

         var pc = conn.prepareCall('CALL "SAPTEST"."CL_CUST_OPEN_INVOICES=>GET_CUST_INFO"(?,?,?) WITH OVERVIEW');

        // var cst = conn.prepareCall(pc);

pc.setString(1, client);

pc.setString(2, bpid);

pc.execute();

Please suggest.

Thanks,

Ipsita

Accepted Solutions (0)

Answers (1)

Answers (1)

sreehari_vpillai
Active Contributor
0 Kudos

hi Ipsita,

You can URL Mangle the sap client.

http://*.*:8nnn:/myXSJS/GEtClient.xsjs?sap-mandt=800

in your XSJS implementation,

var client = $.request.parameters.get("sap-mandt");


client variable will hold the client.

Sreehari


Former Member
0 Kudos

Hi Sreehari,

We tried the above as well : we call the XSJS from the UI5 Code as below and then use the values in our code :

http://test:8000/myPacakage/services/getInvoiceInfo.xsjs?BPID=0100000003&CLIENT=800

but the question here is if tomorrow i login to a different system again in the ui code i would need to change the Client value.

Is there some way to dynamically fetch this value.

Thanks,

Ipsita

sreehari_vpillai
Active Contributor
0 Kudos

Hi Mohanty,

If you are deploying the UI5 application in XS engine, then add a filter option for client. Or, you can qury T000 table from XS if you can distinguish the available clients.

Sreehari