This queue is for tickets about the SAP-Rfc CPAN distribution.

Report information
The Basics
Id:
41210
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
bert.tijhuis [...] wavin.com
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
1.54
Fixed in:
(no value)



Subject: Troubleshooting Outbound IDOCs via the SAP::RFC module
Troubleshooting Outbound IDOCs via the SAP::RFC module After upgrading in a SAP 4.7 to SPS30 From: SAP_BASIS 620 0058 SAPKB62058 SAP Basis Component SAP_ABA 620 0058 SAPKA62058 Cross-Application Component SAP_APPL 470 0026 SAPKH47026 Logistics and Accounting SAP_HR 470 0055 SAPKE47055 Human Resources ABA_PLUS 100 0015 SAPKGPBA15 PLUGIN ZU ABA_PLUS EA-IPPE 200 0021 SAPKGPIB21 EA-IPPE 200 : Add-On Installation To: SAP_BASIS 620 0064 SAPKB62064 SAP Basis Component SAP_ABA 620 0064 SAPKA62064 Cross-Application Component SAP_APPL 470 0030 SAPKH47030 Logistics and Accounting SAP_HR 470 0080 SAPKE47080 Human Resources ABA_PLUS 100 0020 SAPKGPBA20 PLUGIN ZU ABA_PLUS EA-IPPE 200 0025 SAPKGPIB25 EA-IPPE 200 : Add-On Installation The Outgoing IDOCs are not working anymore with the SAP::Rfc module: Into the ‘dev_rfc.trc’ the next lines appears: **** ERROR file opened at 20081124 170001 CET, SAP-REL 640,0,167 RFC- VER 3 884790 MT-SL T:16384 Error in program 'itidoc.rfcexec': ======> FUNCTION_MISSING raised by external server T:16384 Error in program 'itidoc.rfcexec': <* RfcDispatch [5] : returns 13:RFC_NOT_FOUND Within the coding we defined the next: Do activate_acceptor(); sub activate_acceptor { my $rfc = new SAP::Rfc( TRFC => 1, TPNAME => $_id->{connect}->{$profile}->{dest}->{$grp}-> {TPNAME}, GWHOST => $_id->{connect}->{$profile}->{dest}->{$grp}-> {GWHOST}, GWSERV => $_id->{connect}->{$profile}->{dest}->{$grp}-> {GWSERV}, TRACE => $_id->{connect}->{$profile}->{dest}->{$grp}-> {TRACE}, TRFC_CHECK => \&check_tid, TRFC_CONFIRM => \&confirm_tid, TRFC_COMMIT => \&commit_tid, TRFC_ROLLBACK => \&rollback_tid, ); $rfc->iface( idoc_inbound_asynchronous() ); $rfc->iface( idoc_inbound_process() ); $rfc->accept(\&callback,10); $rfc->close(); } sub idoc_inbound_asynchronous { my $rfc = new SAP::Rfc( ASHOST => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {GWHOST}, USER => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {USER}, PASSWD => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {PASSWD}, LANG => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {LANG}, CLIENT => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {CLIENT}, SYSNR => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {SYSNR}, TRACE => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {TRACE} ); my $it = $rfc->discover('IDOC_INBOUND_ASYNCHRONOUS'); my $c_str = $it->tab("IDOC_CONTROL_REC_40")->structure(); my $d_str = $it->tab("IDOC_DATA_REC_40")->structure(); $rfc->close(); my $iface = new SAP::Iface( NAME => 'IDOC_INBOUND_ASYNCHRONOUS', HANDLER => \&do_idoc_inbound_asynchronous ); $iface->addTab( $it->tab("IDOC_CONTROL_REC_40") ); $iface->addTab( $it->tab("IDOC_DATA_REC_40") ); return $iface; } sub idoc_inbound_process { my $rfc = new SAP::Rfc( ASHOST => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {GWHOST}, USER => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {USER}, PASSWD => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {PASSWD}, LANG => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {LANG}, CLIENT => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {CLIENT}, SYSNR => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {SYSNR}, TRACE => $_parm->{connect}->{$profile}->{dest}->{$grp}-> {TRACE} ); my $it = $rfc->discover('INBOUND_IDOC_PROCESS'); my $c_str = $it->tab("IDOC_CONTROL")->structure(); my $d_str = $it->tab("IDOC_DATA")->structure(); $rfc->close(); my $iface = new SAP::Iface( NAME => 'INBOUND_IDOC_PROCESS', HANDLER => \&do_idoc_inbound_process ); $iface->addTab( $it->tab("IDOC_CONTROL") ); $iface->addTab( $it->tab("IDOC_DATA") ); return $iface; } sub callback { return 1; } Running in the new environment the $rfc->accept(\&callback,10); failed: debugging it futher in the ‘Rfc.c’ program SV* my_accept( SV* sv_conn, SV* sv_docu, SV* sv_ifaces, SV* sv_saprfc ) { <snip> /* * enter main loop */ do { /* fprintf(stderr, "going to wait ...\n"); */ rc = RfcWaitForRequest(handle, wtime); /* fprintf(stderr, "done the wait: %d \n", rc); */ /* needs to get an RFC_OK or RFC_RETRY */ if (rc == RFC_RETRY){ /* do event loop callback here for interloop breakout */ /* fprintf(stderr, "got into the retry...\n"); */ rc = loop_callback(sv_callback, sv_saprfc); continue; } /* short circuit here for tRFC */ if (SvTRUE(sv_is_trfc)) { rc = RfcDispatch(handle); fprintf(stderr, "done the dispatch: %d \n", rc); continue; } It appears the the message done the dispatch: 0 (= RFC_OK) done the dispatch: 6 (= RFC_CLOSE) the (1) MISSING Function Name is: I -> 1K or sgR I think (but I’m not sure that the sv_is_trfc is calling static RFC_RC DLL_CALL_BACK_FUNCTION user_global_server(RFC_HANDLE handle) { <snip> /* check at this point for registered functions */ #ifdef SAPwithUNICODE sv_temp = u16to8((char *) funcname, strlenU(funcname) * 2); if ( ! hv_exists(p_iface_hash, SvPV(sv_temp, PL_na), SvCUR (sv_temp))) { #else if ( ! hv_exists(p_iface_hash, funcname, strlen(funcname)) ) { #endif fprintf(stderr, "the (1) MISSING Function Name is: %s -> %s\n", funcname,sv_temp); RfcRaise( handle, cU("FUNCTION_MISSING") ); /* do event callback to intertwine other events */ /* rc = loop_callback(sv_callback, sv_saprfc); */ /* XXX */ return RFC_NOT_FOUND; } /* pass in the interface to be handled */ #ifdef SAPwithUNICODE sv_iface = *hv_fetch(p_iface_hash, SvPV(sv_temp, PL_na), SvCUR (sv_temp), FALSE); #else sv_iface = *hv_fetch(p_iface_hash, funcname, strlen(funcname), FALSE); #endif The coding is compiled with UNICODE I hope that this is enough information. Any ideas why this is happening after the system upgrade. Regards, Bert Tijhuis
Hi - The most likely thing I can think of is that the upgrade will have probably upgraded the kernel to the netweaver level. When I built in the unicode support into SAP::Rfc it was was never going to be great, as the old style librfc was not written properly to cope - this is why SAP created the new libnwrfc, for which I have created the module sapnwrfc - please try porting to this. Cheers, Piers Harding.
Subject: Re: [rt.cpan.org #41210] Troubleshooting Outbound IDOCs via the SAP::RFC module
Date: Fri, 28 Nov 2008 17:01:19 +0100
To: bug-SAP-Rfc@rt.cpan.org
From: bert.tijhuis@wavin.com

Hello,
We've found out why this come.
It has to do with the SM59 flag specifying 'non unicode'.  In the old release before SP30 we find out that a certain non unicode part is called. This part was missing after the upgrade.
So we switch completely to unicode withing transaction SM59. And since then everything is working correctly.

Thanks anyway

regards, Bert Tijhuis

  Stationsplein 3
P.O. Box 173
8000 AD Zwolle
Netherlands
Bert Tijhuis 
Technical Specialist
Wavin Group IT
Direct tel:
Mobile: ++31 (06) 512 68 166
bert.tijhuis@wavin.com
www.wavin.com


"Piers Harding via RT" <bug-SAP-Rfc@rt.cpan.org>

27-11-2008 23:05

Please respond to
bug-SAP-Rfc@rt.cpan.org

To
bert.tijhuis@wavin.com
cc
Subject
[rt.cpan.org #41210] Troubleshooting Outbound IDOCs via the SAP::RFC module





<URL: http://rt.cpan.org/Ticket/Display.html?id=41210 >

Hi -

The most likely thing I can think of is that the upgrade will have
probably upgraded the kernel to the netweaver level.

When I built in the unicode support into SAP::Rfc it was was never going
to be great, as the old style librfc was not written properly to cope -
this is why SAP created the new libnwrfc, for which I have created the
module sapnwrfc - please try porting to this.

Cheers,
Piers Harding.



The information contained in this e-mail is intended solely for the addressee and as such is confidential and may legally be privileged. If you are not the intended recipient, any disclosure, copying, distribution or publishing of this information in any form is expressly prohibited and may be unlawful.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.