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…

image

And here’s the source code for it…

Ruby_SE16.rb

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

To report this post you need to login first.

5 Comments

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

      Greetings,

      Blag.

      (0) 
  1. Srinadh Karumuri
    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
    DATA_BUFFER_EXCEEDED    MESSAGE DATA_BUFFER_EXCEEDED (RuntimeError)
            from Ruby_SE16.rb:34

    Any ideas?

    Thank you,
    Sri

    (0) 
    1. Srinadh Karumuri
      Looks like it is the limitation of the RFC.
      I found it on the web.
      —————
      2. DATA_BUFFER_EXCEEDED
      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:
      http://72.14.209.104/search?q=cache:KP9nLQnINb8J:sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/portal-content/Simplified%2520Queries%2520of%2520SAP%2520Tables%2520from%2520Java+DATA_BUFFER_EXCEEDED+(Runtime+Error)&hl=en&ct=clnk&cd=2&gl=us&client=firefox-a

      Thanks,
      Sri

      (0) 

Leave a Reply