cancel
Showing results for 
Search instead for 
Did you mean: 

Error while calling subnode..?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos

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 ).

Former Member
0 Kudos

Hi Sarbjeet,

I tried like what u suggest...

Still i am not getting any data.. DDBI is empty.

Thanks,

Madhan.

gill367
Active Contributor
0 Kudos
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

Former Member
0 Kudos

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.

gill367
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi ,

Try reading all the elements of the IMPORTING node as soon as u bind it and see the number of elements.

Just to make sure that it is binded properly.

Thanks,

Aditya.

gill367
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Sarbjeet,

1. I checkd through break point the no of elements is coming same as in the table.

2. In more help path is SD_SHIPMENT_CREATE.IMPORTING_1.I_VTTK_SHTYP.

Everything is perfect as of now what u suggest.. still not getting data?

Thanks

Madan.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

gill367
Active Contributor
0 Kudos

wat is the data type of the attribute i_vttk_shtyp.

Former Member
0 Kudos

Hi Madan,

Then the problem is most probably with the data type of attribute in the context node and data type of the field in your internal table. Make sure both of them are same.

Best Regards,

Srilatha

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi sarbjeet,

Data type is TVTK-SHTYP. I am using FM as it is, i haven't done any changes. In select statement also i used same table TVTK.

I treid by changing this type also, i changed to VTTK-SHTYP. After changing also no use.

Thanks,

Madhan.

gill367
Active Contributor
0 Kudos

HI Aditya.

the code and the approach he is following is correct.

it should work.

soem where some small thing is missing.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi Madan,

Might be to do with Initialize lead selection property of node SD_SHIPMENT_CREATE.

You have to enable that property to get the values from its child node in drop down.

Hope this resolves!

Best Regards,

Srilatha

Edited by: Srilatha M on Feb 24, 2011 12:15 PM

Former Member
0 Kudos

Hi Srilatha,

Lead selection is checked for both nodes.

Thanks,

Madhan.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Srilatha,

Thanks for your response.. and patience..

I used type as DB table still, not getting any data.

Thanks,

Madhan.

Former Member
0 Kudos

Hi Srilatha,

Thanks for your response.. and patience..

I used type as DB table still, not getting any data.

Thanks,

Madhan.

Former Member
0 Kudos

Hi All,

I created one node in under root node and i created one attribute in that node and i bind this attribute to DDBI( I created one more DDDBI ) .And i used same data type as above. Now data is coming. In above case data is not coming. I am not getting any reason?

Thanks,

Madhan.

gill367
Active Contributor
0 Kudos

How have you created the first node.

Was it through Custom Controller

I tried the whole scenario with the same code as you are using and i am getting all the values in the dropdown.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi Madan,

Previously, wasnt the node SD_SHIPMENT_CREATE a direct child of root node??

If it wasnt the case, then may be there are no lead selected element for SD_SHIPMENT_CREATE node at the runtime. Hence you werent able to see the data. This is just a guess.

Regards,

SRilatha