cancel
Showing results for 
Search instead for 
Did you mean: 

mapping between view controller and component controller

former_member755502
Participant
0 Kudos

Hi Experts,

I am new to web dynpro ABAP. First I created an application using one input field and one button, my view name is V1. In view context, I created one node viz. NODE1 using table SFLIGHT, fields chosen are CARRID CONNID and FLDATE. I have bind that to my input field and for button I have not done any thing. So, when I am running this application it is allowing me to select value for my input field. After this, I have added a table to the view layout. I have added to nodes using sflight table in COMPONENT CONTROLLER. First node is SFLIGHT with CARRID, CONNID, FLDATE, PRICE and PLANETYPE and second node is NODE1(same name) with only CARRID. Now in VIEW CONTEXT it is showing -

CONTEXT

NODE1

CARRID

CONNID

FLDATE

(which I had created in VIEW CONTEXT for input field)

CONTEXT COMPONENT CONTROLLER

SFLIGHT

CARRID

CONNID

FLDATE

PRICE

PLANETYPE

NODE1

CARRID

(which I had created in component controller after adding table)

Now both this context should be matched as per my knowledge, so that when I bind the table it should V1.SFLIGHT.<fieldname> and not as V1.NODE1.<fieldname>

But I don't know how to match them. Please help.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sambaran,

I guess I understood what you want.

To achieve this, proceed as follows:

1)Open your View, goto Properties tab. Here in the Used controller table, click on the create icon to include the component controller (component controller is added by default by the framework, if you use custom controller you need to define this usage).

2)Once you do this, goto Context tab of the view, here now you will be able to see the component controller on the right hand side.

3)Next, drag the SFLIGHT node from the component controller, and drop it on the Context (root context) of the view (left side). Doing this system will create a mapped context node on the view which you will use to bind to the view elements on the layout.

The above steps apply if you want to directly create a view context from component controller context.

Hope this helps!

Thanks,

Chitrali

former_member755502
Participant
0 Kudos

Thank you arjun and chitrali. Somehow with hit and try method I have also found the solution.

former_member755502
Participant
0 Kudos

My requirement is slightly different. NODE1 and SFLIGHT are nodes (irrespective of VIEW CONTROLLER or COMPONENT CONTROLLER). In VIEW CONTROLLER I have NODE1 with three fields CARRID, CONNID FLDATE. And in COMPONENT CONTROLLER I have two nodes one SFLIGHT with CARRID, CONNID, FLDATE, PRICE, PLANETYPE and other node NODE1 with CARRID. To display values in my table I have to use CONTEXT VIEW CONTROLLER, so that in my table it should be V1.SFLIGHT.<fieldname> instead V1.NODE1.<fieldname>. Here, V1 is my view name.

arjun_thakur
Active Contributor
0 Kudos

hi,

So that means that you need a node with a name SFLIGHT in your view controller which is binded to your component comtroller and you want to bind it to your table on the screen...... Is this your requirement?

former_member755502
Participant
0 Kudos

yes... As per one document reference, I need to right click on the nodes in COMPONENET CONTROLLER to find some option through which I will get a pop up stating "Match Child Before Mapping" - which I am unable to find by any means. And without that I think I shall not be able to get the option for my table as V1.SFLIGHT.<fieldname>.

arjun_thakur
Active Contributor
0 Kudos

hi,

then you can do like this:

open view context controller, on the right side of your screen you'll see nodes present in the component controller. simply drag and drop a node ( the one you require i.e sflight ) from component controller to view controller's context. this will map your node in component and view controller.

i hope it helps

regards

arjun

arjun_thakur
Active Contributor
0 Kudos

hi,

If i have understood you correctly, then i think your case is like: u have a node in comp controller with say 5 attribute and in view controller you have a node with say 3 attribute and you have to map them.

if this is the case then, u can proceed in this manner:

in view controller, right click on the node and click on define mapping and the chose node of comp controller. this will map all the attribute present in the comp controller's node. then delete ono by one those attribute which you don't require from your view controller's node.

i hope it helps

regards

arjun