Skip to Content
0
Former Member
Mar 14, 2007 at 08:52 AM

Dump when run in background an ALV with splitter container

307 Views

Hi all

I have a problem when I attempt to run in background an ALV that use a splitter container. When I run this ALV in backgroung SAP return a dump with the error

" Access not possible using 'NULL' object reference" and the dump was produced in the method:

     CALL METHOD v_o_splitter->get_container
        EXPORTING
          row       = v_lcont
          column    = 1
        RECEIVING
          container = x_o_contgrid-cont.
 

I'm using the object cl_gui_splitter_container and the following code to generate the container and split it.

* Create instance for custom container
  IF v_o_container IS INITIAL.

    CREATE OBJECT v_o_container
      EXPORTING
         container_name              = c_container
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.

    IF sy-subrc <> 0.
      MESSAGE ID     sy-msgid
              TYPE   sy-msgty
              NUMBER sy-msgno
              WITH   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.


*   If both alv's have been selected an spliter object should be
*   created.
    CREATE OBJECT v_o_splitter
           EXPORTING parent = v_o_container
                     rows = v_rows
                     columns = 1
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.

    IF sy-subrc <> 0.
      MESSAGE ID     sy-msgid
              TYPE   sy-msgty
              NUMBER sy-msgno
              WITH   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    DO v_rows TIMES.

      FIND abap_true IN v_list MATCH OFFSET v_auxpos.
      CHECK sy-subrc = 0.

      v_list+v_auxpos(1) = space.
      v_aux = v_auxpos + 1.

      CALL METHOD v_o_splitter->get_container
        EXPORTING
          row       = v_lcont
          column    = 1
        RECEIVING
          container = x_o_contgrid-cont.

      CREATE OBJECT x_o_contgrid-grid
          EXPORTING
            i_parent = x_o_contgrid-cont.

      CONCATENATE 'i_alv_'      v_aux INTO x_o_contgrid-table.
      CONCATENATE 'i_catalog_'  v_aux INTO x_o_contgrid-catalog.
      CONCATENATE 'x_layout_'   v_aux INTO x_o_contgrid-layout.
      CONCATENATE 'ZHRPG007_'   v_aux INTO x_o_contgrid-structure.

      APPEND x_o_contgrid TO i_o_contgrid.

      v_lcont = v_lcont + 1.
      CLEAR x_o_contgrid.

    ENDDO.

Thanks in advance.