Skip to Content

Arguably the simplest client available …

.code {
border-style : solid ;
border-width: 1px ;
border-color: #000000 ;
background-color: #E4E5E8 ;

Here is a simple shell script that enables you to make an RFC call (SOAP based) to the Web Application Server, and to parse the results without any of that new fangled stuff!

Some time ago, I wanted a simple HTTP client that only needed the bare minimum to compile ie. just libc, so I wrote
microhttp. I have used this in the example below, but this could easily be replaced with the Perl LWP POST command line tool, wget, curl, or lynx (heck – it may even be possible to do with the telnet client too?) – I just wanted to demonstrate that it could be done with a more or less POSIX set of tools.


  1. encode the authentication details for the Authorization Header

PASS=` echo “$The specified item was not found.:$” | uuencode -m – | grep -v -E ‘====|begin’`

  1. do the SOAP call via HTTP

MYOUT=`microhttp -1 -n -a POST -u  \
                      -r ‘User-Agent: MHTTP1/0’ \
                      -r ‘Host:’ \
                      -r ‘Accept: text/xml’ \
                      -r ‘Accept: multipart/*’ \
                      -r ‘Content-Type: text/xml; charset=iso-8859-1’ \
                      -r ‘Connection: close’ \
                      -r “Authorization: Basic $” \
                      -r ‘SOAPAction: “urn:sap-com:document:sap:rfc:functions#RFC_READ_REPORT”‘ \


  1. get the contents of QTAB
  2. parse out the row markers
  3. translate unicode characters

echo $MYOUT | sed -e ‘s/^\(.<QTAB>\)\(.\)\(
The environment I used for this was:

    • RedHat 9
    • SAP NetWeaver 4 evaluation system, should work with R/3 6.x+

And whats the point of all this I hear you say – well how many times do you have automated admin tasks around your R/3 system where you would like to integrate some simple RFC related function into a script – well now you can.

Having been an Administrator of systems both SAP and not, it would have often been useful to beable to integrate data sourced from an SAP system in to automated tasks (most commonly shell scripts in cron jobs) – this is a door by which it could be achieved, without having any specific higher level programming language/module dependencies (OK. I hope I haven’t offended any sed programmers out there …:-)

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