Blogs

Mobile SAP Client (Android): android SAP Customer search client demo
Thomas Schnocklake
Business Card
Company: HP
Posted on Nov. 06, 2009 02:26 AM in ABAP, CRM, Emerging Technologies, ERP, Java Programming, Mobile, Open Source, Search, Service-Oriented Architecture

Subscribe. Subscribe
AudioDownload Media
Print. Print
Permalink Permalink

- Update

The app currently available on the market doesn't work with the default settings anymore. The default settings use the SDNs ES Workplace ERP server as backend and uses the function module "RFC_READ_TABLE" directly via web service. But a necessary service on the server was deactivated.

Deactivated Service on the ES Workplace ERP

So it is only possible to use/test the app at the moment if you connect it with your "own" SAP backend. You can do this by using "Menu -> Settings" and provide endpoint, username and password of your externally accessible SAP system.

e.g.: http://ERP_HostName:ERP_HttpPort/sap/bc/soap/rfc

 

 

Background 

The android mobile OS is one of the buzz words seen very often in the media in the last weeks or month. The OS that can be used by all mobile phone vendors free of charge is one of the most important challengers of the iPhone and the Blackberry phone.

Motivation 

One of the ideas behind the OS was making app development for the platform quite easy for 3rd party developers and provide a tool to easily distribute or sell the apps to all interested users to them: the android market -- comparable to the iPhone app store.

So the only thing you need to start developing whatever app you can think of is some spare time. You can find all the necessary tools here: http://developer.android.com. You don't event need a android phone. The android emulator is enough to develop.

Idea 

Because of this I developed a simple android demo/proof of concept app that searches SAP ERP clients by name -- by name patterns --, comparable to a standard SAP search help and that displays the customer data.

Find the necessary ingredients

To do this, I simply utilized the SAP function module "RFC_READ_TABLE" exposed as a web service. Of course there are a lot of more specific web service available in SAP to search customers, but this one is a fast approach for this POC. After all, this function module is available in every ABAP system and SAP version.

Because the android phone needs to access public available web service -- outside corporate firewalls -- , I decided to use the SAP ERP system of the SDN ES Workplace. You can find the wsdl-file to the ws here ( you have to apply for a user for the es workplace first):  

http://erp.esworkplace.sap.com/sap/bc/soap/wsdl11?services=RFC_READ_TABLE&sap-client=800  

The android version 1.6 and up is capable of connecting to your corporate network via VPN. This could be used to connect your phone to the SAP backend. One other possibility is to deploy a kind of proxy ( or middleware) between the SAP and the internet.  Or just make the http port of your sap server available to the internet (at own risk).  

