cancel
Showing results for 
Search instead for 
Did you mean: 

How to report failures from RfcServerFunction methods?

Former Member
0 Kudos

I'm using a plain local Rfc Server function for receiving idocs, however there does not appear to be a way to report back to the sender that the receipt failed.

   [RfcServerFunction(Name = "IDOC_INBOUND_ASYNCHRONOUS")]
public void ReceiveInboundIdocAsync(RfcServerContext context, IRfcFunction function)
{  

     throw new Exception("SM59 still reports status 3 for this idoc");

}

There is still no NCO tag available, so I am picking the closest thing - will that ever be fixed?

Accepted Solutions (0)

Answers (1)

Answers (1)

david_burg
Participant
0 Kudos

For BAPI RFCs there is the RETURN table or structure (depending how old or new the BAPI is) where error details can be populated.

For non-BAPI RFCs there is RfcAbapClassicException to raise a SYSTEM_FAILURE like

https://help.sap.com/saphelp_nw70/helpdata/EN/22/0425e0488911d189490000e829fbbd/content.htm?no_cache... documents. The NCo Server sample from SAP demonstrates that, which I saw as a C# developer and I guess the JCo would have a matching JCo Server sample with error demonstration.

Now specifically for IDoc I believe there are segments in the IDoc format to specify the status of the IDoc processing including errors. But this is at a higher level than the Java programming of the RFC server you appear to be looking at.