Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SM59 maintenance to external system - for external system REST API call

xiswanto
Active Participant
0 Kudos
1,292

Hello all,

I am wondering, before I call external system REST API ( GET / POST / other method ) in my custom program, Do I need to maintain SAP connection to the external system in SM59?

If so, how do I fill in the 'target host' and 'Service No.' field, is there any documentation on how to maintain SM59 and finding out the target system information for those 2 field?

*I am in ABAP module, and wanted to learn a bit about Basis knowledge, but it seems my Basis guy forgot how to use the tcode.

Regards,

Siswanto

1 ACCEPTED SOLUTION

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
965

> Do I need to maintain SAP connection to the external system in SM59?

As far as I know, the ABAP HTTP Client supports two modes of operation: one is by specifying an SM59 destination (and the connection parameters (target host and port, credentials, etc.) are then defined in that destination), and another one is by specifying the connection parameters directly in the code, when calling CL_HTTP_CLIENT.
So the answer is: no, you don't need to, but in some situations it may be easier.

> If so, how do I fill in the 'target host' and 'Service No.' field, is there any documentation on how to maintain SM59
> and finding out the target system information for those 2 field?

This question cannot be answered... It is similar to the question "Ok, I have now bought this nice new telephone. Can someone tell me what numbers I have to type, in order to use it?" -- Well, it depends...! If you want to call your mother, type the number of your mother; and if you want to call the local pizza store and order a pizza, then type the number of the local pizza store... 🙂

Same here. Host and Service need to be the host and service (or port) of the machine, where the REST API is hosted, that you want to call.

4 REPLIES 4

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
966

> Do I need to maintain SAP connection to the external system in SM59?

As far as I know, the ABAP HTTP Client supports two modes of operation: one is by specifying an SM59 destination (and the connection parameters (target host and port, credentials, etc.) are then defined in that destination), and another one is by specifying the connection parameters directly in the code, when calling CL_HTTP_CLIENT.
So the answer is: no, you don't need to, but in some situations it may be easier.

> If so, how do I fill in the 'target host' and 'Service No.' field, is there any documentation on how to maintain SM59
> and finding out the target system information for those 2 field?

This question cannot be answered... It is similar to the question "Ok, I have now bought this nice new telephone. Can someone tell me what numbers I have to type, in order to use it?" -- Well, it depends...! If you want to call your mother, type the number of your mother; and if you want to call the local pizza store and order a pizza, then type the number of the local pizza store... 🙂

Same here. Host and Service need to be the host and service (or port) of the machine, where the REST API is hosted, that you want to call.

0 Kudos
965

Hello Ulrich,

> Host and Service need to be the host and service (or port) of the machine, where the REST API is hosted

ok, for target host, I might have an idea where to find out about it, but where can I find the 'service no' information? say I'm trying to find out the service no of another SAP system , Is it located within a text file in the machine, or Command Prompt, or in the database server config?

Comparing to the new phone case you've explained, its like "I have a phone, I want to type the number, I want to know the phone number of the other person number, but he himself does not know it, so he lend me his phone, I search through the setting of the phone and found the information (in this case, the phone number)', but with the external system case, I wanted to search for the information of 'service no' but I have no idea where should I start searching for it (lets say I have access locally to the machine).

965

Hello Siswanto,

the "service no" is usually only a "port number". For example, the "standard service" for HTTP is 80 and for HTTPS is 443. If you have a URL for the REST API, then the port must be part of that URL. E.g.

https://rest-server.hostname.com:8080/folder/folder/rest-api

In this case the "service number" is simply "8080". The administrator of the REST API (or the public documentation of that API) will tell you all you need: the hostname, the port (= "service no"), the path and (optionally) the input parameters. (But I think that REST APIs usually require their input in the HTTP body and not in the URL?!)

This is just the well-known definition of any URL:
https://host:port/path?inputParam1=value1&inputParam2=value2 , e.g. see the standard documentation of URLs and URIs.)

If the target system is a SAP system, then the port number usually is 80NN for HTTP and 443NN for HTTPS, where NN is the instance number of the SAP system. In most cases, the instance number is 00, so you would get 8000 for HTTP and 44300 for HTTPS, which you would then have to enter as "service no" in SM59, together with the hostname of the SAP system.

0 Kudos
965

Hello Ulrich,

Noted, so both information I wanted is contained within the url of the REST API itself.

Much appreciated.