The success of migrating existing enterprise applications, such as SAP®, PeopleSoft®, and Siebel®, to portlets depends on how quickly these portlets can be created and deployed. Using the new IBM Application Portlet Builder, you can create portlets with functions comparable to your enterprise applications, and with minimal effort.
This article tells how to create portlets that access SAP, using the IBM Application Portlet Builder, (hereafter, referred to as Portlet Builder) specifically configured for SAP. As you walk through the three examples in this article, you will become familiar with Portlet Builder. First, you'll review the steps to build a simple Human Resources portlet, using an XML template provided with Portlet Builder. Next, you'll step through the process of creating your own XML file for a Material Management portlet to approve purchase requisitions. Finally, you'll see how to quickly build two SAP portlets that exploit the Click-to-Action capability.
This article is intended for readers who have a basic understanding of portal administration as well as some basic knowledge of SAP. The Portlet Builder is a component of WebSphere® Portal Application Integrator and can be downloaded from the WebSphere Portlet Catalog.
Install IBM Application Portlet Builder for SAP
Detailed installation instructions for Portlet Builder are found in the documentation link on the WebSphere Developer Domain WebSphere Portal Zone. You'll find specific configuration instructions for SAP. For illustrative purposes, Figure 1 displays the SAP Business Object Builder, and Figure 2 shows the configuration screen (field descriptions are also found in the documentation).
Figure 1. SAP Business Object Builder Page

Figure 2. Configuration Parameters

