Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

ajt's scratchpad

by ajt (Prior)
on Jun 02, 2004 at 15:49 UTC ( [id://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
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 01:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found