Skip to Content
Sep 16, 2007 at 07:28 AM

Access to one object from a foreign view



I have a small WD application. There are 2 views: view 1 = data selection after pushing a button via select-options, view 2 = display data via alv.

in view 2 I want to display a text_view emphasized. so I did this in method WDDOINIT:

  LOOP AT lt_columns INTO ls_column.
    lr_column = ls_column-r_column.
    CASE ls_column-id.
        lr_column_header->set_image_source( 'ICON_DATE' ).
        lr_column_header->set_image_first( abap_true ).
        lr_column_header->set_text( 'Meldungsstand' ).
        lr_column_header->set_tooltip( 'Meldungsstand' ).
        lr_column->set_width( '1' ).
        CREATE OBJECT lr_cellvar.
        lr_cellvar->set_key( 'TEXT_VIEW' ).

        CREATE OBJECT lr_text_field.
        lr_text_field->set_text_fieldname( 'ANWSTAND' ).
        lr_text_field->set_design( '00' ).
        lr_text_field->set_semantic_color( '04' ).
        lr_cellvar->set_editor( lr_text_field ).
        lr_column->add_cell_variant( lr_cellvar ).
        lr_column->set_selected_cell_variant( 'TEXT_VIEW' ).
  MODIFY ...

The data selection is realized in view 1 after pushing a button. Is the selection successfully, everything is good. But if the selection delivers no hits from database, the application dumps with ZNULL acess.

how can I free / delete / hide the two objects lr_cellvar and lr_text_field in view 2.

many thx and best regards.