Skip to Content

To provide a flexible mechanism to switch between Web Dynpro applications and non Web Dynpro applications there is the Suspend-Resume mechanism as part of the Web Dynpro programming model. Suspend and Exit Plugs use HTTP GET to redirect your Web Dynpro application to the specified ‘Url’. This blog explains how to use the Suspend Plug with HTTP POST. I am providing a cheatsheet to do this in NW04s.

 

When a POST is required in Suspend/Exit plug?

HTTP GET has the limitation of 1KB to send along the URL. No situation guarantees that no more than 1KB will be used while going out of the Web Dynpro application to non Web Dynpro applications. GET is normally categorized as ‘Idempotent Method’. This leads to caching of the page. So passing username and password through GET is not wise. These situations recommend using HTTP POST.

 

Here I am providing a way to realize HTTP POST in Web Dynpro Suspend Plug using static HTML.

 

The first step for using a suspend/resume plug is to make/add the application property ‘sap.suspendable.application’ as true.

 

 

 

In your View, add your InterfaceView as Required controller. This will generate convenience methods to access the suspend plug. This step is required to make the InterfaceView accessible to the View.

 

 

HTTP POST in suspend plug can be easily achieved in NW 7.1. Since HTTP POST is not available in Suspend Plug of all the Web Dynpro versions, I have found out a cheatsheet to do the same in NW04s. This approach can be used in NW 7.1 as well.(Anyway no need for this approach in NW 7.1)

 

Holy Grail, Web Dynpro has a flexible mechanism to create resources dynamically using its programming model. I am going to use this feature to do the HTTP POST while suspending the application.

 

1. Form the HTML content which can do the HTTP POST on loading to the actual destination.

2. Put the values that you want to POST in input fields in the Form.

3. Write a Javascript to parse the HTML URL to get the sap-wd-resumeurl parameter and its value.

 

 

Convert the HTML content from string to a byte Array.

 

 

Create a HTML file for the above content using the WDResourceFactory.

 

The file created will always be accompanied with a URL to access on the Web. Retrieve the URL for the ‘Post.html’ file and use that as the destination URL for the Suspend plug.

 

 

Once redirected to the HTML page, the javascript in the HTML page will extract the sap-wd-resumeurl parameter and post your contents to the actual destination while loading the page. sap-wd-resumeurl parameter is required for the non Web Dynpro application to come back to the Web Dynpro application. This parameter must be posted along with your contents to the actual destination. The example used here posts parameter ‘Key’ along with the sap-wd-resumeurl parameter.

 

A new file will be created for each call to WDResourceFactory API to create the resource. This HTML file lives in the server till the end of the Application session. Application Server will take care of clearing the HTML file once the session expires.

(Note: The cheatsheet code will work only for certain browsers. To support other browsers tune the javascript code)

 

Wow! I have written my first Technical weblog.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Hi,

    This is just an FYI.
    Using URLS WD4A technology (SAP NW 7.1 EHP 1) we can now transfer upto 100MB of data as compared 1KB.

    Best Regards,
    Ashish.

    (0) 
    1. Former Member Post author
      Hi Ashish,

      Thanks for your info. This blog is mainly for WD4J NW7.0. where you don’t have the HTTP POST capability in suspend plug.
      Thanks & Regards
      Sasi Varnan

      (0) 
  2. Former Member
    Hi Sasi

    Your blog is very useful, I would like to know few things here.

    Can we read the resumeURL before calling suspend ? If yes how ?

    On application resume, Can we read the POST parameter value immediately on resume, returned by external application and on which method we can read them ?

    Vinit

    (0) 

Leave a Reply