Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 imbibing at the Monastery: (14)
As of 2014-10-01 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls