Skip to Content

How to persist custom data in SAP PI java table – Part 3

In part-1 and part-2 of the blog we created a table in java stack, created and deployed entity and session bean in java server. Also we added HTTP authentication for the deployed service.

In this part we will test the service in SAP PI.

STEP 8: Test the webservice in WSNavigator

Open wsnavigator in SAP PI and select Provider System in search type and search for the webservice


Select the interface and click next and you should be able to see all the methods we created in the session bean


Let’s test add ticket method. Select AddTicket method and click next. Provide all the input values and click next. If the insert is successful we should get the ticket number back as response


Let’s read all the rows in the table and see if the row is actually inserted in the table


Web service clients:

     a) PI mapping: Since the web service is available in SAP PI, We can perform SOAP lookup in mapping step to perform any operation on the table.

     b) Adapter Module: Since we have local interface deployed along with the session bean, we can use dependency injection in the adapter modules(local enterprise bean only) with @EJB annotation(on EJB 3.0).

     c) Remote clients: Remote clients need to perform JNDI look up to SAP PI(Not covered in this blog).

Note: 1) Special thanks to my friend and colleague N.Prasanna (SAP UI5 Consultant) for helping me 🙂


         2) Developer should take care of table maintenance and that table entries do not overflow.

         3) If the data that needs to be store is small and frequently used then it is better to store the data in value mapping in SAP PI instead of storing the data in database.

Any suggestions or feedback use the comment section below.

You must be Logged on to comment or reply to a post.
  • Nice blog series, Anand. Appreciate your effort in sharing this. Definitely good to know as the ABAP stack is being slowly “phased” out!


    Eng Swee

  • Hi, Michal. Thanks for detailed explanation.

    Could you clarify, if using of JPA entity in PI 7.4 database is fully covered by SAP licensing? Is it any restrictions for custom JPA development in PI database?


    Regards, Sergey.

      • Hi Michal,


        Writing to you expecting a quicker reply,sorry.

        I followed all the steps as per this blog. But somehow stuck in Step#7 .

        The Web service is deployed successfully in the NWDS but the service definition is not reflecting in the NWA/SOA- Application and Scenario Communication – Single Service Administration.

        The web service deployment logs is successful in NWA as per basis team inputs.

        But no idea it is not reflecting in the NWA service definition.

        Can you please help?



        Shaily Chaudhary

  • This is a very helpful blog. Thank you very much.

    Just wondering if anyone had any success with calling the created service from a SOAP client?

  • Very nice blog! I am trying a similar thing but on a smaller scale. I wanted to use a database table to store sequence numbers since we don’t have a standard way to do it (unless you have B2B add-on NRO).