Skip to Content
avatar image
Former Member

How to report failures from RfcServerFunction methods?

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 06 at 05:46 AM

    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 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.

    Add comment
    10|10000 characters needed characters exceeded