cancel
Showing results for 
Search instead for 
Did you mean: 

User Tables Naming convention / Namespaces

Former Member
0 Kudos

Dear all,

Does anybody know where to get Informations about SBO NameSpace Conventions ?

I have 2 Questions for naming conventions

1) Creating a UserDefinedTable like this

Table Name : Z_NameSpace_MyTableName

Is it necessary that any FieldName of the

table uses the NameSpace Prefix ?

Like this: NameSpace_PosNo

2) Adding UDF to SBO Tables

Is it necessary that UDF Fields uses the

NameSpace Prefix ?

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello all,

many thanx for your replies.

This will help me a lot.

Thomas

Former Member
0 Kudos

Thanks Ibai, hopefully you gave more precision on this post.

The length of the field name can't exceed 8 characters. If you have U_ABC_ in front of it, that let you only 2 characters to name your field. That's not enough to make it explicit. Well that is if the length is really 8 characters. I hope I'm not wrong on that too...

But I do agree that, to avoid problem, the namespace has to be used in UDF too.

I guess I should get more experience before trying to answer post.

Sébastien

Former Member
0 Kudos

Yes, you are right. 8 characters is not enough if you have to use a namespace... that´s why SAP is improving field name (and file names ) length in next versions (don´t know if in the 2004 it is included this change. I would be interested if anyone knows.).

As our customers don´t use any other addon appart from ours, we have decided not to use namespaces untill the length of the fields is bigger.

BUT your contribution is wellcome. Every contribution/comment/post is wellcome. This is not an "Expert´s" forum, and I don´t consider myself an expert. It is not long ago when I was just a newbie. Reading the forum, and trying to help others has make me a little more experienced.

So, don´t worry, and go on writting in this forum.

Regards,

Ibai Peñ

simone_pastorin
Participant
0 Kudos

Currently (SAP B1 8.82) a max field name length is 10: "U_" + 8. So in your notation "U_ABC_XXXX" you have 4 chars for specifying field name. No so much though...

Former Member
0 Kudos

Thomas,

The NameSpaces are only used while creating a UserDefined Table.

UserDefined Table :

The convention for the name is NameSpace_MyTableName (without the Z_). Its length can't exceed 19 characters.

When adding a user table, SAP Business One automatically adds the symbol @ as a prefix to the table name. For example: if you add a table named "ABC", the resulting table name will be "@ABC".

When referring to a user defined table you must use the name including the prefix @.

UserDefined Field :

you do not have to add the NameSpace in the name of the field. Its length can't exceed 8 characters.

When you create it using the UserFieldsMD object, the character "U_" will be added to its name, and created in the table.

To conclude, the NameSpace is only used for the table.

The DI API will add @ for the table, and U_ for the field.

You can see SAP note 647987 about NameSpace

Sebastien

Message was edited by: Sébastien Danober

Former Member
0 Kudos

Hi,

I do not agree with you Sébastien.

SAP people has always said to me that the namespace should be used in UDF too. Perhaps the UDF in a user table don´t need it as you have used the namespace within the table. But what happens with UDF added to SBO tables?

Suppose you have an AddOn which creates and uses a UDF called Color in the Items table. You use the color field as a string. I could develop another AddOn that creates and uses another Color named UDF in the Items table. But my color field is related to a user table. This two AddOns will not work together as they will crash when the color field would be used.

My advice is to use the namespace in UDF too.

Regards,

Ibai Peñ

Former Member
0 Kudos

The whole namespace issue is dealt with in the document "SAP Business One Standards and Guidelines". It should be available for download to all partners.

I think that the standards described in this document do make a lot of sense. (They basically follow Ibai's point of argumentation).

However real life is hard to press into standards. Since any authorized user can create user-defined fields and tables, chances are that customers will add their own fields following no scheme or standard. I have seen a customer who added approximately 150 user-defined fields to a single table.

It is even more important that developers constrain themselves to committing to a defined standard. SAP Business One will not allow two tables or fields with the same name in one database. Hence, problems are preprogrammed.

Lutz Morrien