The SAP Human Resources portlet that you will create is List Employee by Cost Center. You'll display a list of employees, based on search criteria.
- Click Create new portlet on the SAP Business Object Builder page.
- Fill in the portlet name as
MyHRPortletand enter the connection information that's applicable to your environment. The authentication information can be added now or later, based on the option you select, whether to prompt the user for ID/Password, or whether to provide the User ID/Password.
Figure 3. Connection Information and Portlet Name
- Click Next and then Create new business object to create a business object. A portlet
can contain more than one business object. For simplicity, we will create only one portlet in this example.
Figure 4. Create New Business Object
- Select a business object XML file from the list. The XML file provides configuration information for
constructing a business object, that includes the BAPI (Business Application Programming Interfaces),
input parameters, output parameters, view information, and mapped
JavaTM classes. In this example, select
SAPListEmployeesByCostCenter.xml.
Figure 5. Select Business Object XML File
- Click Next and select Allowed actions => Search. In this example, we only want to list
employees, therefore, Update, Create, and Delete are not required.
Figure 6. Select Action
- Click Next to compose your own business object. Select desired fields required for the
business object. Change text of Display name if you would like to display a different column title. Field behaviour
determines the access attribute of each field. Summary fields show the overview of a given record after search.
Searchable fields allow only those fields to be used for search. Type and Namespace are used to
enable fields for Click-to-Action.
Figure 7. Construct a Business Object
- Click Next and then Finish to complete the process.
Figure 8. Complete the Business Object
- Login to Portal Server as an administrative user to add the MyHRPortlet to a page.
- Go to the portlet page and click Edit at the top-right corner.
- Enter the SAP User ID and Password.
- Click Save.
Figure 9. Enter SAP User ID and Password
- Enter
1000for Cost Center - Click Search to search for employees
Figure 10. Search Employees by Cost Center
The search returns eight employees in summary under Cost Center 1000.
Figure 11. Employee List under Cost Center 1000
- Select one employee to display detail information for that employee.
Figure 12. One Employee Detail
Build Purchase Requisition Collective Approval portlet
A new SAP portlet is created with the Portlet Builder by constructing an XML file which contains SAP business object data. To create the XML file, you need to define the business scenario, identify SAP BAPIs, and specify key import and export data. This example presents the steps needed to create a portlet to let SAP users approve Purchase Requisitions.
You need to define the business requirements and scenario to create a new portlet. Typical requirements include the SAP functional area name (e.g., Purchase Requisition Approval in Material Management), user input data, output data and expected screen flow. In this scenario, you want SAP purchase requisitions pending approval to display on the portal so users can release individual line items. Users should be able to reset the approval status if needed. The SAP transaction code used for item level approval is ME55.
The BAPIs needed to meet the defined business requirements have to be identified. To retrieve SAP BAPI information details, the user must run transaction code BAPI in SAP. Use the following BAPIs to implement the actions defined for the purchase requisition release portlet:
- BAPI_REQUISITION_GETITEMSREL: Collective display of requisition line items pending release
- BAPI_REQUISITION_RELEASE: Set Release
- BAPI_REQUISITION_RESET_RELEASE: Reset Release
Finalize the new portlet specification by including key information such as business scenario, BAPI name(s), import and export data, and transaction data behavior (display, update, create, delete, etc.). The XML file provided, is built based on these specifications.
In this example, allow users to enter the following data on the portlet:
- Release Code
- Release Group
This is the data that should display on the portlet for user review:
- Requisition Number
- Item Number
- Document Type
- Purchasing Group
- Person Who Created the Object
- Requisitioner
- Requisition Date
- Material Number
- Description
- Quantity
- Unit of Measure
- Price
- Currency
- Price Unit
- Delivery Date
- Account Assignment
- Plant
Construct Purchase Requisition Collective Approval XML file
The following XML file contains SAP BAPI and other information required by Portlet Builder.
<?xml version="1.0" encoding="UTF-8"?>
<sapcfg>
<retrieve>
<bapi name="BAPI_REQUISITION_GETITEMSREL" post="n" pre="n"/>
<input>
<field name="REL_GROUP" ref="Release Group"/>
<field name="REL_CODE" ref="Release Code"/>
<field name="ITEMS_FOR_RELEASE" ref="Display Mode" value="X"/>
</input>
<output>
<table name="REQUISITION_ITEMS">
<field name="PREQ_NO" ref="Requisition Number"/>
<field name="PREQ_ITEM" ref="Item Number"/>
<field name="DOC_TYPE" ref="Document Type"/>
<field name="PUR_GROUP" ref="Purchasing Group"/>
<field name="CREATED_BY" ref="Person Who Created the Object"/>
<field name="PREQ_NAME" ref="Requisitioner"/>
<field name="PREQ_DATE" ref="Requisition Date"/>
<field name="MATERIAL" ref="Material Number"/>
<field name="SHORT_TEXT" ref="Description"/>
<field name="QUANTITY" ref="Quantity"/>
<field name="UNIT" ref="Unit of Measure"/>
<field name="C_AMT_BAPI" ref="Price"/>
<field name="CURRENCY" ref="Currency"/>
<field name="PRICE_UNIT" ref="Price Unit"/>
<field name="DELIV_DATE" ref="Delivery Date"/>
<field name="ACCTASSCAT" ref="Account Assignment Category"/>
<field name="PLANT" ref="Plant"/>
</table>
</output>
</retrieve>
<udf_release>
<bapi name="BAPI_REQUISITION_RELEASE" post="n" pre="n"/>
<input>
<field name="NUMBER" ref="Requisition Number"/>
<field name="REL_CODE" ref="Release Code"/>
<field name="ITEM" ref="Item Number"/>
</input>
<output>
<field name="REL_STATUS_NEW" ref="Released"/>
</output>
</udf_release>
<udf_resetrelease>
<bapi name="BAPI_REQUISITION_RESET_RELEASE" post="n" pre="n"/>
<input>
<field name="NUMBER" ref="Requisition Number"/>
<field name="REL_CODE" ref="Release Code"/>
<field name="ITEM" ref="Item Number"/>
</input>
<output>
<field name="REL_STATUS_NEW" ref="Released"/>
</output>
</udf_resetrelease>
<mapping>
<map name="Release Group" class="java.lang.String" inSummary="n"
isComputed="n" isEditable="n" isKey="y" isPadded="y" isPrimaryKey="n"
isRequired="n" isVisible="y" addSearchParamToBO="y"/>
<map name="Release Code" class="java.lang.String" inSummary="n"
isComputed="n" isEditable="n" isKey="y" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y" addSearchParamToBO="y"/>
<map name="Display Mode" class="java.lang.String" inSummary="n"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="n"/>
<map name="Released" class="java.lang.String" inSummary="y" isComputed="n"
isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n" isRequired="n"
isVisible="y"/>
<map name="Requisition Number" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="y"
isRequired="n" isVisible="y"/>
<map name="Item Number" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="y"
isRequired="n" isVisible="y"/>
<map name="Document Type" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Purchasing Group" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Person who Created the Object" class="java.lang.String"
inSummary="y" isComputed="n" isEditable="n" isKey="n" isPadded="n"
isPrimaryKey="n" isRequired="n" isVisible="y"/>
<map name="Requisitioner" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Requisition Date"
class="com.ibm.wps.portlets.businessobject.sap.types.SAPDate"
inSummary="y" isComputed="n" isEditable="n" isKey="n" isPadded="n"
isPrimaryKey="n" isRequired="n" isVisible="y"/>
<map name="Material number" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Description" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Quantity" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Unit of Measure" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Price" class="java.lang.String" inSummary="y" isComputed="n"
isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n" isRequired="n"
isVisible="y"/>
<map name="Currency" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<map name="Price Unit" class="java.lang.String" inSummary="y"
isComputed="n" isEditable="n" isKey="n" isPadded="n" isPrimaryKey="n"
isRequired="n" isVisible="y"/>
<fixed>release|Release</fixed>
<fixed>resetrelease|Reset Release</fixed>
</map>
</mapping>
</sapcfg>
|
To create the Purchase Requisition Collective Approval portlet:
- Copy the XML file (also available in the download file) to the
sap_configdirectory of the running Business Object Builder portlet under WebSphere install path, e.g.,WAS-Instal-Path\installedApps\BOBuilderPortlet_WPS_PA_158.ear\BOBuilderPortlet.war\sap_config. - Follow the previous example to create the Purchase Requisition Collective Approval portlet.
- Select the allowed actions, Search and Update.
- Place the portlet on a portal page and enter the connection information as described in the previous example.
- Enter values for Release Group and Release Code.
- Click Search. A list of Purchase Requisition records displays.
Figure 13. Purchase Requisition Collective Approval Search Page
- Select a record. The detail of the selected record displays.
Figure 14. Purchase Requisition Collective Approval List Page
- Select Action Release and click OK.
Figure 15. Purchase Requisition Collective Details Page

