How to handle DUMP : DYNPRO_SEND_IN_BACKGROUND
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.
What if a normal (read: dialog) user schedules the background job? I don't think this check is going to work.
Can we not use:
as an alternative to check if the GUI is available for the pop-up to be displayed.
Hi Suhas,
Thanks for your inputs.
I had faced this issue in User Exit and BADIs of Sales Order and Purchase Order. So, user scheduling a job won't be applicable in this case.
But yes, to make this more robust, we should check sy-batch and cl_salv_model=>is_offline(). What you told is absolutely correct in case of background jobs
Both SY-BATCH & CL_SALV_MODEL=>IS_OFFLINE( ) are 'X' in background job.
But my concern is also with Inbound IDOC and RFC call. What will be the value of SY-BATCH & CL_SALV_MODEL=>IS_OFFLINE( ) is these two cases ?
I would have checked these before thinking of other alternatives.
Honestly, i have no idea about what values these will return. You should check those.
I believe FM SAPGUI_PROGRESS_INDICATOR handles most of the cases including RFC call. Have a look at the code in this FM.
There is a lot to learn from the FM you mentioned. I have used this FM in many reports but never checked it's code. 😛
Thanx a lot Rudra..... 🙂