Skip to Content
Author's profile photo Former Member

Java Web service Creation to display UWL Item Count functionality


Java web service functionality for calculating the number of work items in one’s UWL (Universal Work list) and displays it using a WSDL file.

Author: Shri Vidya S

Created On: 09/04/2012

Table of Contents

  1. 1.. General Description. 3
  2. 2.. Component Creation Procedure. 4
  3. 2.1    Pre-Requisites. 4
  4. 2.2    Creation of the Java Web Service using NWDS: 4
  5. 2.3    Detailed Procedure: 5
  6. 3.. User Guide: 17
  7. 3.2    Troubleshooting. 17


1.    General Description

Java web service functionality for calculating the number of work items in one’s UWL (Universal Work list) and displays it using a WSDL file.

  • Feature 1: This WSDL file can be consumed to display the count on any portal (For eg : Microsoft SharePoint portal)
  • Feature 2: The work items are here calculated based on the task numbers defined in the code. For those not defined, the count is taken under Other Work items. If the task numbers are known and defined, these could also be included under the appropriate count.
  • Feature 3: Any end user can give his credentials, to see a screen with the Work item count of UWL displayed as output.


2.    Component Creation Procedure

2.1 Pre-Requisites

The Pre-requisites for this Web service component creation includes having a NWDS in place and workspace created to start the component design & development.

The next Pre-requisite for this web service is to have SDM configured so that we can deploy the EAR files to the respective server or portal (Dev, Quality & Production).

2.2    Creation of the Java Web Service using NWDS:

The brief steps to be followed to create a Java web service using NWDS are as below.


  1. 1. Navigate to the Java Perspective.
  2. 2. Create a new JAVA Project with Name ZuwlWebservice.
  3. 3. Create a new package
  4. 4. Create a new JAVA class , ZuwlClass under the package
  5. 5. Write the coding as shown below for the UWL itemcount functionality in the newly cretaed JAVA class.
  6. 6. Import all the necessary API’s into the project , Check for any errors and save.
  7. 7. Add Project Reference to another project created as a DC(Development Component) having just an SCA reference ( UWLJWF22P_6-10003490.SCA) in it.
  8. 8. Navigate to the Web service perspective and Right click on the JAVA class to Create New Web service.
  9. 9.  Right click on the JAVA class to Build EAR file.
  10. 10. Open Windows -> Preferences -> SAP J2EE engine and maintain the server and the port parameters.
  11. 11. Now Right click on the EAR file and Deploy by giving the SDM password. After successful deployment navigate to the Web services Navigator to Open the server and the deployed web service.

Test the Web service and check for the results


2.3 Detailed Procedure:

1. Navigate to the JAVA perspective in NWDS  and Create a New Project as shown below.


2. Enter a Name for the Project and Click Finish.


3. Create a New Package Say, by right clicking on the Project name and clicking New.


4. Under this newly created Package (by right clicking the package), Create a JAVA class and Name it .


Provide the Class name and details in the below screen and click on finish.


5. Paste the code shown in the Text Document attached for the code to be included in the Class and Import all the necessary APIs and save without any errors.

6. To Import all the APIs , right click on the Project – > Properties -> Java BuildPath -> Add Variables  and add the necessary APIs and click Ok.

7. To add Project Reference, right click on the Project – > Properties -> Project References -> Choose the DC already developed with just the SCA file ( UWLJWF22P_6-10003490.SCA) imported into it.The DC having the SCA file looks like below.


8. Now Navigate to the Webservice Perspective. The component should appear as below.


9. Right click on the JAVA class to create New Webservice.


Give the Credentials as below and click Finish.


10. Now Right Click on the JAVA class to Build EAR file.


  1. Then open Windows -> Preferences -> SAP J2EE engine and maintain the server and the port details and click apply and then OK.



  1. Now Right Click on the EAR file to Deploy the Webservice created. Enter the SDM password for that server to continue with the deployment.


  1. After it is successfully deployed, Open the Webservices Navigator on the Console View.


  1. Login with the credentials to see the list of all the webservices deployed on this system.


15. Now click on the Name of the webservice to see the below screen.


16. The wsdl from the above screen can be saved and shared with the Microsoft Sharepoint team for consumption from their end so that the count can directly be displayed on the Sharepoint Portal for Users’ convinience. The Sherepoint developers can further display the information in sync with the Themes used in an IFrame.

17. For testing purposes, Click on Test to test the application. Then click on the method that opens as below.


  1. Click on Send when you see the Timeout seconds screen. Then the below screen appears during the Test.


  1. Once Logged in with the Credentials , the output screen will be displayed which shows the OUTPUT as below.


  1. In the above screenshot , the element1, element2, … element6 represents the number of Total requests,Leave requests, Compensation requests , Travel requests, Time requests and other requests respectively as per the coding.

21.  Here the output is displayed by the webservice in the form of an array.

3. User Guide:

  1. 3.1 NWDS Configuration

NWDS Installation involves the steps mentioned in the below document provided by SAP.

3.2    Troubleshooting

NWDI and NWDS troubleshooting can be found in the below link :

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.