Skip to Content

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.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2007 at 03:28 AM

    Hi Stefan,

    Can you check the cardinality of node where you are storing the fetched data... is it 1..n then u can change it to 0..n ...

    you want to free some objects than use Clear statement..


    Anuj Goyal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 17, 2007 at 05:38 AM

    Thx 4 answer.

    the cardinality of the data node is 0..n If I want to clear the object lr_cellvar from view 1, then I receive a message ... field unknown.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Stefan Kagelmacher

      one way : -

      after data selection we can store some flag in component controller and then in wdomodifyview of view2 which is last method to be called we can change this object dynamically (hide or disable)..

      second way :- if possible call selection method of view 1 from wdomodifyview of view2 and it will return a flag for selection and accordingly you can change the object..

      third way :- if view1 is been called in last ( and you dont return to view2 in any case -- not even wdomodifyview ) in your case then pass view 2 reference to selection block and change object then



  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 09:20 AM

    Hello Stefan,

    Have you tried using the invalidate() method of if_wd_context_node for the node for which you want to clear the data?



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.