cancel
Showing results for 
Search instead for 
Did you mean: 

Use ALV in view - how to map interfacecontroller directlyto view controller

Former Member
0 Kudos

I am trying to embed an ALV table in a view, by inserting it inside a viewcontainerUIelement. My problem is I do not use the Componentcontroller context; instead I rely on an assistance class for storing data, and have defined a context for the view only.

All examples I see so far refer to using the Componentcontroller to map the data from the context to the ALV table. When I try to assign the controller usage to my ALV, I expand the Component Usages node, then double-click the Interfacecontroller_usage node. Here, unfortunately, when clicking "Controller Usage", I am only able to see components from the Componentcontroller, not from my local view... and since I inist on using only the view's own controller, I cannot define the use of my ALV component.

Do I have to resort to using the componentcontroller to store the node for my ALV table? This could be amazingly inefficient in an app where you have a number of views, each with their own ALV tables.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

you can do that in your view properties. add ALV controllers(component usage and interface controller ) to your view.

Now you can map the context node of ALV data to your view node.

You can also call the set_model( ) method of the alv interface controller and bind your view node to that.

Former Member
0 Kudos

Hi,

already did, but the problem is now that when I define the mapping between my existing node in the view's context and the "Data" node of the Interfacecontroller, all my fields disappear. My view context node becomes "empty". I can no longer define a dictionary structure for it - do I have to do this somewhere in the interfacecontroller?

If i resort to defining my node containing the table fields in the Componentcontroller, it all works flawlessly. The problem seems to be that the "component usages" mapping doesn't like it when the component controller is not used...

Former Member
0 Kudos

hi,

you are doing it wrong. you need to do a external context mapping view -> alv

i take that statement back. For your case , you have only one choice of using set_data method

lo_nd_gen_tab = wd_context->get_child_node( name = `DYNAMIC_TBL` ).
    lo_interfacecontroller =   wd_this->wd_cpifc_usage_alv( ).

    lo_interfacecontroller->set_data(
*             only_if_new_descr =                 " wdy_boolean
      r_node_data =  lo_nd_gen_tab                     " ref to if_wd_context_node
    ).

Edited by: Baskaran Senthivel on Dec 9, 2010 3:34 PM

Former Member
0 Kudos

The issue is that whenever I try to define the external mapping. I cannot see anything but whichever nodes are defined in the context of the componentcontroller. And, since I'm not using it, I have no options for mapping anything. I'm not allowed to select any other contexts than the componentcontroller - in fact, they are not visible.

Presumably because of this, back in the view, there is no "structure" for the Data node of the Interface controller context, and so all my table fields are wiped out whenever I try to do an external mapping from my view table node to the ALV defined in the Interface controller. In my opinion something should be mapped first in the Interface controller, but it insists on only recognizing the Componentcontroller context, not any stupid view contexts...

Former Member
0 Kudos

hi, i understand your frustration.

I have done a Dynamic_alv application and in the view based on a selection Dynamic context nodes are build and i bind them to the alv node.

They are working fine with out any external context mapping hurdles.

consider using set_data method which complements the problem of not able to bind other controllers to alv.