Skip to Content

Lipstick on a Pig ( Why Rails is good for SAP )

If you were at SDN Day in Vegas or hung out in the clubhouse for any substantial period odds are good you heard about “Scripting Languages.”  If you stumbled across Ryan Loweimage and were totally confused, you should probably start with this Wikipedia Link and then head over to read the Poignant Guide to Ruby and finally an Onlamp Article about Ruby on Rails, don’t worry about the second guy he is a little nuts, but a lot of fun to read.  With all of that learnin’ that out of the way, you might wonder what any of this has to do with SAP.  Well nothing really, Ruby and the Ruby on Rails community have absolutely nothing to do with SAP.  Which I personally look at as a good thing, but if you don’t believe me you might want to read the rest of this blog.  If you happened across my “Birds of a Feather Session” in the clubhouse or came to SDN Day and went to my Rails session, you might have seen me demo a Time Management system I wrote for my group using Ruby on Rails backended by a BW System.  If you didn’t get to see it, here it is again.  First, just a quick recap about what the heck you just saw, or saw last week:  the names in the bottom left hand corner are people who work in my group basically, I just take a name and drop and drop them onto a project.  Once the AJAX update finishes I can then use the bar that appears to set the start and end week for that person on that project.  Again in the background AJAX is updating a BW cube, then in the lower right hand corner is a web template with a query that is running on the cube that I am writing to, which helps me level the resources as the year goes on.  In a future blog I will walk though how I built such a thing but first I want to talk about what is the big deal with this Ruby on Rails(RoR) stuff.  The first positive of RoR is it’s ability to improve developer productivity.  Yes, I know we all have already learned ABAP, but I couldn’t have written all that AJAX and drag and drop stuff in ABAP in the 2 days it took me to build the RoR application.  The reason it was so easy to write is due to the way RoR applications are built.  RoR forces you into using a MVC framework for your web applications, not only is this just good programming it also allows the framework to make some great logical leaps that really help you out.  RoR really pushes the idea of “Convention over Configuration,” a simple example is that in a controller you have a method normally in that method somewhere you have to tell the controller what view to call, however in RoR if you name a view associated with that contro2ller the same name as the method RoR just links the two together and calls it automatically.  Yes, of course you can override this if you want, but hey they were just trying to help you out. Another really great tool built right into the RoR framework is the ability to code unit and integration tests right into the development environment.  This really allows you to tear your application apart, rebuild it and make sure it still passes all the tests it did before you ripped it apart.  This testing tool really speeds up development and helps drive errors out.  You can even use this system really do test-first development.   Finally, the last point is that RoR isn’t ABAP, some might say this makes you less productive and in the short term I might agree but, in the long term you will be a faster, better developer and embracing the RoR framework now allows you to not only find talented ABAP developers but also talented RoR developers and like Woody Allen said, “[Using two technologies] immediately doubles your chances for a date on Saturday night.”  The other major area RoR helps your organization is in an area Shai himself said, we all need to work on, “Thril[ling] your Users.”  If you showed the attached demo to an ABAP developer and said, “That’s an SAP system,” odds are pretty good they might think you are nuts and stop speaking to you all together ( don’t try this on your boss — it won’t work ).  However, show this to your actual end users and they might just kiss you.  There is no easy way inside the bounds of normal SAP to make web based UIs that look like that, without dedicating a substantial amount of time to it, ask the SAP BI 7.0 developers.  The reason RoR makes this so easy is it’s linking to a javascript library known as which is based on the prototype library.  These libraries are used all over the web and are very flexible a pretty much rock solid.  Inside RoR you can make very simple calls to these libraries that do everything from the drag and drop stuff you saw in the demo to those slider bars to set the weeks all the while using the same library to generate AJAX calls to the backend BW system.  There are even more benefits of using RoR however, I will leave all that up to your own imagination at this point, given all the information you’ve read from the 1st paragraph.  Suffice to say that using the Ruby on Rails framework along with Piers Harding’s connectors can make your developers better..  Special thanks to Cote’image for the title of this blog.
You must be Logged on to comment or reply to a post.
  • …I know I won’t make friends with my statement and I am not sure if it is necessary to even post it, but I simply have a feeling of some inadequate momentum the Ruby topic gained here, mainly due to very good lobbying of some.

    So here’s my remarks:

    …not only find talented ABAP developers but also talented RoR developers…[which] doubles your chances for a date on saturday night…

    IMHO, this is completely wrong! Just have a look at a thousand resumes in your company and count those that had ever any real contact with Ruby. Very few you’ll find. Surf the net for sample applications based on ruby and forums for it and compare the numbers with those of other well known languages/scripting languages. It’s used by comaparetively few and in even less scenarios.

    The time management demo is nicely done! But all the effects it ‘shouts’ for have nothing special to do with RoR but they all attribute to the (en passant) mentionend libraries from Calling these libraries imho is equally easy in almost any other contemporary scripting language.

    The BI integration is probably done using RFC calls and or web service calls, for which in the first case libraries exist for almost any actual scripting language and wher in the latter case ‘native’ support of the languages is provided. So, again nothin exceptional, imho, on the RoR side.

    I really want to emphasize, that the example shown is a very nice one – and in this case it is RoR, a good scripting language – and I do hope that people like you motivate others to try new things, reach for new limits.

    I just want to stand up against that false impressions seede that R/RoR is really a good option to go unless you want to build up Ruby skills from the scratch and risk a lock-in to that very few ressources available on the market and risk the lock-in to a language that hasn’t (yet?)reached a critical mass of supporters on the scene.

    just my 2 cents.

    • “Just have a look at a thousand resumes in your company and count those that had ever any real contact with Ruby.”
      What I am trying to say here is that you DON’T need people with both ABAP and RoR, you can have people that are ABAP experts and RoR experts and if you design the system well, they almost never need to cross over.

      I was planning on talking about in the future blog was how the models were bulit to masquarde as regular ActiveRecord models, allowing your RoR folks to focus on the UI design and the ABAP folks to focus on getting the business rules right.  I created methods like find_all and find_all_by_projectID to make the rails side look as normal as possible. ( see  for more indepth commentary on some ideas about how to do that better ).

      In regards to the stuff, do any other scripting languages that have web frame works have JS helpers for them that are stable and well used in the community? ( The Django community seems all together apposed to writing JS helpers )

      “I just want to stand up against that false impressions seede that R/RoR is really a good option to go unless you want to build up Ruby skills from the scratch”
      The other thing i don’t mention is that I didn’t know any ruby or RoR before starting this project and after about 2 weeks of research it took me about 2 days to build the entire application you saw there, including having to write my own JS Helper for some of the stuff.  So, I don’t feel “lock[ed]-in” as RoR was easy to learn, to at least do some basic stuff.

      thanks for the input.

      • Hi Dan:

        Great blog! I really love the example -:P And of course I have read “Poignant Guide to Ruby”…I want my Chunky Bacon! -:)

        Anton, your my friend…So I’m going to say this -;) Maybe Ruby or Rails doesn’t have a big market yet, but as Piers points…The same happens why PHP…I started learning Ruby because of Pier’s SAPRFC:Ruby and I just love it…Ruby is so great and of course gonna start learning Rails on a few days…What we need here is some more advertising…How do you expect people to learn new scripting languages if they read your comments -:P Sorry…But…As I told you…I consider you my friend…So I got to tell you what I think -:)

        We’re the SDN Scripting Community members…We need to encourage the use of Scripting Languages…



        • Well said, in terms of SDN and the community – the thing to remember is that we can only “promote” if that is what you call it when we list items on one of the homepages with the information we have on hand – at the moment it happens to be all RoR based – I’m more than happy to put PHP stuff up as well (but someone needs to give me it)

          What I like the most about the community though is they keep each honest and me as well 🙂 Keep the info coming folks!

        • Blag,

          I think you misunderstood my point.

          Anyway, feel free to always tell me what you think of my comments. I appreciate feedback and think about it.

          I am sure you’re doing your best for the scripting community.

          greetings across the oceans,

          • Anton:

            Maybe your right -:P You know that English is not best language -;)

            Still…I always love to read your comments…Because your almost the only one that speaks the truth, without trying to make it look like a complement -:) I think we all need some degree of criticism in order to make this better.



    • Hi Anton –
      What I get from what you are saying is essentially that no one should ever attempt to follow new Software Paradigms because there isn’t any real market out there for them (yet) and therefore you shouldn’t bother with them.  I wonder if you felt that when you first tried PHP how many years ago?
      Anyway – any new innovation has early adopters, fast followers, and then basically the rest sometime later – these are just facts of (IT) life.  I personally havee found it extremely rewarding – whehter I make any money out of being an early adopter or not – as I feel an advantage gained from the learning experience (and hey – no one said bet your day job on it).
      You should not be discouraging people from investigating, evaluating, and making there own minds up on the basis of an opinion that is quite frankly something that I would expect to come from a high-end-marketing-FUD-factory.
      Ruby and Ruby on Rails have a potential well worth making the effort of investigating irrespective of any sort of SAP angle, and you can easily get some idea of its capbilities by looking at (towards the bottom).
      I urge everyone to make up their own mind – and whether you decide to run with it or not, I’m sure you’ll enjoy the ride of an approach that I quite frankly, find refreshing.

      Piers Harding.

      • Piers,

        thanks for your comments. I completely agree with you that everyone should make upt their own mind. And I hope I was careful enough with my former statement not to discourage anyone to investigate, evaluate, learn, have fun with whatever new thinks compe up – the real essences of live – moving on.

        I would never ever question your full rights to promote here on SDN the things you like most – one of which being RoR. I’d fight for it if necessary.

        And you’re promoting the latter so well here that it gets an exceptional weight here. All I thought now was that the _hasty_ reader might get a false impression of its real impact(what does an exec care wether it’s called Ruby, Python, ActionScript, PHP as long as its hip). If the reader investigates, … all will be in balance.

        Since I have no intimate affiliation with any particular scripting language nor any political motivation to promote a particular one nor do I want to make a living from maintainig one I won’t answer with a categorical ‘Better do it with XXX’ like I try to do in the WS vs. RFC case. I’m looking at scripting languages pragmatically and from that point of view RoR seems overhyped on SDN to me.

        And hey, Dan, I _really_ like your app apart from the promotional part.


        • When 3 or more highly intelligent and articulate folks debate  publicly like this, the end result could be more intense scrutiny of ideas by readers, which hopefully won’t stifle the creation of, or promotion of, new ones.  So thanks to you all for that fascinating exercise here.  I, for one, have cautioned against using language which intimidates others, but have probably been guilty of this very crime myself.
          I must say, this blog and corresponding comments, have whetted my appetite to understand more fully the benefits of RoR.  Perhaps, in all honesty, it was the debate here that drives that interest, but I’m glad that Anton feels he would defend the right of Piers to promote things he enjoys while questioning the positioning of Ruby.
          My only advice would be to exercise caution when using words like “completely wrong” or “nothing special to do with”.  Maybe it is the nuance of language usage, but for some: “thems fight’in words”.  Thanks to all for your obvious integrity.
    • Hi,

      In order to add fuel to the fire, I want to suggest that Coldfusion is the best scripting language invented:-) No seriously, I used to develop with it in a previous (non SAP) life and it was a marvelous language. A pity that with the takeover of Allaire by Macromedia and later Adobe, it got out of the attention it deserves.


  • Hi Dan,

    Great meeting you at TechEd last week. Ed and you brought quite some enthusiasm to the event.

    It took me a while to figure out why I think your blog title doesn’t work.

    The saying is: “You can put lipstick on a pig, but it is still a pig.”

    With your blog you are trying to convince us SDNers living in our pigdom to put on lipstick via Rails, which will not change the essence.

    I know it is meant humorous, still the pig association may turn people off unnecessarily.

    Still great job, Mark.

  • As much i like to be a JS proficient and would like to use R/RoR type framework, i guess what i would like to ask is
    Does R/RoR provide one with a Client independent Server side rendering mechanism? I am taking this in comparison to WebDynpro model by SAP and it appears like R/RoR is similar.
    When you talk about R/RoR and AJAX, it then obvioulsly is a JS framework that you are relying on, to me that suggests that there is a greater risk of leaving footprint on the Client side, eg connections to the backend systems etc.

    I guess these questions are probably a lot more academic to you guys as i haven’t used R/RoR or anything similar. I have used XSLT extensively on DotNet environments and also used some Client side framework to fit with DotNet, calling Backend webservices from JS and then using XSLT to do all the html maps, back and forth but this is all pure client side effort, hence someone capable can get enough info about the applications, connections and interfaces etc.
    To me, i always try and stick to Server side as much as possible for the reasons above.

    SAP WebDynpro model (Java or ABAP) does give you the Server side model for all client side rendering (Client independent) with not much effort at all and it seems to have a very strong client side framework, i am not sure exactly what library its using but it seems to be triggering Acynchronous calls back to the server via some JS libraries, hence seems to give you a flicker free type environment. The way it links Client Side events to Server side actions seem like a nice way of doing things.

  • We’re looking at writing Java code that will insert, update, delete, and make salads with a BI cube, but we need to find some code samples.

    Could you share any of your Ruby code for connecting to the cube?