Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dump while executing the report in the background!!!

Former Member
0 Likes
7,494

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	    EXCEPTIONS

Kindly let me know, what is the problem and how can i solve it.

Thanks in advance.

Regards,

Harish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,699

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

13 REPLIES 13
Read only

Former Member
0 Likes
3,700

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

Read only

Sm1tje
Active Contributor
0 Likes
3,699

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'.

Read only

Former Member
0 Likes
3,699

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

Read only

Former Member
0 Likes
3,699

SEE NOTE Note 774172 - Runtime error when started in background

Read only

Former Member
0 Likes
3,699

Hi,

If you are uploading any file from presentation server or the PC then it will not work in back ground.

Regards,

Himanshu Verma

Read only

SG141
Active Participant
0 Likes
3,699

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

Read only

Former Member
0 Likes
3,699

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

Read only

0 Likes
3,699

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

Read only

0 Likes
3,699

Hi Harish ,

Instead of call transaction , use sessions instead

Read only

Former Member
0 Likes
3,699

Hello Harish,

Have you been able to solve this problem? About running a program in BG?

Thanks

Read only

0 Likes
3,699

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

Read only

0 Likes
3,699

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

Read only

0 Likes
3,699

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