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

Problem with ALV 00

0 Likes
2,818

Hi Guys,

i have a problem of randomic dump with ALV OO. In some cases works without problem and in other case i can have 2 type of dumps:

Dump1

Categoria Errore di programm. ABAP Err. run-time MESSAGE_TYPE_X Progr. ABAP CL_GUI_DATAMANAGER============CP Anwendungskomponente BC-FES-GUI Data e ora 27.03.2020 09:33:05

Dump2

Categoria Errore di programm. ABAP Err. run-time RAISE_EXCEPTION Progr. ABAP CL_GUI_DATAPONDEMAND==========CP Anwendungskomponente BC-FES-GUI Data e ora 27.03.2020 08:36:26

Below the trace for both:

(Error)(27.03.20 08:53:30.886): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 08:55:02.237): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 09:33:04.955): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error

(Error)(27.03.20 08:30:23.797): CALL METHOD "InsertPacket"[DispID=7] OF [#28/0x0AE902AC/101/SAP.DataPOnDemand.1] #0: LONG "820" #1: OBJECT [#-1] IDispatch::Invoke raised exceptionException occurred (Error) : (Error) : *****************************ERROR OCCURED IN MODULE: [SAPDataPOnDemand Class]******************************************************************************************************************* (Error) : PROGRAM_ID |MODULE_NAME |METHOD_NAME |ERROR DESCRIPTION |VERSION |GUI VERSION |MODULE_PATH | (Error) : ************************************************************************************************************************************************************************************************* (Error) : SAP.DataPOnDemand.1 |SAPDataPOnDemand Class |InsertPacket |Invalid index. |7500.1.3.214 |7500.1.3.1138 |c:\program files (x86)\sap\frontend\sapgui\sapdpcts.ocx | (Error) : ************************************************************************************************************************************************************************************************* (Error) : (Error) : Exception fire by : (Error) : Exception info:Invalid index. (Error) : Exception code:0 (Error)(27.03.20 08:30:23.875): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 08:36:26.601): CALL METHOD "InsertPacket"[DispID=7] OF [#16/0x0AC176F4/0/SAP.DataPOnDemand.1] #0: LONG "820" #1: OBJECT [#-1] IDispatch::Invoke raised exceptionException occurred (Error) : (Error) : *****************************ERROR OCCURED IN MODULE: [SAPDataPOnDemand Class]******************************************************************************************************************* (Error) : PROGRAM_ID |MODULE_NAME |METHOD_NAME |ERROR DESCRIPTION |VERSION |GUI VERSION |MODULE_PATH | (Error) : ************************************************************************************************************************************************************************************************* (Error) : SAP.DataPOnDemand.1 |SAPDataPOnDemand Class |InsertPacket |Invalid index. |7500.1.3.214 |7500.1.3.1138 |c:\program files (x86)\sap\frontend\sapgui\sapdpcts.ocx | (Error) : ************************************************************************************************************************************************************************************************* (Error) : (Error) : Exception fire by : (Error) : Exception info:Invalid index. (Error) : Exception code:0 (Error)(27.03.20 08:36:26.648): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error

My code:

CREATE OBJECT o_docking

EXPORTING

ratio = '95'

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

IF sy-subrc EQ 0.

**Split del container

CREATE OBJECT o_split

EXPORTING

parent = o_docking

sash_position = 20 "Position of Splitter Bar (in Percent)

with_border = 0. "With Border = 1 Without Border = 0

o_top_container = o_split->top_left_container .

o_bottom_container = o_split->bottom_right_container .

**Creazione dell'alv

CREATE OBJECT l_ref_alv

EXPORTING

i_parent = o_bottom_container.

**Creazione del documento

CREATE OBJECT o_document

EXPORTING

style = 'ALV_GRID'.

PERFORM manage_top_of_page.

CREATE OBJECT g_event_receiver.

SET HANDLER g_event_receiver->handle_toolbar FOR l_ref_alv.

SET HANDLER g_event_receiver->handle_user_command FOR l_ref_alv.

SET HANDLER g_event_receiver->handle_hotspot FOR l_ref_alv.

CALL METHOD l_ref_alv->set_table_for_first_display

EXPORTING

i_save = l_save

is_variant = s_variant

is_layout = l_slayout

it_toolbar_excluding = l_toolbar_ex

CHANGING

it_outtab = l_it_output

it_fieldcatalog = l_it_field

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

ENDIF.

Someone has suggestion for me?

thanks a lot.

Hi Guys,

i have a problem of randomic dump with ALV OO. In some cases works without problem and in other case i can have 2 type of dumps:

Dump1

Categoria Errore di programm. ABAP Err. run-time MESSAGE_TYPE_X Progr. ABAP CL_GUI_DATAMANAGER============CP Anwendungskomponente BC-FES-GUI Data e ora 27.03.2020 09:33:05

Dump2

Categoria Errore di programm. ABAP Err. run-time RAISE_EXCEPTION Progr. ABAP CL_GUI_DATAPONDEMAND==========CP Anwendungskomponente BC-FES-GUI Data e ora 27.03.2020 08:36:26

Below the trace for both:

(Error)(27.03.20 08:53:30.886): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 08:55:02.237): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 09:33:04.955): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error

