cancel
Showing results for 
Search instead for 
Did you mean: 

change context node cardinality to "0...n" programatically

daniel_humberg
Contributor
0 Kudos

It is possible to change the properties of a context node property dynamically via ABAP programming? I have a context node that has the cardinality "0...1" and I want to change it dynamically to "0...n".

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

I am afride to say it is not possible to change dynamically. The cardinality you mentioned was

0..1 and now want to change to 0..n. Best why dont you use 0..n when you know there could

result multiple entries.

I tried but i guess only way is to change at properties of node or attribute at context level.

Regards and Best wishes.

daniel_humberg
Contributor
0 Kudos

The main reason why I am thinking of doing this programmatically is that I as a customer do not want to modify the context node that is part a SAP standard package. Changing the properties of a context node as an enhancement is not possible, so I am thinking of alternative ways...

Former Member
0 Kudos

Hi,

if the cardinality has set by SAP for that node as 0..1 then there has to be some purpose behind it, if you feel that genuinely the node in question should hold more than 1 element then you can raise a ticket to SAP to change it.

If the change is required for your own scenario then you can create a new node and fill data in it with the same logic as used for previous old node and bind it to the UI element bound earlier.

Also, you would have to do a where used list of earlier node and change it to your new node.

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hi Daniel,

would it not be easier to set the cardinality as 0...n in the first place and then just control the user's ability to add new rows to the context through your UI design?

I do not believe it is possible (happy to be proved wrong) to change this property of a node - especially as there is no easy way that I can see to trigger the cascading of the change to any mapped nodes - There are public attributes of a node that show its mappees, but I can't see anything that iterates around them and causes them and their mappees to reset - but they are public attributes so I guess you could do it.

Each instance of a node read's its properties from the node it is mapped from, but stores this at the instance level - there is a reset method for a node that a mappee's attributes could be updated from the mapped node. but I can't see anything to cascade this reset. (there is an event on_type_changed that could do it, but the raising of the event is private to the class CL_WDR_CONTEXT_NODE_INFO and only seems to involve changes to attribute information - not node specific information (like is it a multi cardinality node)).

Hope this helps.

Cheers,

Chris