cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Service Layer Actions from Script

Former Member
0 Kudos

Dear Experts,

We are developing with HANA Service Layer.

We want to call an Action from JavaScript like getting series numbering with "SeriesService_GetDocumentSeries" action.

Can you please advise how can we achieve this ?

Kind Regards,

Aggelos Galis

Accepted Solutions (1)

Accepted Solutions (1)

former_member390407
Contributor
0 Kudos

Placed an Idea at SAP customer influence: Please, vote for me

Answers (3)

Answers (3)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aggelos, Sergei,

I have checked internally, B1 Services are not supported from SL Script Egine.

Sergei listed the Cancel and Close operations, the same applies for all B1 Services including the SeriesService you are trying to use.

You can ask for this requirement into our SAP Business One Idea place at: https://influence.sap.com/sap/ino/#/campaign/887, check the blog https://blogs.sap.com/2016/08/30/login-to-the-idea-place-for-sap-business-one-will-be-changed-on-sep... for more details.

Sorry Sergei, I read the answer too fast...

Regards,
Trinidad.

0 Kudos

Hello Trinidad, Aggelos, Sergei,

What if I want to extend SL functionality? I've seen the option of writing SL scripts and invoke them as if they were a sort of addon.

I have tried one of those scripts -https://172.19.25.11:50000/b1s/v1/script/test/test_items('A00006')- you can code GET, POST, PATCH, DELETE.

I am integrating a POS and my problem is that I need to know how many remaining items I have for a batch number in a specific warehouse (OBTQ Table)

I understand that from SL I can not do a HANA Query. Am I wrong?

Is there a way to go from SL to DI Core (DI API has an option to return a resultset from a query)?

Best Regards.

Hector.

former_member390407
Contributor
0 Kudos

Hi Aggelos,

I've got the response from the support and, unfortunately, it's not implemented yet.

The reply text:

Dear Sergei Travkin,

Currently script engine does not support actions such as cancel.

Below workaround can be applied from 9.3PL5 to Cancel an existing document through Service Layer:

A/P Invoice: POST /b1s/v1/PurchaseInvoices(XX)/Cancel

A/P Credit Memo: /b1s/v1/PurchaseCreditNotes(XX)/Cancel

As this functionality is currently missing in Service Layer, please kindly follow the instructions in note 1028874 for a request.

Thank you for your cooperation and understanding.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sergei,

thanks for sharing this information.

Regards,
Trinidad.

former_member390407
Contributor
0 Kudos

Hi mariatrinidad.martinezgea ,

Yes, if you check his reply you will see that he asked about the SE:

I am successfully using the services from an external tool (Postman in my case) but what I am trying, and I can't seem to find an example for, is to use these services from the script file that I deploy in the Extension Manager.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aggelos,

Have you checked the Service Layer documentation available with your Service Layer installation?

You can access it at: https://YOUR_B1H_SERVER:50000

The User Manual talks about generic Service Layer operations.

The API Reference give details of each one of the services and operations exposed.

In the API Reference page you can see a sample how to use each one of the services, for example for your specific case:

POST SeriesService_GetDocumentSeries

Invoke the method 'GetDocumentSeries' on this service by specifying the payload 'DocumentTypeParams' in the JSON format.

Example

POST https://localhost:50000/b1s/v1/SeriesService_GetDocumentSeries

{ "DocumentTypeParams": { "Document": "2", "DocumentSubType": "C" } }

Hope it helps,
Trinidad.

Former Member
0 Kudos

Hi,

First of all thanks for your quick answer.

I have already checked the Service Layer documentation (both the User Manual and the API Reference).

I am successfully using the services from an external tool (Postman in my case) but what I am trying, and I can't seem to find an example for, is to use these services from the script file that I deploy in the Extension Manager.