Pinewood Derby 2008

Sometimes a picture is worth…

RFC_READ_TABLE with Ruby and SAP::Rfc

Warning: another code sample is included in this post.
I spent a few hours this morning trying to use Piers Harding’s SAP/Rfc library for Ruby to read a table from SAP. I found several examples using other languages (Perl, VBscript, PHP, etc.), but the only Ruby example I could find reads the entire table. Figuring out [...]

Ruby: Howto convert numbers to letters

Let’s say you have a series of numbers (1,2,3,4,5…500+) and you need to convert them to letters like A,B,C,D…AA…ZZ (think Excel column headers.)
I searched and searched to find a built-in way of doing this with Ruby, but I couldn’t find it. So, I tried to write my own:
def number_to_letter(n=1)
  n.to_i.to_s(27).tr(“0-9a-q”, “A-Z”)
end
That works great except that [...]