Skip to Content

Have you ever heard of Blue Ruby? No? Well…simply put, Blue Ruby let’s you run the Ruby Programming Language inside an NetWeaver ABAP Stack…good enough? It is for me of course -:)

Those who know me…virtually or personally, already know that I’m very passionate about Technologies and specially, Scripting Languages.

This week, thanks to Juergen Schmerder and The Blue Ruby Team, I  got early access to the WebGui based Blue Ruby IDE.

Of course, the first thing I did was log-in and tried to do some testing…mostly language related testing. Gladly I found that almost everything I could do on Ruby (Core Language) could be done on Blue Ruby.

So, next thing I do was to start working on my always to be example…an SE16 Emulator.

It was fairly easy because I have done a lot of SE16 example using Ruby, Camping, WxRuby, Sinatra, PHP, PHP/Flex.

Anyway…here’s the code. Just to let you know…there’s a way to make much smaller…almost 6 lines long…but I decided to go with the longer version for two simple reasons.

1.- I wanted to keep testing the language capabilities.

2.- Wanted to separate each field and format them invidually.

3.- Wanted to have fun by writing more code -:P

 

 

Now, some screenshots.

 

image

image

 

I’m sure you’re going to get amazed with this -:) I’m still amazed myself -:D

So…if you want to learn more about, here are some useful links:

 

Blue Ruby: A Ruby VM in ABAP (PDF)

New from SAP Research: Blue Ruby – a Ruby VM in ABAP

Blue Ruby Demo Video Part 1: How to get started

Blue Ruby Demo Video Part 2: How to call ABAP functions

SAP Mentor Webinar: Introduction to Blue Ruby Replay

To report this post you need to login first.

7 Comments

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

  1. Daniel McWeeney
    Very cool, glad someone is able to get in and have a look at this!

    I assume the way to make it 6 lines would be to call some abap directly from ruby, and have it print the data set?

    (0) 
    1. Juergen Schmerder
      Hi Dan.

      Hi hope we’ll be able to get the paperwork done and let more users on the system.

      The short version just takes advantage of the fact that the output of RFC_READ_TABLE is already pre-formatted:

      require ‘rfc’
      $spfli = Rfc.new ‘RFC_READ_TABLE’
      $spfli.query_table = ‘SPFLI’
      $spfli.delimiter = ‘|’
      $spfli.call!
      $spfli.data.each do |l| puts l.wa end

      But Blag’s version is much better because it creates Ruby objects for the hits

      –Juergen

      (0) 
    2. Alvaro Tejada Galindo Post author
      Dan:

      Sure this is great -:) I was looking forward to the early access. Being able to call ABAP functions from Ruby without relying on a RFC Connector and straight from the ABAP stack is a dream come true -:)

      Greetings,
      Blag.

      (0) 
  2. Juergen Schmerder
    BTW: there’s a nice way to write

      $space = “”
      $len = ( $Fields_Length[i].to_i –   $Data_Split[i].length ) + 1
      $len.times do
      $space += “\s”

    a little shorter: Ruby lets you multiply Strings with Fixnums. So

      $space = “\s” * ( $Fields_Length[i].to_i – $Data_Split[i].length + 1 )

    has the same result. Comes in handy sometimes when ABAP functions expect fixed length codes…

    –Juergen

    (0) 
    1. Alvaro Tejada Galindo Post author
      Juergen:

      That’s why I love Ruby -:) So many shorthands…actually I’m planning to re-learn Ruby…read my books and tutorials to find new tricks and apply them to my Blue Ruby developments -;)

      Greetings,
      Blag.

      (0) 

Leave a Reply