cancel
Showing results for 
Search instead for 
Did you mean: 

Call multiple external services in CAP

arjun_thakur
Active Contributor
0 Kudos

Hi Experts,

I have a design related question.

We are planning to build a SCP based application which needs to fetch and post data to S4 HANA Cloud system. We are planning to use CAP based approach to build this app. As per the requirement, we need to display data on the Fiori screen, but the data is to be fetched from multiple APIs from S4HC, is to be merged together and then show on screen.

Can you please advise what would be the best design to handle such scenario. I have seen multiple blogs explaining how we can call external service in a CAP project, but how do we call multiple APIs in CAP and how do we merge their data together and expose it as a single service.

Any advise, pointers, blog etc would be helpful.

Regards,

Arjun

gregorw
Active Contributor
0 Kudos

Do you want to use CAP Java or NodeJS?

arjun_thakur
Active Contributor
0 Kudos

Hi Gregor,

I am open to both CAP Java or NodeJS. Would like to use the option which is easy and more flexible. Any suggestions?

Any blog/sample code would be helpful. Thanks!!

Regards,

Arjun

0 Kudos

Hi Gregor. I want to use CAP Java example for calling and consume an API from S4Hana Cloud.

daniyalahmad
Discoverer
0 Kudos

Kindly provide any link for consume external rest api sap cap using java. Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Jacky_Liu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, Arjun

I think you question shoud be split into 2.

1, how to CURD data in S/4 Hana cloud .

You can use sap cloud sdk in cap . Both java and nodejs are ok .

2, How handle the data which has been read in 1 .

Best choice is not fetching data from s/4 and then handling in BTP. Best choice is creating custom cds view in S/4 to , which will push the data handling logic in hana database .

If you have to handle the fetched data in BTP, Java or ABAP would be better choice . The reason is nodejs is good at IO intension , not so good at calculation intension.

Hope this help !

Best regards!

Jacky Liu

gregorw
Active Contributor
0 Kudos
mkuhr-test
Advisor
Advisor
0 Kudos

HI Arjun, not answering your actual question but I just want to point out that you can use the SAP Cloud SDK within your CAP application to connect to S/4HANA APIs. In fact the Cloud SDK comes with a library of all S/4HANA OData APIs you can just use. To get started we have a tutorial on how to use the Cloud SDK in a CAP application to connect to S/4HANA: Use the SAP Cloud SDK in the SAP Cloud Application Programming Model

Check out the documentation for more details on how to use the SAP Cloud SDKs OData features: OData | SAP Cloud SDK There is also support for other types of APIs (plain REST, SOAP) if that is for you and let me know if you have further questions on the connectivity and API consumption part of S/4HANA.