Skip to Content

Business Scenario:

In the standard SAP PR approval process, when an employee creates a Purchase Requisition, the approver gets the PR as a work item in his SAP Inbox. When the approver opens the PR approval workitem, he’s directed to the PR release window for that particular PR (transaction ME54n). Now, he n either releases or rejects the PR. This requieres the Approver to have access to a desktop or laptop where he can access the SAP system.

The Blackberry Application for PR approval is aimed at mobilising the PR approval process where the approver can release or reject a PR on the move using his Blackberry device.

Setting up Release Strategy

The Purchase Requisition Release strategy with the necessary release groups, release codes, agents and the release conditions and the workflow settings for PR approval have to be maintained in the backend system.

BAPIs Used for PR approval process on Blackberry:

Standard BAPIs:

  • SAP_WAPI_Create_Worklist

         To get the worklist for a particular user.

         This is used to get all the work items for the particular user  which needs the user’s response.    

  • SAP_WAPI_Get_Objects

        To get the objects related to any workitem. Used to filter the workitems obtained for a user based on the Business Object.

  • BAPI_Requisition_Getdetail

        To get the details of the PR item/s.

  • BAPI_Requisition_Release_Gen

       To release the overall PR.

       The PR number and the Release code are passed to the BAPI to release the overall PR.

  • BAPI_Requisition_Release

       To release a particular item of the PR.

       The PR Number, Item number and the Release code are passed to the BAPI to release a particular Item of the PR.

  • SAP_WAPI_WORKITEM_COMPLETE

        To mark the workitem as “Complete”.

 

Custom BAPIs:

Apart from the Standard BAPIs mentioned, few custom BAPIs have to be created as the Standard BAPIs are not available for these functions.

  • ZBAPI_PR_GET_RELCODE

          To get the release code for a particular user and a particular release group.

          The release group for the particular PR is obtained by using the BAPI_Requisition_Getdetail and the above BAPI is called with the userid and the release group to get the corresponding Release Code.

  • ZBAPI_Requisition_Reject

          To Reject a particular item of a PR.

  • ZBAPI_Requisition_Rej_overall

          To Reject the overall PR.

  

Procedure:

 

i.  Creating a project in Webdynpro, importing models, Model Binding and Context mapping.

Create a webdynpro project in NWDS and switch to Webdynpro perspective and create an application for the project with the authentication property “true” and choose to create a new component. Create a model choosing “Import Adaptive RFC Model” and select all the BAPIs mentioned above.

For any help on WebDynpro Java and for steps to create a webdynpro Java Adaptive RFC application, please refer the following document from SAP Library.

 

http://help.sap.com/saphelp_nw04s/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm

 

Once you have completed the above step and created an application and the model, follow the following steps to develop the Blackberry PR release application.

1. Open the data modeler, choose “Add Existing Model to the component” and select the model created in the previous step.

2. Do a model binding between the component controller and the model. Select all the input model elements into the component controller.

3. Create Views in the component for

a) Worklist Display Screen

b) PR Detail screen

 

4. Create Value nodes in Component controller.

    Value node – “UserDetails” with UserID, Password, UserName as attributes.

    Value node -“PRs” with PR number, Item, Requisitioner, Release Group as attributes. (Cardinality – 0…n).

    Value node – PRItemDetails with relevant PR item details as attributes.

 

5. Map the relevant nodes from the context of the component controller with the context of the view controllers.

   WorklistDisplay Screen – Map the node – PRs

   PRDetail View – Map the nodes – BAPI_Requisition_Getdetail_Input, BAPI_Requisition_Release_Gen_Input, BAPI_Requisition_Release_Input, ZBAPI_Requisition_Reject, ZBAPI_Requisition_Rej_overall, PRItemDetails.

 

ii. UI designing – applying UI element templates to the Views and binding the UI elements to the context.

1.       Worklist View
  • Insert caption UI elements to the root UI element container for the welcome message to the user who logs in.

 

  • Call the “getworklist” method in the component controller to get the worklist related to PR for the particular user and to update the “PRs” node in the context.

 

  • Insert a “Table” child UI element to the root UI element container (Do not apply table template).

          In the context menu of the table UI element, choose “Insert Column” (Do not choose “Insert Grouped Column”) – insert columns for PR number, Requisitioner and Item.

          In the context menu of each column, choose “Insert TableCell Editor”.

          Bind the “text” attribute of the tablecell editor of each column to “PRNumber”, “Requisitioner” and “Item” attributes respectively of the PRs node in the context.

         In the table properties, create a method for “OnSelect” and call the getPRdetails method in the component controller to get the details of the PR and bind it to the “PRItemDetails” node, also fire the outbound plug to PRdetail View.

  • Apply Action templates for “Signout” and “Refresh” buttons.

         For “SignOut”, create an “on action” method and in this method, call the method to forcelogoff client user.

  For “Refresh”, create an “On Action” method and in this method, call the getworklist method of the component controller.

 