(Error)(27.03.20 08:30:23.797): CALL METHOD "InsertPacket"[DispID=7] OF [#28/0x0AE902AC/101/SAP.DataPOnDemand.1] #0: LONG "820" #1: OBJECT [#-1] IDispatch::Invoke raised exceptionException occurred (Error) : (Error) : *****************************ERROR OCCURED IN MODULE: [SAPDataPOnDemand Class]******************************************************************************************************************* (Error) : PROGRAM_ID |MODULE_NAME |METHOD_NAME |ERROR DESCRIPTION |VERSION |GUI VERSION |MODULE_PATH | (Error) : ************************************************************************************************************************************************************************************************* (Error) : SAP.DataPOnDemand.1 |SAPDataPOnDemand Class |InsertPacket |Invalid index. |7500.1.3.214 |7500.1.3.1138 |c:\program files (x86)\sap\frontend\sapgui\sapdpcts.ocx | (Error) : ************************************************************************************************************************************************************************************************* (Error) : (Error) : Exception fire by : (Error) : Exception info:Invalid index. (Error) : Exception code:0 (Error)(27.03.20 08:30:23.875): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error (Error)(27.03.20 08:36:26.601): CALL METHOD "InsertPacket"[DispID=7] OF [#16/0x0AC176F4/0/SAP.DataPOnDemand.1] #0: LONG "820" #1: OBJECT [#-1] IDispatch::Invoke raised exceptionException occurred (Error) : (Error) : *****************************ERROR OCCURED IN MODULE: [SAPDataPOnDemand Class]******************************************************************************************************************* (Error) : PROGRAM_ID |MODULE_NAME |METHOD_NAME |ERROR DESCRIPTION |VERSION |GUI VERSION |MODULE_PATH | (Error) : ************************************************************************************************************************************************************************************************* (Error) : SAP.DataPOnDemand.1 |SAPDataPOnDemand Class |InsertPacket |Invalid index. |7500.1.3.214 |7500.1.3.1138 |c:\program files (x86)\sap\frontend\sapgui\sapdpcts.ocx | (Error) : ************************************************************************************************************************************************************************************************* (Error) : (Error) : Exception fire by : (Error) : Exception info:Invalid index. (Error) : Exception code:0 (Error)(27.03.20 08:36:26.648): "FreeObject" #0: OBJECT [#-1] unable to free handle -1; this is an ABAP programming error

My code:

CREATE OBJECT o_docking

EXPORTING

ratio = '95'

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

IF sy-subrc EQ 0.

**Split del container

CREATE OBJECT o_split

EXPORTING

parent = o_docking

sash_position = 20 "Position of Splitter Bar (in Percent)

with_border = 0. "With Border = 1 Without Border = 0

o_top_container = o_split->top_left_container .

o_bottom_container = o_split->bottom_right_container .

**Creazione dell'alv

CREATE OBJECT l_ref_alv

EXPORTING

i_parent = o_bottom_container.

**Creazione del documento

CREATE OBJECT o_document

EXPORTING

style = 'ALV_GRID'.

PERFORM manage_top_of_page.

CREATE OBJECT g_event_receiver.

SET HANDLER g_event_receiver->handle_toolbar FOR l_ref_alv.

SET HANDLER g_event_receiver->handle_user_command FOR l_ref_alv.

SET HANDLER g_event_receiver->handle_hotspot FOR l_ref_alv.

CALL METHOD l_ref_alv->set_table_for_first_display

EXPORTING

i_save = l_save

is_variant = s_variant

is_layout = l_slayout

it_toolbar_excluding = l_toolbar_ex

CHANGING

it_outtab = l_it_output

it_fieldcatalog = l_it_field

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

ENDIF.

Someone has suggestion for me?

thanks a lot.

9 REPLIES 9
Read only

venkateswaran_k
Active Contributor
0 Likes
2,549

Hi

Please make sure whenever you create object, check for existence. If not exists only then create the object. Add appropriate if statements and check if still dumps appear.

Regards,

Venkat

Read only

0 Likes
2,549

Hi venkateswaran.k

if you refer to creation of object o_docking yes there is the if in the code, i not copied in the post.

thanks.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,549

Please explain the scenario to reproduce the issue, and tell us at what line of code you have the issue.

Read only

0 Likes
2,549

Hi have a report that use ALV OO and in some cases dumps. It is not simple reproduce it, it is the first time for me that i have this dump.

the problem is on standard FM AC_SYSTEM_FLUSH

20 sy-subrc = sysubrc.

21

22 CASE SY-SUBRC.

23 WHEN 0.

24 WHEN 1.

25 * system_error

26 MESSAGE ID 'CNDP' TYPE 'X' NUMBER 007 RAISING CNTL_SYSTEM_ERROR.

27 WHEN 2.

28 * method_call_error

>>>>> MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

30 WHEN 3.

31 * property_set_error

32 MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

33 WHEN 4.

34 * property_get_error

35 MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.

36 WHEN 8.

37 * maximal number of modi reached

38 MESSAGE ID 'CNDP' TYPE 'X' NUMBER 011 RAISING CNTL_SYSTEM_ERROR.

39 WHEN OTHERS.

40 RAISE CNTL_ERROR.

41 ENDCASE.

42

43 ENDFUNCTION.

Read only

former_member1716
Active Contributor
0 Likes
2,549

leo.ierardi,

Before we get into the issue in deep, i would recommend you to at-least do the following steps from your end.

--> Explain the business requirement, what you are trying to achieve through this development. This will also pave way for better solutions from experts.

--> In debugging mode try to understand what is the difference in data volume and execution sequence between both positive and negative scenario. This will help reducing half of the open points. This also may help you in understanding the issue better.

---> I suspect the docking ratio is not right with respect to the data that is being dealt.

--> Please paste the code using CODE button available.

Regards!

Read only

venkateswaran_k
Active Contributor
0 Likes
2,549

Dear Leo,

The dump messages refer to the object referenes...

""FreeObject" #0: OBJECT [#-1] unable to free handle -1;"..

So,

1. Please verify for all the object creation, make sure you added the If condition for the existence.

2. Make sure if you are suing sort in ALV, then that column is included in the field catalog.

3. Check if any negative amount / bigger amount / divide by zero in data or while processing.

Regards,

Venkat

Read only

0 Likes
2,549

Hi,

i don't use SORT and i haven't negative amount. The same table in debug mode using the display ALV mode works.

thanks.

Read only

0 Likes
2,549

@satishkumarbalasubramanian

Hi,

the requirement is copy an old program that display WBS and Work order data, adding some info.

In debug i can see using ALV the internal table, but in foreground no.

Below my code:

***extaction data form


*** display result
CALL SCREEN 9000.
****
dynrpro 9000:
PROCESS BEFORE OUTPUT. 
MODULE status_9000. 
PROCESS AFTER INPUT. 
MODULE user_command_9000.


***
MODULE status_9000 OUTPUT.
  SET PF-STATUS 'STATUS9000'.
  PERFORM set_ztitle CHANGING var1 var2 var3 var4.
  SET TITLEBAR 'ZTITLE' WITH var1 var2 var3 var4.


  IF sy-batch  IS INITIAL.
    PERFORM exclude_button_003 CHANGING it_toolbar_excluding.
  ENDIF.
  PERFORM build_fieldcatalog  USING   'zsps_esri_fcat_new'
                              CHANGING l_it_fcat.
  PERFORM change_fieldcatalog  USING     'zsps_esri_fcat_new'
                               CHANGING l_it_fcat.
  PERFORM display_alv USING t_esri_out[]
                            it_toolbar_excluding
                            g_save                  
                            'Risultato ricerca'(141) 
                            l_it_fcat
                            l_ref_alv.
ENDMODULE.                 " STATUS_9000  OUTPUT

FORM set_ztitle  CHANGING p_var1
                          p_var2
                          p_var3
                          p_var4.
  DATA: title(100) TYPE c.
  SELECT SINGLE value INTO title
    FROM ztps_param
    WHERE repid  = sy-repid
    AND   object = 'DYNPRO_TITLE'.
  p_var1 = title(35).
  p_var2 = title+35(40).
  p_var3 = title+80(20).
ENDFORM.                   

FORM exclude_button_003  CHANGING l_toolbar_ex TYPE ui_functions.


  PERFORM pass_fields USING: 'mc_fc_graph'      CHANGING l_toolbar_ex,
                             'mc_fc_print_back' CHANGING l_toolbar_ex,
                             'mc_mb_view'       CHANGING l_toolbar_ex,
                             'mc_fc_detail'     CHANGING l_toolbar_ex,
                             'mc_fc_info'       CHANGING l_toolbar_ex,
                             'MC_FC_CHECK'      CHANGING l_toolbar_ex,
                             'MC_FC_REFRESH'    CHANGING l_toolbar_ex,
                             'MC_FC_LOC_CUT'    CHANGING l_toolbar_ex,
                             'MC_FC_LOC_PASTE'  CHANGING l_toolbar_ex,
                             'MC_FC_LOC_COPY'   CHANGING l_toolbar_ex,
                             'MC_FC_LOC_UNDO'   CHANGING l_toolbar_ex,
                             'MC_FC_LOC_DELETE_ROW'   CHANGING l_toolbar_ex,
                             'MC_FC_LOC_INSERT_ROW'   CHANGING l_toolbar_ex,
                             'MC_FC_LOC_PASTE_NEW_ROW' CHANGING l_toolbar_ex,
                             'MC_FC_LOC_COPY_ROW'      CHANGING l_toolbar_ex,
                             'MC_FC_LOC_APPEND_ROW'    CHANGING l_toolbar_ex.




ENDFORM.                  
*&---------------------------------------------------------------------*
FORM build_fieldcatalog  USING i_structure_name	 TYPE dd02l-tabname
                      CHANGING l_it_fieldcatalog TYPE lvc_t_fcat.
  REFRESH l_it_fieldcatalog.
  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name = i_structure_name
    CHANGING
      ct_fieldcat      = l_it_fieldcatalog
    EXCEPTIONS
      INCONSISTENT_INTERFACE
      PROGRAM_ERROR .
ENDFORM.                   
*&---------------------------------------------------------------------*
FORM change_fieldcatalog  USING    i_structure_name   TYPE dd02l-tabname
                          CHANGING l_it_fieldcatalog TYPE lvc_t_fcat.




  FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
  DATA: color_curr_quan(4) TYPE c,
        color_all(4)       TYPE c.
  DATA: ls_fcat TYPE lvc_s_fcat.


  PERFORM color-exstract CHANGING color_curr_quan
                                  color_all.


  IF i_structure_name = 'zsps_esri_fcat_new'. 
    PERFORM modify_fieldcat_new CHANGING l_it_fieldcatalog.
  ENDIF.


  LOOP AT l_it_fieldcatalog ASSIGNING <fcat>.
    CASE <fcat>-fieldname.
      WHEN 'CHECKBOX'.
        <fcat>-scrtext_l = ' '.
        <fcat>-scrtext_m = ' '.
        <fcat>-scrtext_s = ' '.
        <fcat>-checkbox  = 'X'.
        <fcat>-edit      = 'X'.
        <fcat>-outputlen = 7.
        <fcat>-just      = 'C'.
        <fcat>-tech    = abap_true.                        
      WHEN 'LAVORO'.
        <fcat>-edit_mask = '==ALPHA'.
      WHEN 'QMNUM'.
        <fcat>-hotspot = abap_true.
    ENDCASE.
    IF <fcat>-inttype = 'P'.
      <fcat>-emphasize = color_curr_quan.
    ELSEIF <fcat>-inttype <> 'P' AND <fcat>-checkbox  <> 'X'.
      <fcat>-emphasize = color_all.
    ENDIF.
    IF <fcat>-intlen <= 5.
      <fcat>-just      = 'C'.
    ENDIF.
  ENDLOOP.


  IF NOT sy-batch  IS INITIAL.
    DELETE l_it_fieldcatalog  WHERE fieldname = 'CHECKBOX'.
  ENDIF.
ENDFORM.                    
*&---------------------------------------------------------------------*
FORM display_alv  USING l_it_output  TYPE STANDARD TABLE
                        l_toolbar_ex TYPE ui_functions
                        l_save       TYPE c
                        grid_title
                        l_it_fcat    TYPE lvc_t_fcat
                        l_ref_alv    TYPE REF TO cl_gui_alv_grid.


  PERFORM build_layout USING l_slayout
                             'LINECOLOR'
                             'CELLCOLORS'
                             'CELLTAB'
                             grid_title  
                             l_it_fcat
                             ' '.         


  PERFORM init_alv CHANGING l_ref_alv.


  PERFORM output_alv USING l_ref_alv
                           l_it_fcat
                           l_slayout
                           l_it_output
                           l_toolbar_ex
                           l_save.
ENDFORM.                    " DISPLAY_ALV
*&---------------------------------------------------------------------*
FORM build_layout  USING layout TYPE lvc_s_layo
                         fieldcolor
                         ctab_fname
                         stylefname
                         gridtitle
                         t_fcat TYPE lvc_t_fcat
                         no_rowmark.




  layout-grid_title = gridtitle.
  layout-no_rowmark = no_rowmark.
  layout-info_fname = fieldcolor.
  layout-ctab_fname = ctab_fname.
  layout-stylefname = stylefname.




ENDFORM.                    
*&---------------------------------------------------------------------*
FORM init_alv CHANGING l_ref_alv TYPE REF TO cl_gui_alv_grid.
  IF sy-batch  IS INITIAL.


    CREATE OBJECT o_docking
      EXPORTING
        ratio                       = '95'
      EXCEPTIONS
        cntl_system_error           = 1
        cntl_error                  = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5.
		
    IF sy-subrc EQ 0.


      CREATE OBJECT o_split
        EXPORTING
          parent        = o_docking
          sash_position = 20 
          with_border   = 0. 
      o_top_container = o_split->top_left_container .
      o_bottom_container = o_split->bottom_right_container .


      CREATE OBJECT l_ref_alv
        EXPORTING
          i_parent = o_bottom_container.
		  
      CREATE OBJECT o_document
        EXPORTING
          style = 'ALV_GRID'.


      PERFORM manage_top_of_page.
    ENDIF.
  ELSE.
    CREATE OBJECT l_ref_alv
      EXPORTING
        i_parent = cl_gui_container=>screen0.
  ENDIF.
ENDFORM.                  
*&---------------------------------------------------------------------*
FORM output_alv  USING l_ref_alv    TYPE REF TO cl_gui_alv_grid
                       l_it_field   TYPE lvc_t_fcat
                       l_slayout    TYPE lvc_s_layo
                       l_it_output  TYPE STANDARD TABLE
                       l_toolbar_ex TYPE ui_functions
                       l_save       TYPE c.




  CHECK l_ref_alv IS NOT INITIAL.
  IF sy-batch  IS INITIAL.


    IF  g_event_receiver IS INITIAL.
      CREATE OBJECT g_event_receiver.
      SET HANDLER   g_event_receiver->handle_toolbar       FOR l_ref_alv.
      SET HANDLER   g_event_receiver->handle_user_command  FOR l_ref_alv.
      SET HANDLER   g_event_receiver->handle_hotspot       FOR l_ref_alv.
    ENDIF.
  ENDIF.


  SELECT SINGLE * FROM ztps_param
    WHERE repid = sy-repid
    AND   uname = sy-uname
    AND   object = 'SAVE_VAR'.
  IF sy-subrc = 0.
    l_save = 'A'.
  ELSE.
    l_save = 'U'.
  ENDIF.


  CALL METHOD l_ref_alv->set_table_for_first_display
    EXPORTING
      i_save                        = l_save
      is_variant                    = s_variant
      is_layout                     = l_slayout
      it_toolbar_excluding          = l_toolbar_ex
    CHANGING
      it_outtab                     = l_it_output
      it_fieldcatalog               = l_it_field
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.


ENDFORM.                   


*&---------------------------------------------------------------------*
CLASS gcl_event_receiver DEFINITION.
  PUBLIC SECTION.
    METHODS:
    handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING e_object,


    handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING e_ucomm,




    handle_hotspot FOR EVENT hotspot_click OF cl_gui_alv_grid
             IMPORTING e_row_id e_column_id es_row_no.
  PRIVATE SECTION.
ENDCLASS.                    


CLASS gcl_event_receiver IMPLEMENTATION.
  METHOD handle_toolbar.
    PERFORM set_toolbar USING e_object.
  ENDMETHOD.                   "hotspot_click
  METHOD handle_user_command.
    CASE e_ucomm.
      WHEN 'DETT'.
        PERFORM call_detail.
      when 'NOTE'.
        PERFORM f_nota.
    ENDCASE.
  ENDMETHOD.  "handle_user_command
  METHOD handle_hotspot.
    PERFORM f_event_hotspot  USING e_row_id
                                   e_column_id
                                   es_row_no.
  ENDMETHOD.                    
ENDCLASS.                   


DATA: g_event_receiver  TYPE REF TO gcl_event_receiver.




Read only

Sandra_Rossi
Active Contributor
0 Likes
2,549

Unfortunately, if you're not able to reproduce and if you don't provide a minimal verifiable code, we can't reproduce, debug and solve.