cancel
Showing results for 
Search instead for 
Did you mean: 

Call RFC from SAP UI5 application

Former Member
0 Kudos

Hello,

We are planning to develop some SAP UI5 application based on the Java development using NWDS. I was searching online on how we can call RFCs from SAP UI5 applications but did not find specific details.

I know there is one way to do it through Gateway. But we do not have SAP Gateway right now and not planning to get in near future due to licensing cost.

So, I was told to develop something in SAP UI5 without using SAP Gateway and interact with SAP system.

Can someone tell me the procedure or the path to take?

So far i understood that, I can call RFCs through JCOs or I can publish RFCs as Web Services and then call that WS. But, need to convert SOAP response to JSON in order to consume it in the SAP UI5. Is it true?

If that is right, what are the ways to consume either SAP Web Service or RFCs in SAP UI5 application?

Thanks,

Bhavik

Accepted Solutions (1)

Accepted Solutions (1)

venkatakalyan_karanam
Active Contributor

Hi Bhavik

You can not consume the RFC Directly.

Because SAP UI5 is a open source and is not a integrated and tight framework as in WD Java or WD Abap where you can directly consume using JCO's in case wdjava and a just RFC call in WD Abap.

Here in SAPUI5 as a open framework only understands the open protocols like json,xml or oData.

So at any cost your RFC has to be converted /exposed to the one of these protocol

That is what the Netweaver Gateway comes into the picture.

Use Gateway to publish RFC as a oData Channel URL so that you can consume easily

Hope this will help you.

Regards

KALYAN

Former Member
0 Kudos

Hi Kalyan,

I have learnt about that and I know if SAP gateway is there it make life easier.

BUT, IF someone do not have SAP Gateway and still trying to achieve the requirement then what could be the options?

Can't I call RFCs from Java and then convert the response to json the way UI5 understands?

Logically, it sounds right and could be done logically, but technically I do not know how i can convert that.

That is why I have opened this thread. So, if anyone knows about it on how to do it then it would be really helpful.

-Bhavik

former_member182650
Contributor
0 Kudos

Hi Bhagat,

I recommend SAP GW to expose business logic. It allows you to use standard SSO mechanisms or extend generated services with custom ABAP code to do any custom logic. You can expose any RFC or Function in easy way.

If you decide don't use GW it is possible consume directly an RFC with this custom Json adapter  on Abap side or you could create a service layer with Jersey in Java https://jersey.java.net

Hope this helps you,

Kind regards

Former Member
0 Kudos

Thanks Angel for providing the details specifically how it can work without SAP Gateway.

Do you have any example with either alternatives on how it works?

Also, we have heard that SAP Gateway will be available without additional cost with 7.4 version. Is it true?

What kind of stuff we will get with SAP 7.4 version for SAP Gateway? Do we need any additional middleware along with it or if we just upgrade to 7.4 version, we should be good to go?

Thanks for your help.

-Bhavik

former_member182650
Contributor
0 Kudos

Hi again,

I have developed a few entities on Java side with Jersey. Follow this example

In our customers SAP GW is licensed by user but it is possible to license by use depending on your business scenario. For example this package of GW sessions

https://store.sap.com/sap/cp/ui/resources/store/html/SolutionDetails.html?pid=0000009470&catID=&pcnt...

In 7.3 GW is an Abap AddOn. In 7.4 GW it's included. In my opinion you don't need migrate if your only purpose is being able to integrate throught SAP GW. There's a lot of things to plan before a migration (Zprogs, ...)

Kind regards!

Former Member
0 Kudos

This is how you can use RFC in SAP UI5.

1)Use Java/EJB development to develop JCo based application, this can use JCo architecture to make call to your RFCs , use SSO etc as per standards. Also you can develop a PDK application if you like to make a call to RFCs

2) Use a PDK component or servelet to make a call to your EJB layer or make a direct Jco connection

3) Download some free JSON libs (google gson is a good one).

4) Use GSON or any JSON libs to convert the Java object returned by JCo or EJB layer