The next problem is that the android SDK does not provide a soap client implementation. Some Google searches pointed me to an old fellow: the kSOAP2 (http://ksoap2.sourceforge.net/) lib. This is a soap client implementation targeted at J2ME application. Though i found out later that it has it's limitations, it did a good job in this POC.

Put it all together

I don't want to go to much into detail, but if your interested, i can send the code. 

Android SDK provides UI Element (view) that with the name AutoCompleteTextView (http://developer.android.com/reference/android/widget/AutoCompleteTextView.html).

This is a simple text input box that displays predefined suggestions after every letter the user types into it. e.g. an auto complete for county search would perhaps suggest "Germany" and "Georgia" if the user types "Ge".

This view does a query for suggestions each time a new letter is typed ( or deleted).

So my implementation queries the SAP (via web service) for clients that match the letters (2 letters minimum). In my case, i do the matching against the name (kna1-Name1), customer number, street and city. So, IF the user types "Ne Wa", SAP could find customer "John Washington" in "New York" or customer "Isaak Newton" in Washington :-)

Searching  

When the customer is found and selected, the app displays it's master data and enables the user to view his location an Google maps. ( you can think of more - e.g. show his sales history, his sales charts)

There is also a settings screen for the web service. With this settings, your able to connect to your server. The EndPoint looks like "http://yoursaphost:saphttpport/sap/bc/soap/rfc".

Web Service settings 

Result 

See yourself. The video provides a real device demo. 

Look at the video or just install from the market place (even without a android phone http://android.modaco.com/content/general-discussion/289928/testing-getting-an-emulator-up-and-running-a-full-rom-with-the-market-etc/ ).

I was surprised how fast the online search is, even on medium quality network connection.

This is only my first POC. Think what is possible. Create orders in ERP/CRM ... . Look up all kind of data. Combine SAP ERP with non-SAP data ... Ideas welcome

Customer data detail

 

Video

See the app on an real device: 

http://www.youtube.com/watch?v=57Q3l3SXmHU 

 

 

 

 

  

 

 

 

 

 

 

 

 

Thomas Schnocklake is a SAP solution architect at HP switzerland


Add to: del.icio.us | Digg | Reddit


Comment on this articleAre you interested in this kind of app? Do you have other ideas to implement or a real business case?
Comment on this weblog
Showing messages 1 through 13 of 13.

Titles Only Main Topics Oldest First

  • Excellent
    2009-11-18 06:51:20 Vaibhav Dua Business Card [Reply]

    Hi Thomas,


    Excellent blog and I have been trying to do the same thing since the introduction of SDK 1.6. I'm actually executing a BAPI in the SAP system and getting a runtime error that process is stopped. My question to you is my machine is connected to the SAP system via VPN, can my emulator still connect to SAP?


    Could you please send me the code at "to_vaib@yahoo.com"


    Vaib

    • Excellent
      2009-11-18 07:00:42 Pierre DOMINIQUE Business Card [Reply]

      Hi Vaib,


      As far as I remember you should be able to connect to your system within the emulator if the machine is connected to your network via VPN. Just try to open a random internal webpage in the web browser of the emulator to check.


      Note : the code is available here -> http://code.google.com/p/spapandroid


      Regards,


      Pierre

  • Nice POC
    2009-11-17 16:19:36 David Baillieul Business Card [Reply]

    I am working on something similiar. Could you email me your code please. Long live the Droid!



    longlaketech@gmail.com

    • Nice POC
      2009-11-17 21:16:34 Thomas Schnocklake Business Card [Reply]

      hi david,


      Check it out at http://code.google.com/p/spapandroid .
      As I nentioned in another response, i think ksoap can not work with all SAP wevservices..
      So i use a different approach now (manual xml request generation and response parsing. There is also some code for this in the rep. ) i cant give you more detail now because i am chilling at an thailand beach right now.

  • Great example
    2009-11-08 10:04:47 Pierre DOMINIQUE Business Card [Reply]

    Hi Thomas,
    This is a great example. I used the same approach for my first POC and then switched to REST Web Services. I'll write a blog regarding this topic as soon as I can.
    Regards,
    Pierre
    • Great example
      2009-11-08 22:09:22 Thomas Schnocklake Business Card [Reply]

      Yes, you are right. When I did the research for my app some weeks ago, I found out that the main reason that google did not provide a soap lib is the overhead. But is is very convinient to use soap in a SAP context. KSOAP is the lib mentioned the most in consuming soap services with android. Thougth I think KSOAP has its limitations. It seems to be impossible to process xml like "<price currency="USD">113.44<price>.
      Prehaps it is necessary to paras xml by hamd
      • Great example
        2009-11-08 23:27:59 Thomas Schnocklake Business Card [Reply]

        I will do a blog in 2 weeks about using other way of using soap services. Im right now on vacation and writing this using my android soft keyboard: -)
  • Great Stuff
    2009-11-06 05:14:07 Andrew Harris Business Card [Reply]

    I am in the process of doing something similar but had opted for the Jco library when I found Android did not natively support SOAP. The scenario I was looking at was for indivduals who did have access to there WLAN and therefore security is less of an issue. I will now investigate the KSOAP alternative, as I prefer this approach.


    You mention you are happy to share the code. Could I suggest you posting it to http://code.google.com. If not I would certainly like a copy it.


    Thanks


    Andrew

    • Great Stuff
      2009-11-08 09:56:42 Pierre DOMINIQUE Business Card [Reply]

      Hi,
      That's funny, I wrote a blog 2 weeks ago explaining how to consume SOAP Web Services with Android : http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/16483
      Regards,
      Pierre
    • Great Stuff
      2009-11-06 10:08:23 Thomas Schnocklake Business Card [Reply]

      Ok, you can check out the code at http://code.google.com/p/sapandroid
      please change webservice endpoint, username an pw in toe code or in the settings to reach your server.


      Thomas

  • Excellent
    2009-11-06 04:14:41 Michelle Crapo Business Card [Reply]

    I learn a lot of interesting things just by reading blogs. What a great idea.


    Could you send me the code? Or post it somewhere on SDN?


    Thank you,


    Michelle
    mcrapo@perrigo.com


Showing messages 1 through 13 of 13.