BACKGROUND
DUMP : DYNPRO_SEND_IN_BACKGROUND
We may get the above mentioned DUMP in case of Inbound IDOC / RFC Call / Background Job.
These inbound IDOC / RFC Call / Background Job may be used for creation of some documents like Invoice, Sales Order or Purchase Order.
Now we might have made some extra Z enhancement in user exits or BADIs where you have used a POP-UP screen for some sort of user confirmation. For Example, we frequently use FM "POPUP_TO_CONFIRM" for this. Or may be we have called a screen which requires some user actions(inputs).
When a screen which requires an input is called in background, the system gives the above mentioned DUMP. This happens because there is no user connection in case of inbound IDOC / RFC Call / Background Job. The inbound IDOC was may be triggered from a 3rd Party Non-SAP System or the RFC Call was made from a different System.
You will get a DUMP like this:
HOW TO HANDLE THIS SITUATION
While providing any POP-UP screen, we need to check the User Type.
We may follow the steps below:
1) We will get the user ID in this variable sy-uname.
2) There is a table USR02 where we will find logon details of any user.
3) There is a field USTYP, which will tell us what kind of user it is.
Below are the possible type of users.
We can put a simple code to check what kind of user it is. If it is a Dialog User(A), then only provide the POP-UP screen or else don't. We can handle the action automatically with some logic according to the requirement.
We can also create a function module which you can just call when needed. Refer below Picture.