2.       PR Detail View.
  • Insert Transparent Container UI element and apply form template to the transparent container.

          Bind the node “PRItemDetails” to the form UI element.

          Add a value attribute to the view context set the type to “Visibility” and bind the visibility of the above transparent container to this attribute.

  • Apply Action templates to the transparent container UI element for release item, release overall, reject item and reject overall actions.

          Call the corresponding methods in component controller for each of the actions.

 For each action – Release Item, Release Overall PR, Reject Item and Reject overall PR, call the corresponding BAPIs by passing the release code for the user, the PR number and the item number

  • Insert Transparent Container UI elements for messages to be shown to the user when the transaction is successful and add caption/text-view child UI elements to the transparent container to show the message.

          For each message transparent container, assign different visibility context attribute so that the appropriate attribute is enabled as the release/reject is effected.

 

  • Apply Action template to the root UI element container for “Back” action to go back to the worklist view.

          Call the getworklist() method before firing the outbound plug to the worklist view.

 

Deploy and Run:

 

  • Specify the J2EE server name and port in the preferences option in NWDS.
  • Deploy the application on to the J2EE server by choosing “Deploy New Archive and Run” in the context menu of the Application and run the Application URL in Blackberry simulator.

Blackberry Simulator:

Use the standard MDS and Blackberry simulator provided by Blackberry.

They can be downloaded from the official Blackberry website.

 

PR Approval through Blackberry Demo.

 

1.       Start the Blackberry MDS simulator

2.       Start the Blackberry simulator

3.       Run the application URL in the web browser of the Blackberry.

Welcome Screen

4.       Enter the UserID  and Password for the user.

5.       The List of PRs awaiting the user’s approval, the requisitioner and the Item are shown on the screen.

Worklist

6.       On selection of a PR, the details of the PR are shown on the next view along with option to Approve/Reject the PR

PR Details

 

 

7. When a decision is made, i.e., if the PR is either approved/rejected, the user gets a confirmation message that the PR has been approved/rejected.

Confirmation message

 

8. Now, when the user goes back to the worklist page, the workitem for which the decision has been made, will be removed from his/her  worklist.

 

To report this post you need to login first.

4 Comments

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

  1. Gregor Wolf
    Hi Sunil,

    it’s also possible to configure Single Sign On (SSO) for the blackberry when you use the RIM BlackBerry RIMLoginModule. A Installation Guide is available on the SAP Service Marketplace via this Link: RIM BlackBerry RIMLoginModule Installation Guide. Darren Hague provides also installation instructions in his paper Universal Worklist with SAP NetWeaver Portal. Also usefull in this case can be the Blog Single Sign On to BSP pages from Duet’s Action Pane from Holger Bruchelt which can be used to provide an E-Mail from within the Workflow which can be opened on the Blackberry to directly open the Workitem that should be approved.

    Best regards
    Gregor

    (0) 
    1. Sunil Manjunath Post author
      Hi Gregor,
      Thanks a lot for the input. Yeah I agree with you that we can use the RIMLoginModule to to configure SSO  for the Blackberry which will remove the need for logging in into the application.

      About doing the approval by directly opening the workitem from the blackberry email, I would like to point out here that PR approval process is a one of a kind process which is very different from most of the other approvals. The PRs cannot be approved from the workitem directly. The standard SAP PR approval is done by navigating to the transaction ME54n from the workitem in the SAP ECC system which is not possible from the Blackberry device. Hence, I’ve used the above method to effect PR approvals from Blackberry.

      (0) 
  2. Richard Wortmann
    Hi Sunil.

    Thanks for this blog.  It is very informative.  I was wondering if having SAP Netweaver Mobile is required to implement this type of approval process?  Is their similar functionality that can be used with out Netweaver Mobile?

    Thanks.

    Rich Wortmann

    (0) 
  3. Bhakti joshi
    Hi,
    First of all, thank you very much for sharing this info. This is really very well organised and clear!

    Requirement is that apart from mobile browser, there should be a mobile application which can be launched from mobile desktop. How can we create such application ? Do we have to create MI project in Mobile Infrastructure Perspective ?

    thank you in advance
    Bhakti.

    (0) 

Leave a Reply