Skip to Content
Welcome to this brand new Ruby/SAP series. In this first volume, we are going to develop a very simple SE16 emulator using Ruby, SAP and SAP::Rfc. First things first…You may asking yourself…Ruby? What’s that? Well…It’s a Japanese programming language with about 10 years of history…Never heard of it? Don’t worry…Me neither…When Rails came out, everybody started to point at Ruby. Lucky us, there was person who already knew Ruby, so he develop a bridge between Ruby and SAP. I’m talking of course, about the great Piers Harding

If you read his blog RFC_READ_TABLE – my old faithful – what has happened to you?, and understand it…Sorry Piers, I’m still a newbie. You’re going to see the main purpose of mine…Make a simple SE16 Terminal Emulator.

Why I’m not using Rails instead of Ruby? Easy…Ruby is the heart of Rails.

Ok, enough chat…Let’s get our hand dirty.

Here’s what we are going to get…


And here’s the source code for it…


Easy right? Hope you like it, and stay tuned for the next volume.

To report this post you need to login first.


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

    1. Alvaro Tejada Galindo Post author
      -:) Thanx for your comments Anton. It’s seems a little bit strange at first, but after a couple of days, you just can’t let Ruby go…But…have you ever look any Ruby IDE on Japanese? It’s amazing how they can understand that…hehehe



  1. Former Member
    Hi Alvaro,
    Thanks for the simple example.
    When I try the code with large tables, I am getting the error:
    c:/Apps/ruby/lib/ruby/gems/1.8/gems/saprfc-0.34-mswin32/lib/SAP/Rfc.rb:1015:in `
    call’: CALL Error: EXCEPT       DATA_BUFFER_EXCEEDED    GROUP   105     KEY
            from Ruby_SE16.rb:34

    Any ideas?

    Thank you,

    1. Former Member
      Looks like it is the limitation of the RFC.
      I found it on the web.
      The function RFC_READ_TABLE reads table records into a table with the structure TAB512. As the
      name somewhat indicates, this table has a single field with the length of 512 characters. This means you
      are limited to reading a combination of fields from your table that does not exceed 512 characters in width.
      In most cases, if you are limiting your call to the specific fields you need, this should not be a problem.
      However, you should be aware of this limitation. Exceeding 512 characters in width will result in an
      exception of DATA_BUFFER_EXCEEDED.
      Complete details at:



Leave a Reply