How to use Postman tool to test SAP Interfaces
Here we will try to cover end to end scenario from setting up Postman to connecting it with SAP. Postman is widely used tool by developers. It helps in testing the interface without bothering or involving third parties.
SAP connects to multiple systems through various interfaces, to exchange different kinds of data. So in order to develop these interfaces between third party and SAP, lot of testing and integration undergoes. Developing / Building interface is a complex and tedious task. It requires lot of testing to verify numerous scenarios.
While building the interface many times developer has to test the interface to check whether the development is in right direction or not. And it is not easy task to reach out and coordinate with third parties to carry out such testing. This is where Postman comes in. It acts as third party and helps developer to test the interface.
Through postman we can trigger the same data that we are supposed to receive from third party system. so without any further adieu, lets get started with setting up of postman.
Download Postman App
Search the same heading on google. Go into first website and download Postman application.
Open the downloaded file and it will self-install in less than a minute.
Enter your email ID to create free account:
Click on create new account
And there you go..
Once postman is launched, you can take overview tutorial to take quick look at screens and how to navigate through postman.
On the Postman screen you can anytime press Ctrl + T and start new request. You can also create collection of requests and store it in folders.
If you press Ctrl + T, new request screen will open.
In this you can create request for these many options. (Get, Post, Put, Patch and so on)
Mainly we will be using Get and Post request only.
All right, rest of the Postman we will explore while testing a scenario.
In SAP, ABAP Proxy is a tool which works very similar to API. It enables web services within SAP to connect directly to the third party systems.
So here we will take one example of web service enabled proxy interface. Hope you have little bit understanding on proxy interfaces, if not you can go over google or YouTube to gain some knowledge.
If you notice the postman request header, it is asking for an URL to reach while sending request. So whatever interface we are planning to test here, we need to get an URL for that interface from SAP.
Read eBook: Learn to Debug ABAP Programs
Now, where to find interface web service URL? So proxy configuration is done in SPROXY transaction code. Lets open the SPROXY Tcode:
You can click on the open object button and search for the proxy object or web service definition. Usually both object names contain some kind of interface details. so if you know the interface ID in your system, you can try to search for that interface using asterisk * as suffix and prefix e.g. *INTERFACE*
Once you get the proxy object open it.
Here you can navigate through Internal view tab and external view tab to understand the data structure of inbound and outbound messages.
Go over to WSDL tab
And here you will get the URL to reach out, in order to trigger this proxy in SAP.
So we will copy this URL and paste it in postman header.
As soon as you paste the URL and press enter, Postman fills certain fields and tabs automatically based on URL:
So above we can see from URL, Postman has picked the client as 900
Notice that we are using ‘Post’ request here since our interface is a inbound interface in SAP. So we will just send data to SAP by using POST request.
Read blogpost: Functioning of CO-PA in make to order scenario
Now go to authorization tab
Here you need to select Basic Auth
And then enter the SAP Logon user ID and Password. You can enter your own user ID and Password.
Header tab is filled automatically.
Lets jump over to the body tab
Here you will enter the information you want to send to SAP.
Here we need to select data type as ‘raw’ and then we have multiple options for data format like text, JSON, HTML & XML. In our case its XML so we will select XML and then in the body we will paste the data which we want to send to SAP.
Watch a YouTube Video: Depreciation key Configuration Guide
Here we have randomly posted some data, which obviously going to fail in SAP but our purpose here is to test the connection.
So lets hit ‘Send’
As soon as you hit send within seconds Postman will give response. Status 200 means our data successful reached to SAP.
On the lower side of Postman application you can find the response and connection details.
You can further check this in SAP in SXMB_MONI transaction.
So this was a very basic usage of Postman and even the interface testing. Consider this as starting point to explore more into this area. You can even use Postman for IDOC testing, for synchronous and asynchronous interface testing and lot more.