Copyright 2024 - BV TallVision IT

An Internet Service is based on the an ABAP's screen (dynpro) processing, PBO and PAI. It's also the most common way SAP has coded their own SRM web applications...

An Internet service is used (by SAP) for the more serious multi-screen applications which are to be embedded in SAP's SRM menu's. The design concept originates from ABAP Module pools, where the SAP-Classic DYNPRO is used as a basis for an HTML template, which is presented in the browser of the end user. A few specifics about the Internet Service:

  • For every screen (dynpro) on your application (which can be a module pool, function pool or a report), the HTML template must be generated.
  • Macro's FIELD-SETFIELD-GET and TRANSPORT-FIELDS are used in PBO and PAI for the non SAP predefined fields that appear in templates.
  • Publishing the generated templates will make them available for the browser of the end user (publishing places the templates on the UDDI).
  • Even though SAP allows generating templates, SAP also changes the results dramatically...

It may be clear that a lot of the programming logic that has effect on the end user's screen is done in HTML. It's a good thing to become familiar with HTML and JavaScript could be a great help too. Do note: There is an AbapcadabrA issue on JavaScript as well !

Redirect to BSP

This is about something I'm a little ashamed of: the redirect Internet Service, which calls a BSP application in SRM context...

Why ? Because I couldn't get my Internet Service to do what needed to be done in an acceptable timeframe. So a BSP application was set up. But how should the BSP application be triggered from an SRM menu ? BSP applications are pretty stand-alone and SRM is quite a bundle. Solution (my solution): trigger an Internet Service which simply calls the respective BSP service.. The Redirect:

The concept is simple - Internet Services can be set up to appear in the end user menu, which enables the end user to start the application. The Internet Service also runs "under" or "as part of" a larger whole (the menu at the left and top), which is a requirement of course. The example shown here is an internet service with an html template that will redirect to the BSP application within.

Example: Redirect from Internet Service to BSP application 

Where the context of the Internet Application (the SRM main menu) is left in tact: This is the main (only) html template for the Internet Service:

<html>
<script language=javascript>
var server_and_port="`SERVER_AND_PORT`"; 

// Redirect the page to a BSP application 
function BSPredirect() {  
  window.location=server_and_port+'/sap/bc/bsp/sap/zsrm_appr_dt'; 
}
</script>

<head>
  <title>Redirect...</title>
</head>
<body onload=BSPredirect(); style="background:#F2F2F2;">
<table width=100% height=100% cellspacing=1 cellpadding=1 border=0>
<tr height=50% >
<td style="vertical-align:bottom;text-align:center">
  <img src=/sap/public/bc/its/mimes/bbpglobal/99/images/start/hours.gif>
<tr>
<td style="vertical-align:top;text-align:center">
  Please wait...
  <br><br>Redirect to BSP application
  <br><font size=-1>ZSRM_APPR_DT</font>
</table>
</body>
</html>

The main program for this redirect:

*----------------------------------------------------------------------
* Program name__: ZSRM_INTERNET_SERVICE_REDIRECT
* Description___: Dummy program to enable redirect of internet service
*                 to BSP application
*
* Author________: W.Maasdam
* Date created__: November 2005
*---------------------------------------------------
* This program forms an empty shell for an Internet 
* Service which is set up to redirect to a BSP application. 
* The Internet Service can be set up on the SRM user-menu 
* via authorization, for which a transaction code is used. 
* As BSP applications do not have a transaction code, a
* redirect from a dummy Internet Service template is used 
* to trigger the BSP application - protecting the 
* <FRAMESET> settings.
*---------------------------------------------------
REPORT  ZSRM_INTERNET_SERVICE_REDIRECT.

Data: server_and_port(80).
* The include with the macro's for field transports
include AVWRTCXM.

call screen 9001.
*---------------------------------------------------
* Module  web_transport  OUTPUT
*---------------------------------------------------
MODULE web_transport OUTPUT.

  server_and_port = ''.
* field-set        Set a context field
*  Parameter 1 IN Name of the context field
*  Parameter 2 IN Index of the context field, starting with 1
*  Parameter 3 IN Value of the context field
  field-set 'SERVER_AND_PORT' 0 SERVER_AND_PORT.

*---------------------------------------------------
* field-transport  Transport the context space to the AVW runtime
*---------------------------------------------------
  field-transport.

ENDMODULE.                 " web_transport  OUTPUT

*---------------------------------------------------
*  Flow logic of screen 9001: 
*---------------------------------------------------
PROCESS BEFORE OUTPUT.

  MODULE web_transport.

PROCESS AFTER INPUT.

The BSP service which is being redirected to can of course be adapted, and the redirection program can be used for several redirection occasions. Note that a transaction code will need to be added for every Internet Service you want to redirect.