cancel
Showing results for 
Search instead for 
Did you mean: 

Access ALV from View

Former Member
0 Kudos

Hi all,

I have an alv grid in my view.

How can I access my alv control from my wddoinit method of this view?

I don't use the component SALV_WD_TABLE!!!!!!!!

The alv is fix in the view.

regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

It is a table control and not an alv.

daniel_humberg
Contributor
0 Kudos

If you want to access UI elements dynamically, the best place is WDDOMODIFYVIEW (using first_time = abap_true).

I guess that it will not be possible to get the reference to the view already in WDDOINIT.

Maybe you can just modify the context in WDDOINIT, and bind the property of the table that you want to change to the context.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Perhaps you could explain some more. What do you mean that you don't use SALV_WD_TABLE? Are you creating the component usage dynamically then? Are you resusing some other component inside your component and this inner component has an ALV? We defintely need more details about how your application is structured before any suggestions can be offered.

0 Kudos

May i ask for what purpose you want to access the Table?

I think the only way you can access any UIELements is in WDDOMODIFYVIEW.

It has a parameter FIRST_TIME.

Then you may access the element via:

DATA: lo_element type ref to IF_WD_VIEW_ELEMENT,
      lo_alv type ref to YOUR_TYPE.

lo_element = VIEW->GET_ELEMENT( 'NAME OF YOUR ALV' ).
try.
lo_alv ?= lo_element.
lo_alv->do_whatever
ENDTRY.

Edited by: Dominik Keil on Oct 20, 2009 11:23 AM