Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)
Solved

Ajax Call

Hi


We are building a mobile version of an existing web app.  We have a restful service call that returns data in json format.


This service is on a different node than Neptune .


Can I call the service from a  Neptune application and bind the results to appropriate model components.


Or, can I call the service from a method on the application class.  If this is possible I could convert the json and pass it back to the neptune application.


Many thanks


Darren


Hi Darren,


As you correctly said, I can think of two ways of doing it.  

One option is that you could consume the service on the ABAP side, parse your data and then send it to the client side.  Here you should take into account two things:

1 - you would need a security certificate installed on SAP in order to run the https.

2 - on the client (Neptune app) side, we do not deal with complex nested structures.  We only deal with tables / workareas.


Another option is to do it on the client side.  Here I would create a Script Code object and manually code the ajax call inside.  Then you would need to setdata() into the model you are working on.

A good way to manually code the ajax call is to view the source code of any existing Neptune app.  There you will find the ajax call inside every getOnline....() function.


Hope it helps you, thanks and regards,

Julian


1 person likes this

Hi Julian


Thanks for the getOnline tip, I now have my ajax calls working perfectly... many thanks

You are welcome ;)

Login or Signup to post a comment