Skip to Content

Writing iPhone apps for SAP is a mindfield and a few tips and tricks will stop you from making some of the mistakes that we made early on! If you follow these 10 golden rules then you stand a better chance of making a successful SAP iPhone implementation. Good Luck and please write comments below on how it went for you!

 1) Write a native iPhone app (and buy a Mac)

We started writing web apps but with SAP, you need to write this in a BSP and this becomes quickly very messy as it all has to sit in one page. Making modifications back to SAP is even harder and you have to use AJAX to load things piecemeal. What’s more it becomes really slow.

You need to go and buy a x86 Mac (sorry!) and pay your $100 to the iPhone developer program at http://developer.apple.com/iphone/program/. The programming language is Objective C so some C/C++ programming experience will come in handy.

 2)  Use RESTful services

The iPhone has no native SOAP ability so using function modules and wrapping them up as web services isn’t an option right now unless you want to parse SOAP using the XML libraries. What’s more, REST is a good protocol for mobile applications as it is low overhead which means faster network response and less iPhone CPU time spent parsing.

Check Uwe Kunath’s blog on this here: RESTful webservices in ABAP using a generic controller

 3) Avoid security problems

The iPhone has Cisco VPN capability built in and this is a good way to get into your corporate network. We also used ISA Server with NTLM authentication and tried to use User Certificates for x.509 – but haven’t got the latter to work yet. From there you can use HTTPS basic authentication back to CRM.

4) Remember your memory model

The iPhone is based on Objective C which is a strongly typed (for the sort of objects you will be working on) and has no garbage collector. What you have to be most careful of is not to release an object in one place, when it is still in use somewhere else. If this happens, you will get the dreaded EXC_BAD_ACCESS error. You also have to be careful to autorelease or release objects at the right time, to avoid memory leaks, for which Apple will reject your app submission to the App Store.

5) Go online/offline using Core Data

We found that the complexities around online/offline data synchronisation were worth it. Early betas that we built were entirely online and it turns out that Objective C’s memory model means passing around all the arrays and such was really onerous and prone to releasing the wrong object at the wrong time (see point 4). Much easier, is to use Core Data to store your SAP information.

6) Use a data orchestration engine (DOE)

Once you are online/offline then you need to sync the changes from the iPhone to CRM and vice versa. On the phone, keep a change log which is written up to SAP asynchronously. On SAP, trigger events to a change log table (DOE) which is based on the subcribers that have iPhones.

7) Don’t trust the simulator (though it’s great!)

The iPhone simulator is great, but it compiles against x86. This means that a number of things will work on the simulator that won’t work on the iPhone, partially because the iPhone is compiled against a different platform (ARM) but also because timings are different. This seems to make the iPhone much more sensitive to memory problems. What’s more, the iPhone simulator actually has more OS libraries to compile against and you can for example consume SOAP services on the simulator for this reason (!).

8) Choose your business process

When you come to design your app – choose a business process that you want to simulate, and whatever you do, do not try to simulate a SAP software package by copying it. If you go to the business, they will often want all the functionality. Fight with them hard on this and find a business process which you can mobilize and keep it simple. Produce a proof of concept based upon this and iterate. Remember that good mobile applications do something – really well.

9) Abstract, abstract, abstract

Keep all your business logic in SAP and download master data tables to the iPhone. Try not to hard code business logic in the phone where possible because this will cause you a whole world of pain when you want to roll out a new app. Remember that iPhone software distribution is still quite immature and you have to roll out the app manually. which makes this doubly important!

10) “Design is not just what it looks like and feels like. Design is how it works.”

This is what Steve Jobs said in 2003 and it still holds true. The iPhone is all about writing apps that work well and feel right. Spend your time tuning your screens and thing about your screen flow up front. This will pay off in the form of user adoption.

To report this post you need to login first.

