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.
Nice blog series, Anand. Appreciate your effort in sharing this. Definitely good to know as the ABAP stack is being slowly "phased" out!
Rgds
Eng Swee
Hi,
nice blog, the same can be achieved using CAF with a bit less coding I believe
but both are useable 🙂
Regards,
Michal
Hello Experts,
Your valuable thoughts/suggestions on this please. Many Thanks in advance!
Â
https://answers.sap.com/questions/12882619/how-to-store-and-retrieve-oauth-tokens-in-sap-po.html#
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?
Thanks.
Regards, Sergey.
Hi Sergey,
That you'd need to check with SAP sales but I hope it is... 🙂
Best Regards,
Michal Krawczyk
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?
Regards
Shaily Chaudhary
Hi,
Nice blog. however please suggest how can we call this table (with its methods) from custom adapter module.
Br,
Madan
Hi Madan,
Use dependency injection in your adapter module
http://www.oracle.com/technetwork/articles/java/cdi-javaee-bien-225152.html
Thanks,
Anand
Hi Anand,
Thank you. Please suggest how to transport created java dictionary custom tables and its entries.
Br,
Madan
Hi Madan,
The java dictionary table can be exported to an ear file. The ear can be attached to cts+ transport and moved to other environments.
But, I am really not sure how to transport table entries from one environment to other. If I find any way to do this then I will update it here.
Thanks,
Anand
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?
Nice blog Anand
Regards
Vinay
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).