on 01-29-2011 10:28 AM
There are 2 input fields on first view carrid, connid and one "GO" Button
1) "FLIGHTINFO" is the node under context of first view
2) " FLIGHTTAB " is a node under context of component controller having cardinality " 0..n " ,Dictionary structure "SFLIGHT" (i have selected only these many attributes " carrid, connid, fldate, planetype, seatsmax and seatsocc " )
3) I have created Method "FLIGHTTAB_FILL" in component controller to fill context node FLIGHTTAB
Insert the source code for doing the following:
- Navigate to context node FLIGHTINFO
- Get element at lead selection for context node FLIGHTINFO
- Get CARRID and CONNID
- Fill an internal table with all datasets from database table SFLIGHT, who meet the constraints for CARRID and CONNID.
- Navigate to context node FLIGHTTAB
- Bind the internal table(having all standard fields of sflight ) to the context node FLIGHTTAB ( having those 6 attributs).
4) On action GO ->Implement the invocation of Method " FLIGHTTAB_FILL".
5) I have mapped node FLIGHTTAB to context of OUTPUTVIEW. Display table on view OUTPUT_VIEW (for this i hav used code wizard).
Problem: after entering values of connid & carrid I m getting proper entries in internal table. but output view is not at all trigger (although i have created plugs). Is it necessary that while binding internal table with context node FLIGHTTAB should have same no of fields (i.e. in this case 6 )?
I am a fresher, My concept of bindings and cardinality are not so clear so can anybody help me out?
Thanx in advance for replying.
Hi John
Here is what you should do:
In your view create context that mirrors the component controller node structure. You can use copy - paste.
Accordingly in your component controller:
Node
- carrId
- connId
- OutputNode
Node FLIGHTAB - cardinality 0..n (meaning a table of unknown size)
In your View, have the same context structure.
When you run the method, the return table fills the node FLIGHTTAB in your component context and automatically also
fills the view's context FLIGHTAB..
In your view you should put an UI Element of type Table which is bound to the view's FLIGHTAB.
That's it.
regards
yuval
P.s If you have more questions, do not hesitate to ask.
Edited by: yuval peery on Jan 29, 2011 1:24 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Everyone,
Problem1: connid is showing by Default value (0000) although i have not set it to 0000.
why is it so?
I want to show it blank for that what do I do?
Problem 2:
There are two views.
1st view has 2 input fields carrid and connid.
2nd view brings information for input on first view.
My Data of flight information is coming properly and also displaying properly in 2nd view.
Problem wth LOGIC I am not getting efficient logic. Here on first view there are only two input fields i wrote query depending upon 4 possible cases ( 1.carrid entered, connid entered by user
2. carrid entered ,connid not entered by user
3. carrid not entered, connid entered by user
4 carrid not entered, connid not entered by user)
that i manage with simple IF-ELSE logic
BUT If suppose there are many input fields on view , query should fire considering all fields wether user has entered value for that or not
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johnright,
your initial problem was
Problem: after entering values of connid & carrid I m getting proper entries in internal table. but output view is not at all trigger (although i have created plugs). Is it necessary that while binding internal table with context node FLIGHTTAB should have same no of fields (i.e. in this case 6 )?
i assume this solved. The above post is deviating and misleading from your initial post. Could you please post additional questions as separate post.
Possible problems could be many, check following:
1. Check both the views are correctly mapped in the window.
2. The navigation u created in main window is not correct.
Check that correct outbound plug is mapped to correct inbound plug.
3. Check that the on click of button 'go', the outbound plug is fired. Check if the code to trigger plug is not present in any 'if' condition.
These could be possible reasons for populating a new view, none else.
Data mapping and data binding does not takes part in navigation from one view to another..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you connected the outbound plugs to the inbound plugs in each other views (you do this in the window )?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi johnright ,
No i dont think it is necessary that while binding internal table with context node should have same no of fields as the internal table . You might get some improper values in the corresponding fiels but it will not lead to any error.
In your OUTPUTVIEW once you created the table UI element in layout and you bind it to FLIGHTTAB node you dont have to use any code wizard method to display the values. If the node contains values it will display automatically. (in your case you are filling it in step #).
Check :-
1. In your On action GO after filling the table you are firing the out bound plug :-
WD_THIS->FIRE_INITIAL_OUT_PLG(
).
2.All outbound plug and inbound plug are link properly and every thing is ACTIVATED.
If still unable to find the error try to debug method wise and find where the error occurs and reply to us.
Binding:-
In web dynpro ABAP you will not able to get any value of any variable outside of any method. Here we use context node which is referrence that we create reference to any particular structure we required. Now to hold the values you need to bind
the values of your internal table to the context node.
If the node is in view then its values are visible to all the local method of the view.
If the node is in component controller then the you bind a value to the node from one view and you can get it in another view.
Remember binding and mapping are not same.
Mapping is done between node like inthe second scenario i have explained you need to create a node in view controller and then you need to map it to the corresponding view of component controller to send values across view.
cardinality:-
Each node contains data fields that represent one of the following:
An individual instance of an object type
A table of instances.
This property of a node is known as its cardinality of table of instances.
If you need table instance :- 0..n or 1...n
In case of 1...n one default value is created. generally we use this as mainly we need to work with table.
In case you need a individual instance of a object or like you want value like a structure only :- 0...1 or 1....1.
Thanks & Regards,
Monishankar C
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.