5) Now take that JSON return type and send in the PDK or servlet response, you got yourself a good JSON object (not oData)

6) Now call this JSON from you SAP UI5 views/controllers and build the UI5 apps

This is good for a small application very soon you will realize that you have to do lot of development just to get along with the EJB/PDK layer to give you data you need, that makes the case of having nw gateway.

Former Member
0 Kudos

Thanks.

While going through all the options, we may go for SAP Gateway to start developing SAP UI5 applications.

Can you please confirm below are the right assumptions?

1. SAP 7.4 has SAP Gateway component included. But does is have any additional license or cost for the usage?

2.  I believe, Gateway component will be lying on ABAP system. Do we need to install it in the separate server or can we upgrade existing SAP system to 7.4 and use Gateway on that?

3. Do we need to do anything on the Portal? We have EP 7.31 right now. Do we need to upgrade or install any additional components on Portal?

Thanks,

Bhavik

former_member182650
Contributor
0 Kudos

Hi again Bhagat,

1. Yes, it's included on 7.4 ABAP Stack (). In a recent customer, SAP licences GW by user but there are other license model like session licensing: https://store.sap.com/sap/cp/ui/resources/store/html/SolutionDetails.html?pid=0000009470&catID=&pcnt...

2. You could install as an AddOn on your 7.3 system, there are many options depending on your desired infrastructure: For example our customer have deployed Central Hub Gateway in a standalone stack ABAP to act as an standalone oData bridge between ABAP/nonAbap systems.

3. You could deploy SAPUI5 apps in 7.x, Java Web Servers or HTTP Web Servers. You must consider your SSO scenario:

- SSO Logon Tickets. You will need to configurate SSO Logon Tickets between SAP NW Portal & SAP NW Gateway & your backend (ECC, etc). In order to pass SAP session cookie you will need setup SAP Web Dispacther and access portal & gateway throught SAP WD with the same domain.

- SAML2 Tickets. This scenario lets you provide portal & gateway on different domains enabling SSO. You could configure SAP NW Portal as an Identity Provider and other systems must trust SAP Portal as IdP.

Cheers

Former Member
0 Kudos

So, based on  your response for point#1, it means that even though SAP Gateway is available with 7.4, there would be separate licensing based on the usage or users and it would be separate than SAP ECC license.

If we go by per user approach, I am sure there would be license for existing SAP ECC system. (Per user or per usage... dont know exactly) So, for SAP Gateway it would be additional or would be considered as part of the ECC license?

-Bhavik

former_member182650
Contributor
0 Kudos

Hi Bhagat,

I think you should ask directly SAP for licensing costing.

I've referenced our customer installation based on GW 7.3 as an Addon of ECC (1 license for GW user & 1 licence for ECC user). It could be different depending on new 7.4 architecture (It shouldn't be, but better ask to SAP).

Kind regards

david_fryda2
Participant
0 Kudos

Hi Ajay,

I am developing SAPUI5 using jsp file.

I succeed calling RFC fromthat  jsp using JCo.

This JSP is deployed in the portal AS J2EE server.

The question is: why should I use JSON to convert the Java object returned by JCo?

Thanks.

Regards.

Answers (3)

Answers (3)

varun_boyina
Participant
0 Kudos

Hi Bhagat Sanjay ,

Please refer to below link where I have shown how to call RFC using SAP JCO Connector.

Regards,

Varun

david_fryda2
Participant
0 Kudos

Hi.

If I want to consume a web service that I wrote in Java, how should I do it (so no SAP Gatewayhere of course)?

The web service is deployed on SAP Portal WAS.

If I understood good, I think I should avoid using REST method.

Thanks.

Regards,

varun_boyina
Participant
0 Kudos

Hi David Fryda ,

Please see the below link where in I have explained how to call a webservice in SAP UI5.

Regards,

Varun

Former Member
0 Kudos

hi Bhavik,

Please see the below link, it may be helpful.

http://scn.sap.com/message/14191555

Regards,

Prasad.