If the called RFC does in turn execute a batch input (BTCI), then the typical cause for failure is missing data, that causes to display a screen which is not foreseen in your processing scenario. If the RFC is a self-written one, let it execute with BTCI mode A and watch for screens, where the OK-Code is "blank". This is then a screen, which is not in the expected sequence. You may circumvent the malfunction by adding additional logic to catch these cases. Also, you should execute the BTCI in mode N to catch all messages in a table (CALL TRANSACTION ... MESSAGES bdcmesstab).
If the RFC is a standard function, you may have chance in providing additional data or changing the customizing for your application.
This was first published in May 2003