‎2009 Jul 06 3:34 PM
Hi Experts,
I have created one report which is calling the "HRASR_TEST_PROCESS" (HR form process) thru BDC.
Its running fine while executing via SE38 (foreground) but getting dump while executing from the background with same variant.
The dump is follows,
Short Text
Exception condition "CNTL_ERROR" raised.
ERROR ANALYSIS
A RAISE statement in the program "CL_GUI_CUSTOM_CONTAINER=======CP" raised the exception condition "CNTL_ERROR". Since the exception was not intercepted by a superior program, processing was terminated.
Line Source Code
32 WHEN 1.
33 RAISE CNTL_SYSTEM_ERROR.
34 WHEN 2.
35 RAISE CNTL_ERROR.
36 WHEN 3.
37 class cl_gui_cfw definition load.
38 message id 'DC' type 'W' number cl_gui_cfw=>reason_no_init
39 raising create_error.
40 WHEN 4.
41 RAISE LIFETIME_ERROR.
42 WHEN 5.
43 RAISE LIFETIME_DYNPRO_DYNPRO_LINK.
44 WHEN OTHERS.
45 RAISE CNTL_ERROR.
46 ENDCASE.
47
48 m_container_type = CONTAINER_TYPE_CUSTOM.
49
50 CALL METHOD SET_VISIBLE
51 EXPORTING
52 VISIBLE = '1'
53 EXCEPTIONS
54 CNTL_SYSTEM_ERROR = 1
55 CNTL_ERROR = 2.
56
57 CASE SY-SUBRC.
58 WHEN 0.
59 WHEN 1.
60 RAISE CNTL_SYSTEM_ERROR.
61 WHEN 2.
>>>>> RAISE CNTL_ERROR.
63 WHEN OTHERS.
64 RAISE CNTL_ERROR.
65 ENDCASE.
66
67 m_name = container_name.
68 call method set_window_property
69 exporting property_id = property_name
70 value = m_name
71 keep_cache = 'X'
72 exceptions others = 1.
73 if sy-subrc ne 0.
74 clear m_name.
75 raise cntl_error.
76 endif.
77
78 CALL METHOD ME->REGISTER_CACHED_W_PROPERTY
79 EXPORTING
80 PROPERTY_ID = property_height
81 EXCEPTIONSKindly let me know, what is the problem and how can i solve it.
Thanks in advance.
Regards,
Harish
‎2009 Jul 06 3:38 PM
Hi,
Does the transaction contain any object oriented grid or OOPs object?
In that case it will not run in background.
regards,
Ankur Parab
Edited by: Ankur Parab on Jul 6, 2009 8:08 PM
‎2009 Jul 06 3:38 PM
Hi,
Does the transaction contain any object oriented grid or OOPs object?
In that case it will not run in background.
regards,
Ankur Parab
Edited by: Ankur Parab on Jul 6, 2009 8:08 PM
‎2009 Jul 06 3:41 PM
In addition to Ankar, who explained it actually very clear, whenever you are using these containers for displaying 'any' kind of Enjoy SAP (GUI) Control you can only use them in foreground. This is because these containers are created on a screen (DYNPRO), and in background screens can 'not be processed'.
‎2009 Jul 07 10:06 AM
Hi Micky,
Thanks for your instant reply and the error has been raised from the standard report while executing as a background scheduled job .
How can we solve this problem to use GUI in the background?
Regards,
Harish
‎2009 Jul 06 3:41 PM
SEE NOTE Note 774172 - Runtime error when started in background
‎2009 Jul 06 3:42 PM
Hi,
If you are uploading any file from presentation server or the PC then it will not work in back ground.
Regards,
Himanshu Verma
‎2009 Jul 06 3:45 PM
This is because your program is calling SAP Controls ( ALV Grid, ALV Tree's etc) which runs fine on foreground and cause error when running on background. You can resolve this by looking at other alternative such as
FM's or BAPI's to achieve the functionality.
Edited by: Karthik on Jul 6, 2009 4:49 PM
‎2009 Jul 07 10:19 AM
Hi Harish,
The exception 'CNTL_ERROR' was raised and the calling program did not catch the exception, due to this you have dump.
In you program use the TRY-CATCH block. in the CATCH catch the exception 'CNTL_ERROR' (CATCH CNTL_ERROR) and log the information or display the information. Since you are getting this problem in the backgound it's better you catch the exception and log it.
Regards,
George
‎2009 Jul 07 12:57 PM
Hai George,
The problem is from standard program. Actually we are using the call transaction, during that some standard report is giving this dump. We cant change the standard report. Our real problem is to execute that report from background which is not happening because of some GUI issues. We are not getting, how to solve the problem. As it is running fine in foreground.
Regards,
Harish
‎2009 Jul 07 1:56 PM
Hi Harish ,
Instead of call transaction , use sessions instead
‎2012 Jul 26 12:01 PM
Hello Harish,
Have you been able to solve this problem? About running a program in BG?
Thanks
‎2012 Jul 27 3:33 PM
Hello Zhou,
a program that uses controls or frontend services like GUI-Upload/Download cannot be used in the background: These items require a connection to a frontend PC, which is not available in a background job.
The solution is to rewrite the program in such a way that it works without controls and without GUI-up/download.
Regards,
Rüdiger
‎2012 Jul 27 6:10 PM
Hello Rüdiger,
I've figured out that it was caused by ALV controls. I was hoping for an easy fix to this problem, something SAP provides so I don't have to change too much.
In the meanwhile, I've created a workaround for running this in the background by clearing a flag in a FM.
Best regards,
Zhou
‎2012 Jul 27 9:40 PM
Hello Zhou,
indeed, as you mention the ALV grid, there are some workarounds in the system, but there is no global solution. For example, the function module REUSE_ALV_GRID_DISPLAY detects internally whether it is called in background mode, and in this case it forwards the call to REUSE_ALV_LIST_DISPLAY which is runnable in background mode, since it creates an ABAP list.
But normally, when using objects of the control framework in your program, you are restricted to dialog mode.
Kind regards,
Rüdiger