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