14 Comments

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

  1. Nigel James
    John,

    This is great information from someone who has been there done that and demonstrated it under pressure on stage in 360 seconds.

    Great to see you in Vienna and looking forward to more great blogs from you.

    Cheers,
    Nigel

    (0) 
    1. John Appleby Post author
      Thanks Nigel, I promised I would blog more!

      Just hope this article helps us avoid some of the problems that we spent a long time fixing. Information on this topic is hard to find!

      J

      (0) 
  2. Adam Szigeti
    Hi John,
    Could you pls drop here a few more words why you changed from web apps to native apps? Web apps are said to be simpler to distribute and could even be platform-independent. I can see it is smthg about the one-page design, but it is not quite clear now

    thanks

    Ádám

    (0) 
    1. John Appleby Post author
      Hi,

      Sure, no problem. The one page design in the BSP seems to turn into a monster very quickly. BSP applications aren’t as flexible as say PHP might be.

      It’s possible that you could use PHP to interface to SAP Web services and thereby expose CRM but it added another layer of complexity.

      I’ve had some conversations with people who built complex web apps with AJAX and some offline caching, which has been improved in iPhone 3.0.

      And I agree with your comment that you could make them independent (e.g. AJAXWeaver) but if you look at the meteoric rise of Apple’s iPhone store, this suggests that it’s not what people want.

      What Sybase have done is to put a metadata layer using their SUP platform, to allow binaries to be built for multiple devices. Presumably this is the best way to fix the issue of platform independence because you have native binaries.

      Regards,

      John

      (0) 
    2. John Appleby Post author
      Hi,

      Sure, no problem. The one page design in the BSP seems to turn into a monster very quickly. BSP applications aren’t as flexible as say PHP might be.

      It’s possible that you could use PHP to interface to SAP Web services and thereby expose CRM but it added another layer of complexity.

      I’ve had some conversations with people who built complex web apps with AJAX and some offline caching, which has been improved in iPhone 3.0.

      And I agree with your comment that you could make them independent (e.g. AJAXWeaver) but if you look at the meteoric rise of Apple’s iPhone store, this suggests that it’s not what people want.

      What Sybase have done is to put a metadata layer using their SUP platform, to allow binaries to be built for multiple devices. Presumably this is the best way to fix the issue of platform independence because you have native binaries.

      Regards,

      John

      (0) 
      1. Adam Szigeti
        Thank you!

        I believe web apps have a great potential in connection with ERP’s, however, SAP back end needs some work to let web apps shine… I feel the same with Business by Design, though I have little experience with both topics

        Have a nice day,

        Ádám  

        (0) 
  3. Divya Mahajan
    Thanks for the interesting tips. SAP/Sybase has a mobile platform that (also) targets the iPhone. I was curious about your opinion – is it better to write a iPhone app (native / web app) or is it better to use the Sybase toolkit?

    Do you have any comments on using the “mixed” application development? (Native+Webapp)

    (0) 
    1. John Appleby Post author
      Hi,

      I’m in the progress of getting the Sybase Unwired Platform working for CRM Mobile Sales. So I will blog on this soon but it is very promising.

      I will also blog soon on the topic about the different types of app development and how they might be mixed because there seems to be a lot of confusion in the marketplace.

      Regards,

      John

      (0) 
  4. Harald Reiter
    …enjoyed your DemoJam session and it looks like a lot of thought went into your design.
    Nice meeting you afterwards at Hackernight and hopefully we will be able to meet again in London/Richmond area sometime.
    :-)Harald
    (0) 
    1. John Appleby Post author
      Hey Harald,

      Thanks! Let’s try to get something together with Si and Nigel in Richmond, agreed!

      Doing the Demo Jam thing was a fantastic experience and I’m going to be dragging people together to think about our Demo Jam ’10 submission soon!!!

      Regards,

      John

      (0) 
  5. triangel6 triangel6
    Hello John,

    I want to access sap crm 7.0 from iphone or any mobile device.

    Is there any standart transaction for this, such as accessing create activity or sales transaction with mobile interface?

    (0) 
      1. Vikas Sharma
        Hi John,

        Please let us know how your beta testing going on, if possible give us another informative blog on this. Also, how you got the beta application can we download it from somewhere ?

        Regards,
        Vikas

        (0) 
        1. John Appleby Post author
          Hi Vikas,

          Asssume from your business card that you are stateside – Sybase are running a mobile conference on Weds 3rd in London:

          http://www.mobileenterpriseuk.com/

          The beta program is going pretty well and we have now put it in our productive SAP environment as well as the demo environment and are currently going through a round of UAT.

          I’m write a blog on our progress in the next week or so as we start to come out of UAT, around our experiences and hopefully include some hints and tips!

          Regards,

          John

          (0) 

Leave a Reply