Skip to Content
Technical Articles

Change in Custom BO cardinality Data Workbench interpretation

Hi Together,

 

with the recent release 1908 SAP changed it’s Data Workbench intepretation of custom BO subnode cardinality.

Bevore the release 1908 the cardinality of this BO definition would be interpreted as 0:n as default.

businessobject Test {
  element ID:BusinessPartnerInternalID;

  node ListEntry{
    element Column1:LANGUAGEINDEPENDENT_LONG_Description;
    element Column2:Indicator;
  }
}

With the new release the Data Workbench defaults the cardinality as 0:1.

 

If you are not using the Data Workbench, the BODL above and the coding below still works perfectly fine.

var check:Indicator=true;
var counter = 0;

var newEntry : elementsof Test.ListEntry;

while(check)
{
  newEntry.Column1 = "Test entry: " + Numeric.RoundToString(counter);
  newEntry.Column2 = check;
 
  this.ListEntry.Create(newEntry);

  counter = counter + 1;

  if(counter == 14)
  {
    check = false;
  }
}

This is still able to create 14 entries without defining the cardinality.

But if you want to upload nodes via the Data Workbench you now need to define how the cardinality is from object root to node like this.

businessobject Test {
  element ID:BusinessPartnerInternalID;

  node ListEntry[0,n]{
    element Column1:LANGUAGEINDEPENDENT_LONG_Description;
    element Column2:Indicator;
  }
}

Here you could alos set a minimum and maximum  (e.g. [2,5]) entries for your node list.

EDIT: Forms seem to have the same issue as reported by John Meadows

As a summary you could say that a cardinality definition is not necessary, but if you want to use the full functionality it is needed.

The best way to go should be to just directly give it a 0:n cardinality.

 

Kind Regards,

Johannes

 

 

/
3 Comments
You must be Logged on to comment or reply to a post.
  • Thanks, this article helped me solve a problem that was probably caused by this subtle change!

     

    Being a fairly new developer in ByD, i have got used to not specifying cardinality of nodes in my business objects. THis has been fine up until now, when i came to create a form based on my custom BO.

    I couldn’t understand why it was only returning one row! a quick look in the data hierarchy and it was a 0,1 between root and node. But WHY!!!!??? What had i done wrong?

    Hours of head scratching solved in under 15 minutes when i read this!

    So if you plan to create forms based on the nodes of your business object, you must specify the cardinality for the form design wizard to work properly.

     

    John

     

    • Hello John,

       

      nice to hear that my blog helped. Yes indeed the ByD implementation can be quiet a diva.

       

      Also goot to know, that forms need this definition as well.

       

       

      Kind Regards,

      Johannes