on 2013 Jun 22 12:09 PM
DS 4.1 Add leading Zeros - How?
We have material number without leading Zeros, by example = '445566'
We need 18 chars format with leading zeros = '000000000000445566'
Is there any string function in DS to do this?
Request clarification before answering.
Hi,
Use the function to_char
to_char(445566,'099999999999999999')
also,
Lpad(445566,18,'0');
Please let me know .if it is working.
and also refer below link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As mentioned above, use lpad for padding with zeroes.
ex. lpad(MATNR,18,'0')
Thanks,
Jincy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is lpad what you want?
Syntax:
lpad(input_string, size, pad_string)
Example:
lpad(last_name, 25, ' ')
Result:
The value in the column last_name, padded with
spaces to 25 characters on the left or truncated
to 25 characters.
You can find more details from reference guide.
Thanks,
Li
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mikhail,
If you want add leading just use lpad function as MATNR data type is varchar . Please find the below syntax.
LPAD(MATNR,18,'0')
Thanks & Regards,
Ramana.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
30 | |
10 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.