Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping CROAK and other errors

Status
Not open for further replies.

scareyman

Technical User
Apr 28, 2004
7
US
I am running a Perl script that calls SAP RFC to communicate with an SAP system. If the system doesn't exist then my program dies with an RFC Timeout.
In the C modules that were used, there is a CROAK routine which I think is where it issues the error.
How can I prevent my Perl script from just aborting?
I want it to continue processing.
 
Your communication, are you conversing with it, or just looking to see if it exists.

Can you 'ping' for existence before actual communication?

--Paul
 
Paul
the very first thing that happens is a connection is initiated as follows:
$rfc = new SAP::Rfc(
ASHOST => $server,
USER => $user,
PASSWD => $pwd,
LANG => 'EN',
CLIENT => $client,
SYSNR => $sysnr,
TRACE => $trace );
If this doesn't connect then it bombs out.
I have tried modifiying the C module with a warn, and even taking out the croak but it still bombs out my Perl script.

thanks,
Stephen
 
Kinda fixed...performing a port scan before attempting RFC connect which I can trap by supplying an appropriate timeout.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top