on 02-23-2011 12:09 PM
Hi All,
Iam getting error while calling subnode..
I have a node SHIPMENT(cardinality 1-1), containes another node IMPORTING (cardinality 0-n ). it containes attributes, one of attribute is I_VTTK_SHTYP of type TVTK-SHTYP.
I am binding this attribute to DDBI texts property.. and my code is
lo_nd_importing_1 = wd_context->get_child_node( name = 'IMPORTING' ).
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
If iam using above code i am getting this error...
Subnode MAIN.IMPORTING_1 does not exist
If i use this code..
lo_nd_importing_1 = wd_context->path_get_node( path = `SHIPMENT.IMPORTING` ).
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
It executing perfectly, but i am not getting data into dropdown, but i checked through debugging, data is available in table, after binding i am not getting...
Any help???
Thanks
Madhan.
Edited by: MadhanSAP on Feb 23, 2011 1:44 PM
try it like this. IT may help.
data nd type ref to if_wd_context_node.
nd = wd_context->get_child_node( 'SHIPMENT' ).
lo_nd_importing_1 = nd->get_child_node( 'IMPORTING' ).
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If i use this code..
lo_nd_importing_1 = wd_context->path_get_node( path = `SHIPMENT.IMPORTING` ).
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
Check the node name once again
whether its "importing" or "importing_1"
and whether it is the same node whose attirbute you have bound to DDBI texts
paste your full code of this method.
thanks
sarbjeet singh
Hi Sarbjeet...
Node names everything is correct.. here the code i am using
SD_SHIPMENT_CREATE is the FM i am using..
Node : SD_SHIPMENT_CREATE (1-1) under this another node IMPORTING_1(0-n) in that node one attribute I_VTTK_SHTYP i am using this and bind with DDBI texts property.
WDDOINIT
data nd type ref to if_wd_context_node.
DATA lo_nd_importing_1 TYPE REF TO if_wd_context_node.
DATA lo_el_importing_1 TYPE REF TO if_wd_context_element.
DATA ls_importing_1 TYPE wd_this->Element_importing_1.
DATA lt_i_vttk_shtyp TYPE STANDARD TABLE OF if_main=>Element_importing_1.
select shtyp from tvtk into table lt_i_vttk_shtyp.
navigate from <CONTEXT> to <IMPORTING_1> via lead selection
lo_nd_importing_1 = wd_context->path_get_node( path = `SD_SHIPMENT_CREATE.IMPORTING_1` ).
nd = wd_context->get_child_node( 'SD_SHIPMENT_CREATE' ).
lo_nd_importing_1 = nd->get_child_node( 'IMPORTING_1' ).
*lo_nd_importing_1 = wd_context->get_child_node( name = 'IMPORTING_1' ).
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
ENDMETHOD.
Thanks,
Madhan.
Hi
The code written is perfect. it will be creatign elements for the node. check the following things once again
1. Check whether entries are present in the table tvtk.
2. put a breakpoint in the line
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
and check the number of entries in table lt_i_vttk_shtyp .
3. go to the layout and check once again whether the texts property of the DDBI is bound to the attribute I_VTTK_SHTYP
present under IMPORTING_1.
4. which wddoinit is this method. Does belong to view controller or custom controller.
If it is custom controller and is the mapping to view refershed.
thanks
sarbjeet singh
Hi Sarbjeet..
There are 21 entries in the table.
I place a break point at bind table and cheked there.. contain 21 entries.
Binding is done perfectly.
Code is written under view wddoint method.
Everything is perfect i think.. but data is not coming.. i am not getting whats happening??
Thanks,
Madhan.
1. put the breakpoint and check the number of elements in the node.
"try to get the number of elements in the node.
lo_nd_importing_1->BIND_TABLE( lt_i_vttk_shtyp ).
data num type i.
num = lo_nd_importing_1->get_element_count( ).
2. also right click on the dropdown in the web page and go to more field help
there check the context path for the TEXTS
it should be
SD_SHIPMENT_CREATE.IMPORTING_1.I_VTTK_SHTYP
thanks
sarbjeet singh
Hi Madan,
One more thing you can try is check the values for I_VTTK_SHTYP of the context elements in the debug mode.
When you are in debug session, click on New Tool button(you will find on the right side).
select Tools->Special Tools -> Web Dynpro
Then a view will be opened in which you can see the context elements and the values for their attributes.
Check if the data is correct.
Best Regards,
Srilatha
Hi srilatha,
I tried like what u suggested in debugging.
For that attribute data is not coming, so thats why i am not getting data. that is ok, i want to know why data
is not coming.. please ceck once my coding above i think everything is perfect. Data is coming in table, also checked
like sarbjeet suggestd after binding also i am checking using get_element_count, data is coming , but in final output DDBI is empty. where is the problem?
Thanks,
Madhan.
Hi MADHAN ,
I am kind of confused here .
U have a context of 1:1(SHIPMENT) under this there is a 0:n node(IMPORTING) .
Under importing , u have a attribute which is bound to a DDBI.
What u are trying to do is fetch the data from DB and bind the data obtained to the node(IMPORTING) .So the number of elements created is equal to number of rows returned from DB.
Each element now has only one value for the attribute I_VTTK_SHTYP . And you bind this attribute to a DDIP.
How can we expect the Dropdown to show the attribute value of all the elements???
So ,what's happening probably is , DDBI is bound to only a single element's attribute value.(Which is basiclly only one value).
Although , I am not sure if I am sounding sane....
Probably , you need to maintain an value set ...
Guys , Please correct me if i am wrong...
Thanks,
Aditya.
Great. In the code you posted,
DATA lt_i_vttk_shtyp TYPE STANDARD TABLE OF if_main=>Element_importing_1.
Can you change the type of this internal table to the database table from where you are reading the data and see.
always check in debug mode for the contents of context nodes. If you see data there, then the UI will also get the data.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.