Skip to Content
1

Java Script exit method on XSA using Batch requests.

Apr 06, 2017 at 12:00 PM

188

avatar image
Former Member

Hello.

I have an issue regarding the JS exit method on XSA. Here are the detailed steps whichi have done.

First of all, I have a CDS view with a simple entity:

entity BusinessPartner {  
     key BusinessPartnerID: Integer; 
     isCustomer: hana.TINYINT;
     Name: String(100);   
     isSupplier: hana.TINYINT;
}

Then, a simple odata service:

service namespace "SUPPLY_CHAIN_TRACKING"{  
   "poc_scm.db.data::SupplyChainTracking.BusinessPartner"                        as "BusinessPartnerSet" 
} 

At this moment, everything is perfect.

In the next step, I want to use a JS function exit on entity creation, so, I created a businessPartnerCreateMethod.xsjslib file, and on that file I have a createMethod with some insert logic.

The next step is to change the odata service declaration:

service namespace "SUPPLY_CHAIN_TRACKING"{  
   "poc_scm.db.data::SupplyChainTracking.BusinessPartner"                        as "BusinessPartnerSet"  
create using"xsjs:businessPartnerCreateMethod.xsjslib::createMethod"; }

When I do a simple POST request, everything is working. The create method is called, everything is ok.

The problem comes, when I do the Batch request. On Batch request, the error message says:

{"error":{"code":500,"message":{"lang":"en-US","value":"context.functionExecutor is not a function"}}} (It works for a simple POST request!)

Any help will be appreciated. Thank you.

P.S If someone need more information, I can provide it.

10 |10000 characters needed characters left characters exceeded
Former Member

Hi Alex, did you find a solution by any chance?

0
Former Member
Former Member

Hi Neha. Unfortunately not.

0
Former Member

I managed to run it with a single request and the workaround was to turn the batch request mode off in the SAPUI5 app. But I don't know the way to fix it while using the batch mode.

oModel.setUseBatch(false);
oModel.submitChanges();
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Christian Lechner
Jun 26, 2017 at 06:45 AM
0

Hi Alexandru,

the issue should be solved with SAP note 2421178

Best regards,

Christian

Share
10 |10000 characters needed characters left characters exceeded