What standards we Should Follow

Amith

Amith

Active Member
What standards we should follow in JDE
I mean like variable names should be like "AddressNumber_AN8"
and in standard reports I saw something like'mn','sz' etc what are these and how many are there and how to use them
 
Amith,

The naming convention for variables that you use depends on you and the organisation for which you work.

I append the Data Dictionary alis to to variables as you have have done, but I also prefix the name with a one or two character code to indicate the variable type. For example, mnAddressBook_AN8 is a math numeric - mn (I think these are mostly borrowed from the C programming language) - and the Data Dictionary alis AN8 was used to create the variable.

Some other one or two character codes are:

mn - Math Numeric
c - Single Character
sz - String (Why, I don't know)
jd - JDE Julian Date (YYYDDD)
 
Amith

I agree with Peter in that you do what suits you and your organisation.

JDE tend to use the format of mnAddressBook_AN8, however for any variable that I create I would use the format of mnAN8_AddressBook, this not only helps to identify any custom variables, but also helps when assigning values to variables.

What I mean by this is varaibles are listed in lexicographical order, so naming variables using my standard will ensure that mnAN8_AddressBook and mnAN8_SupplierAddress appear next to each other, whereas mnAddressBook_AN8 and mnSupplierAddress_AN8 may not.

Hope this helps.

Thanks
Aidy
 
Generally speaking I don't like Hungarian notation, but I find it is actually kind of helpful in JDE in a couple of situations so I still use it for the most part. Also I use it to be consistent with pristine code.

As far as appending the DD Alias to the variable/structure name, I am really not a big fan of that either and I usually don't do it, unless the Alias is just as recognizable as the "long name". In other words if I just need a number and I use GNUM2 I find it ridiculous to name my variable mnAmountGNUM2. However, I will occasionally use it if I think it makes the code more readable and self documenting as in mnShipToSHAN. But even then, I tend to lean towards not appending the DD Alias... I mean you can easily find out the DD item for vars/struct members with relative ease.

As others have said, it comes down to any coding guidelines/precedents that your organization has and personal preference. There really isn't a right or wrong answer.
 
Hi Amith,

Kindly find the examples below:

nCountRow_INT01 = Integer
szBranchPlant_MCU = String
jdToday_DTE = Date
cErrorCode_ERRC = Character
mnIdentifierShortItem_ITM = Mathnumeric

Hope it will help.
 
Back
Top