cancel
Showing results for 
Search instead for 
Did you mean: 

To get a lead select of the recursive tree node

madhura_lobo
Explorer
0 Kudos

Hi,

I have the following in my context.

>QSTNNR (1..1)

>QUESTION (0..n)

<>recursiveQSTN

i.e. i have a node QSTNNR, whose child node is QUESTION. This QUESTION is a recursive node( QSTN).

In my layout, i have mapped the TREE to QSTNNR and the TREENODETYPE to QUESTION.

I create a element for QSTNNR. Then add question say Q1 .

Now i want to add a QUESTION as a child of Q1. For that i select Q1 and create a node i.e question Q2. It works fine.

So now i have

.QSTNNR1

> Q1

> Q2

Then i want to add a child to Q2. For that i select Q2. But when i try to get the lead select inorder to know the one user has selected by doing

A)

lo_nd_question = wd_context->path_get_node( path = `QSTNNR.QUESTION` ).

lo_el_question = lo_nd_question->get_lead_selection( ).

I do not get Q2, instead i get Q1.

B)

When i do the following, i get Q2.

lo_nd_qstn = wd_context->path_get_node( path = `QSTNNR.QUESTION.QSTN` ).

lo_el_qstn = lo_nd_qstn->get_element( ).

But when i select Q1, to add a child to it, i have to use the option A) to get lead select.

When i select Q2, i have to use option B) to get the lead select.

Please let me know how to get the node the user has selected in a tree. if it is lead select on the node associated, what am i missing?

Thanks and Regards,

Madhura Lobo

Accepted Solutions (0)

Answers (2)

Answers (2)

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am just thinking that why QSTNNR is (1..1)?

do we have multiple QSTNNT?

what is the exact value that you need?

Former Member
0 Kudos

Hi Madhu ,

Go to with transaction DWDM .... u will see so many examples of creating tree with nodes and sub nodes ...

Regards

Alok