Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

CNTL_ERROR while running a custom report program in background mode

$
0
0

Hi,

I am running a report in background on daily basis. I am using cl_gui_custom_container class here and calling the constructor of this class. I am getting a CNTL_ERROR exception at this point. But if i run the same report directly, it is not throwing any exception. The problem is if i schedule it to background. I am not able to sort it out.

I've written the following code below:

 

I did apply the logic that you'd mentioned.

I've implemented the code as below.

 

IF  gr_container IS INITIAL.

*** Check whether the program is run in batch or foreground

   
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.

* Run in foreground

     
CREATE OBJECT gr_container

       
EXPORTING

          container_name
= 'WORK_AREA_CONTAINER'.

     
CREATE OBJECT lv_grid

       
EXPORTING I_PARENT = gr_container.

   
ELSE.

* Run in background

     
CREATE OBJECT lv_grid

       
EXPORTING

          I_PARENT
= gr_dockcontainer.

     
ENDIF.

     
ENDIF.

 

 

 

i_parent_control = gr_dockcontainer.



       
CREATE OBJECT m_base_splitter

       
EXPORTING

          parent           
= i_parent_control

         
ROWS              = 1

          columns          
= 2

       
EXCEPTIONS

          cntl_error       
= 1

          cntl_system_error
= 2

         
OTHERS            = 3.



       
CALL METHOD m_base_splitter->get_container

       
EXPORTING

          row      
= 1

          column   
= 2

          RECEIVING

          container
= m_splitter_right_part

       
EXCEPTIONS

         
OTHERS    = 1.

 

 

After I've implemented the above code I'm getting the following error in the batch job:

 

Category               ABAP Programming Error

Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED

Except.                CX_SY_REF_IS_INITIAL

 

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "M_BASE_SPLITTER").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

 

Would you be able to help me in the above issue?

 

Regards,

Mandeep


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>