Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

IBM WebSphere Developer Technical Journal: Building SAP Portlets Using IBM Application Portlet Builder

Fetchi Chen (fchen@us.ibm.com), Consultant, IBM Software Services for WebSphere, IBM, Austin, TX
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.

Summary:  IBM Application Portlet Builder, a component of WebSphere Portal Application Integrator, is a simple, intuitive tool that helps you successfully integrate key enterprise applications with IBM WebSphere Portal. You can create portlets, with comparable functions to enterprise applications. This article steps you through the process of creating portlets that access SAP, using the downloadable IBM Application Portlet Builder.

Date:  13 Aug 2003
Level:  Intermediate
Also available in:   Chinese

Activity:  2875 views
Comments:  

Introduction

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
SAP Business Object Builder Page

Figure 2. Configuration Parameters
Configuration Parameters

Build Human Resources portlet

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.

  1. Click Create new portlet on the SAP Business Object Builder page.
  2. Fill in the portlet name as MyHRPortlet and 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
    Connection Information and Portlet Name
  3. 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
    Create New Business Object
  4. 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
    Select Business Object XML File
  5. 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
    Select Business Object XML File
  6. 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
    Construct a Business Object
  7. Click Next and then Finish to complete the process.
    Figure 8. Complete the Business Object
    Complete the Business Object
  8. Login to Portal Server as an administrative user to add the MyHRPortlet to a page.
  9. Go to the portlet page and click Edit at the top-right corner.
  10. Enter the SAP User ID and Password.
  11. Click Save.
    Figure 9. Enter SAP User ID and Password
    SAP User-ID and Password
  12. Enter 1000 for Cost Center
  13. Click Search to search for employees
    Figure 10. Search Employees by Cost Center
    Search Employees by Cost Center

    The search returns eight employees in summary under Cost Center 1000.


    Figure 11. Employee List under Cost Center 1000
    Employee List under Cost Center 1000
  14. Select one employee to display detail information for that employee.
    Figure 12. One Employee Detail
    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.

Define the Business Scenario

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.

Identify SAP BAPIs

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

Specify Import/Export Data

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.

Data Input

In this example, allow users to enter the following data on the portlet:

  • Release Code
  • Release Group

Data Output

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> 

Test the example

To create the Purchase Requisition Collective Approval portlet:

  1. Copy the XML file (also available in the download file) to the sap_config directory 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.
  2. Follow the previous example to create the Purchase Requisition Collective Approval portlet.
  3. Select the allowed actions, Search and Update.
  4. Place the portlet on a portal page and enter the connection information as described in the previous example.
  5. Enter values for Release Group and Release Code.
  6. Click Search. A list of Purchase Requisition records displays.
    Figure 13. Purchase Requisition Collective Approval Search Page
    Input Page
  7. Select a record. The detail of the selected record displays.
    Figure 14. Purchase Requisition Collective Approval List Page
    List Page
  8. Select Action Release and click OK.

Figure 15. Purchase Requisition Collective Details Page
Details Page
The selected record is marked with an X indicating it is released.
Figure 16. Purchase Requisition Collective List Page
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.

  1. At the step for constructing the business object, select Order Number for Click-to-Action.
  2. In the row of fields for Order Number, enter a value for Type, for example, orderNumber.
  3. Enter a value for Namespace, for example, sap.test.

Figure 17. List Internal Orders
List Internal Orders

Now, create the second SAP portlet to display internal order details.

  1. Enter the same values for Type and Namespace as you did for the first portlet.
  2. Add the above two portlets side by side on a page.
  3. Enter values to list Internal Orders.
  4. 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
    List Internal Orders

    Figure 19. Internal Order Details
    List Internal Orders

Conclusion

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.


Acknowledgements

We would like to thank Cesar Wong for providing technical guidance and Alexander Gmyrek for implementing the Purchase Requisition Approval portlet.



Download

NameSizeDownload method
SAPPurchaseReq.zip.1 MBFTP|HTTP

Information about download methods


Resources

About the author

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.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=14319
ArticleTitle=IBM WebSphere Developer Technical Journal: Building SAP Portlets Using IBM Application Portlet Builder
publish-date=08132003
author1-email=fchen@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers