Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

ajt's scratchpad

by ajt (Prior)
on Jun 02, 2004 at 15:49 UTC ( #359511=scratchpad: print w/ replies, xml ) Need Help??

sap-discover.pl
#!/usr/bin/perl use strict; use SAP::Rfc; use Data::Dumper; my $rfc_call = uc(shift) || die "No SAP RFC...?\nsap-discover.pl RFC +_CALL [sap system] [exec RFC]\n"; my $sap_system = lc(shift) || "default.conf"; my $call_sap = shift; print "Testing:\nSAP::Rfc\t$SAP::Rfc::VERSION\nRFC\t$rfc_call\nConf:\t +$sap_system\n\n"; my $rfc = SAP::Rfc->new("./$sap_system"); die "ERROR: Unable to create SAP RFC Object\n" unless $rfc; die "ERROR: ", $rfc->error(), "\n" unless ($rfc->is_connected()); my $iface = $rfc->discover($rfc_call); if ($iface) { print "Structure:\n"; print Dumper($iface); if ($call_sap) { eval { $rfc->callrfc($iface); }; if ($@) { print "RFC ERROR: ", $rfc->error, "\n\n"; die "$@\n"; } print "\nRFC Called okay.\n"; print Dumper($iface); } } else { die "ERROR: ", $rfc->error(), "\n"; } END { $rfc->close() if $rfc; print "\n"; }
You'll need some text config files that look like this:
ASHOST sapsystem.com SYSNR 20 CLIENT 350 LANG E USER Captain Foo PASSWD password TRACE 1
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2015-05-23 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (467 votes), past polls