Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

I recently built a scenario ruled by HTTP POST and GET calls using SAP PI 7.1 and a third party web application.

With SAP PI 7.3 and HTTP AAE adapter, we have now the chance to choose wheter to do a POST or a GET call directly from the channel itself, but how can we easily deal with them if we are using some older versions of our beloved middleware? In addition, what if we have the constraint to use HTTPS with basic authentication?

Apart from my scenario where I must do first an HTTPS POST call to retrieve a list of urls and then a HTTPS GET call for each URL retrieved, I'd like to share with you the solution that I used, because I find it simple and reusable.

In this blog I will not deal with HTTP/HTTPS POST call, because the HTTP and SOAP adapter (without SOAP envelope) do an excellent job with them. It won't be also my scope to show how to configure the SSL certificates on ABAP or Java Stack.

So let's keep it simple and think we have an XML file that we must read with an HTTP GET call and transform it to some IDOC of our choice.

Figure 1. The overall scenario 

1. A custom report will fire the call to our Integration Process where we have inside the URL (and some other parameters if you need);

2. The integration process will handle the synchrounous call to the web application;

3. IDOCs are sent to SAP ECC

Let's focus on step 2 and how we'll manage the HTTP GET call.

First we must create a custom RFC on PI abap stack: this RFC will prepare the HTTP request with all of your HTTP header that you need and then it will fire the call with the standard HTTP_GET function module.

The import parameter in my case are:

a. URL

b. Username

c. Password

while the output parameter is the document retrieved in a string format.

N:B: Be aware of what data you can have in the document retrieved: I'm referring to special chars often contained in description or text field.

Figure 2. An example for the Integration Process

Now we want our document in XML format so we can easily manage the mapping through the graphical editor in step 3.

Remember that in step 2 we have a synchrounous call in which:

  • The request is the preparation for RFC input parameters.
  • The response is our document in text format in the return field of our RFC.

Figure 3. The section for the synchronous operation mapping for step 2: request and response

Well, now we must add a Java Mapping or an ABAP mapping in the response section of our sinchrounous operation mapping to parse the string returned in RFC output parameter and create the XML document.

That's it: if you keep the RFC and the ABAP/Java mapping general you can reuse this solution to others scenario where an HTTP GET file is needed to be read.

2 Comments