The selected record is marked with an X indicating it is released.
Figure 16. Purchase Requisition Collective List Page

Building SAP Portlets with Click-to-Action
This procedure demonstrates the capability of Click-to-Action using two SAP Internal Order portlets. Again, follow the first example and use the Portlet Builder to create a SAP portlet to list internal orders.
- At the step for constructing the business object, select Order Number for Click-to-Action.
- In the row of fields for Order Number, enter a value for Type, for example,
orderNumber. - Enter a value for Namespace, for example,
sap.test.
Figure 17. List Internal Orders

Now, create the second SAP portlet to display internal order details.
- Enter the same values for Type and Namespace as you did for the first portlet.
- Add the above two portlets side by side on a page.
- Enter values to list Internal Orders.
- Click a small icon next to one order number and select Get SAP Internal Order Details to show the detail on the second portlet.
Figure 18. Click-to-Action
Figure 19. Internal Order Details
The IBM Application Portlet Builder, a component of WebSphere Portal Application Integrator, can help with successfully integrating key enterprise applications with IBM WebSphere Portal. The Portlet Builder is intuitive and simple. It lets you create portlets that can access and manipulate data in an enterprise application, without requiring programming knowledge of the system. By selecting business objects available from the enterprise application, you can specify which data fields should be displayed in the portlet.
We would like to thank Cesar Wong for providing technical guidance and Alexander Gmyrek for implementing the Purchase Requisition Approval portlet.
| Name | Size | Download method |
|---|---|---|
| SAPPurchaseReq.zip | .1 MB | FTP |
Information about download methods
- IBM WebSphere Portal Family
- IBM
WebSphere Portal Toolkit
-
WebSphere Portal Application Integrator (WPAI)
-
Accessing SAP Systems -- Part 2: Building SAP Applications Using WebSphere Studio and WebSphere Adapter for mySAP.com
Fetchi Chen is a consultant for IBM Software Services for WebSphere, at IBM Austin. He has over 20 years of software development experience. He has designed system software and has delivered solutions to many companies within different industries. He is an IBM certified solution developer for WebSphere Portal and a Sun certified Enterprise Architect for J2EE. Fetchi earned his Masters degree from Penn State University. You can reach Fetchi at fchen@us.ibm.com.




