RFC or BAPI Returns DYNPRO_SEND_IN_BACKGROUND Exception

Problem


When calling an RFC or BAPI from NLINK, it fails and return the DYNPRO_SEND_IN_BACKGROUND exception message.

Solution

This happens when the ABAP code in the SAP system tries to interact with the user in some way. For example, it might be showing a popup or a list. If you run the same RFC or BAPI in SE37 and you get any sort of popup or list report before the normal result screen, you will run into this exception if you try to call it remotely.

With SAP-provided RFCs and BAPIs, the cause is usually some modification, e.g., a user exit, that has been added to the SAP system for the benefit of online users, where the team was unaware that it could also be executed remotely.

Also be sure to read any available documentation in the SAP system about the RFC or BAPI, as occasionally there will be a parameter you can set to suppress dialog interaction.

Dialog interaction with the user is not allowed in programmatic/remote BAPI/RFC execution.

Work with your SAP team to figure out what triggers the interaction, and how to work around or suppress it.