Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SapScript problem with leading zeros

Former Member
0 Likes
1,143

Hi,

I print field LTAP-NLENR.

But when i use &LTAP-NLENR& leading zeros are cut.

I need to display it with leading zeros. (ex. 0000000000010000000001)

Please help.

Regards,

Greg.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,109

Ok,

but as I wrote a need to keep leading zeros

but &LTAP-NLENR(Z)& supress leading zeros.

so instead of 0000000100000001 I have 10000000001.

Regards,

Greg

9 REPLIES 9
Read only

pavel_parshenkov2
Participant
0 Likes
1,109

use like this:

&LTAP-NLENR(K)&

Message was edited by:

Pavel Parshenkov

Read only

former_member188829
Active Contributor
0 Likes
1,109

Hi,

&LTAP-NLENR(Z)&

Read only

naimesh_patel
Active Contributor
0 Likes
1,109

Try with

&LTAP-NLENR<b>(Z)</b>&

Here Z should be in capital letter

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,110

Ok,

but as I wrote a need to keep leading zeros

but &LTAP-NLENR(Z)& supress leading zeros.

so instead of 0000000100000001 I have 10000000001.

Regards,

Greg

Read only

0 Likes
1,109

i have written:

&LTAP-NLENR(K)&

try this ))

Read only

0 Likes
1,109

😕 no it doesn't work

Other ideas ?

Regards,

Greg.

Read only

0 Likes
1,109

&LTAP-NLENR(K)& works fine for me with your requirment.

I have defined a L_VAR like this:

data: L_VAR type LTAP-NLENR.
l_var = '0000000000010000000001'.

In my script I use like this:

P1   &L_VAR(K)&

SO, try to pass that value to some other variable and see what happens.

Regards,

Naimesh Patel

Read only

0 Likes
1,109

HI,

Try to declare that variable of type N and pass the value and print this varible in the script.

thanks

Mahesh

Read only

0 Likes
1,109

hi Greg,

with (K) it has to work. I would suggest to check in debug if the variable really contains the leading zeros.

ec