cancel
Showing results for 
Search instead for 
Did you mean: 

Calling SEGW service from within ABAP Code

agnihotro_sinha2
Active Contributor
0 Kudos

Hi,

I have registered an FM with SEGW and implemented methods in it.

My service is created now. Can I call this service from within an ABAP code?

I want to do this so as to use the Gateway functions and security. All I know to execute this is via SEGW. Need some standard FM or classes via which I can call this _SRV service of the gateway and get the response back in my code.

Thanks,

Ags

Accepted Solutions (0)

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Sinha,

Technically you can using cl_http_client & if_http_client

Below are the references ->

How to consume oData Service in ABAP client? | SCN

But still not sure why you would like to consume GW Service this way.

Regards,

Ashwin

agnihotro_sinha2
Active Contributor
0 Kudos

Yes, I have gone through these post earlier and thought that there will be some other alternate ways to call the Services since its already inside SAP. These posts explains how to call external URLs. SO I guess, to call SEGW service URL from ABAP using these classes, we need to mention the complete sap server path as url??

What happens to this code when it moves to Quality or PRD ? Wont the path change? How do we handle that?

AshwinDutt
Active Contributor
0 Kudos

Yes complete path we need to give.

Not sure on this.

Looks like we need to write the code such a way that we read the SY-SYSID and then use the path.

May be one code which has all paths before hand and use it based on SY-SYSID.

SB9
Active Participant
0 Kudos

Why would you want to read Gateway service from ABAP ? Why not call the function module or methods directly from ABAP.

Gateway service is meant to be consumed by front end (like browsers) using SAPUI5 or any other javascript based technology (jQuery), etc.