Concat one string to a table field

I would like to Know how can I join in a table field one fixed string?

Ex: Field value = 2110

Strring = A

Result 2110A

Note: I Am using this C/AL :

Account_Code := (Account_Code+‘A’);

But like this the result is:

2110 A

How can I avoid this space?


I cannot but assume that these spaces are part of the field (Account_Code) value, so you need to remove these from the field.

Just tested the following code:

String := ‘2110’;
String := String+‘A’;

with result showing: 2110A

Hy Luc

Yes the result in my message is 2110 A .

So, how can I avoid this space??

Either make sure users enter data without spaces or remove trailing spaces through code. For the latter have a look at the DELCHR string function.

The stange thing is that NAV, when entering data in a field, will remove trailing spaces automatically, so I wonder where they come from.

probably from the original import. I notice we had a ton of ending spaces when we first start nav especially in address & city fields.

delchr(yourstring,’>’,’ ');