cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in manipulating the node - subnode

Former Member
0 Kudos

Hi Gurus

I have a node called node1 and it has only one node which is node2 in node2 i have few attributes L1 and L2

Node1

Node 2 - L1 and L2 (L1 and L2 are attributes)

Node1 : Cardinality 0..n

Selection 0..1

Node2 : Cardinality 0..n

Selection 0..1

Can you please suggest how to set the node2 looping at node1.

Thanks and Regards,

Srikanth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

see this thread

[;

Former Member
0 Kudos

Hi Baskaran

Appreciate your quick response. I am new to WDA can i get the declarations of the elements. When I tried to create the node as follows:

DATA lo_nd_nd1 TYPE REF TO if_wd_context_node.

DATA lt_nd1 TYPE wd_this->Elements_nd1.

it throws syntax error as

The type "ELEMENTS_ND1" is unknown.

thanks and regards

Srikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are going to have to adjust that code sample for whatever you named your context node.

DATA lt_nd1 TYPE wd_this->Elements_<node_name>.

Or consider using the code wizards to generate the Context API calls for you.

Former Member
0 Kudos

Hi Thomas

The above mentioned lines are generated using wizard. Even then I am facing syntax error.

Thanks and Regards,

Srikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Try commenting out all the code and activing the component. The context definition generates the interface dynamically and perhaps the generation is off or hasn't occured yet. Generally if you comment out any of the code using the dynamic portions, and activate (which forces generation) things clear up.

Former Member
0 Kudos

Hi Thomas

I have tried commenting the code and activating. Then when I again uncomment/generate the code using wizard.

I am facing the same syntax error.

I have ND1 node with ND2 as child node. Both the nodes cardinality is 0..n.

Thanks and Regards,

Srikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Have you tried re-running the wizard after activation? As long as everything is activated and up to date, the wizard shouldn't generate a reference that doesn't exist. If the cardinality and names you listed here are correct, then this reference should be valid.

Former Member
0 Kudos

Hi thomas

I have tried re-generate code using wizard but there is of no use.

Thanks and Regardsn

Srikanth.

Former Member
0 Kudos

Hi,

I notice there are no attributes (yet) in the parent node ND1, so the framework did not generate a type for ND1 - hence the RTE. The code you have will make sense after you create some attributes in ND1, otherwise you don't need an internal table for ND1; you can create elements but only the subelements will have data in attributes L1 and L2.

Regards,

George

Former Member
0 Kudos

Hi Georg

Thank you. you have a valid information. I have tried creating attributes in parent node ND1 now i do not et error.

But I do not need any attribute in ND1.

something like

1. loop ND1

2. loop ND2

3. set attributes for ND2

Can you suggest me hoe to set the nodes.

Thanks and Regards,

Srikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>But I do not need any attribute in ND1.

What is the purpose of the node if it doesn't have any attributes? It can't story any data without attributes.

Former Member
0 Kudos

Hi,

WebDynpro is a lot about design and less development (coding).

Why do you need then such a hierarchy? What will ND1 represent?

According to such a hierarchy you can have a collection of ND1 elements and each one in turn could have a colection of ND2 elemnts. Without any attributes in ND1 how do you distinguish them? Usually there is a key stored in an attribute which makes them unique.

Regards,

George

Former Member
0 Kudos

Hi Thomas and George

good question... I am developing an application with Business Graphics - Gantt Chart in that application I have the UI elements like Series in that Points and points has Start Value and end Value. Series may have any number of Points (which is again a table)

For this application I have create nodes like Series (parent node) , Point (Child Node).

Please suggest ow to proceed

Thanks and Regards

Srikanth

Former Member
0 Kudos

Hi Thomas and George

I have found this is possible in Webdynpro Java using the below code. The node as define as it is Series as 0-n cardinality with only one child node Point with 0-n as cardinality.

-


IPublicFcTeamCalendar.ISeriesNode seriesNode = wdContext.nodeSeries();

for (int i = 0; i < rowIds.size(); ++i) {

IPublicFcTeamCalendar.ISeriesElement seriesElement = seriesNode.createSeriesElement();

seriesNode.addElement(seriesElement);

IPublicFcTeamCalendar.IPointNode pointNode = seriesElement.nodePoint();

-


Is this possible in Webdynpro ABAP?

Thanks & Regards,

Srikanth Anthargam

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You don't have to structure things this way. I checked and I have a series and points - the series bound to a context node and the points are bound to an attribute in that same node. No reason to have a parent/child context. If the parent doesn't have any attributes I still don't see what value it adds.

Former Member
0 Kudos

Hi Thomas

Really appreciate your quick response.

Can you please refer to the Webdynpro component pcui_gpteclsap.com in ESS business package (webdynpro for Java).

my question is if it is possible in Webdynpro for Java why not in WD for ABAP.

thanks & regards,

Srikanth

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I would say it isn't possible to have the same structure in WDA, based upon the syntax error you were getting. Frankly it doesn't make any sense to have this pattern - as the parent node serves no purpose without an attribute. It isn't necessary for the IGS series/point. If you absolutely feel you must have this structure, then just create a 1 character dummy attribute.