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

a question about write

Former Member
0 Likes
860

hi experts

when I use write to output a varient, the vaule of varient is '0000123456', but why the resule turns to 123456.... 0 got missed...

many thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
835

HI

wat is the data type of work field that you are trying to write.

BR

Lavanya

9 REPLIES 9
Read only

Former Member
0 Likes
836

HI

wat is the data type of work field that you are trying to write.

BR

Lavanya

Read only

0 Likes
835

hi Lavanya

the data type is char10....

Read only

0 Likes
835

If its numeric or Integer then output will be right justified and may zeros are skipped due to length constraints.

Read only

0 Likes
835

hi Lavanya

actually, the data type refer to a data element, the data element is char10.

and my varient is just ok with leading 0, but when I write it out, the 0 got lost.

Read only

0 Likes
835

Hi,

At data element check whether are there any conversion exits or not..

Good luck

Narin

Read only

narin_nandivada3
Active Contributor
0 Likes
835

Hi,

Is your variable of Integer type.. if so integer does not display leading zero. Assign the value to character so that it will display the zeros too..

In general there will be some conversion exits already created by SAP due to which the leading zeros may be deleted during output..

Try checking that in debug what exactly the variable is holding.. I think in debugging it will hold the zeros too but during displaying it does not display zeros.

Hope this would solve your issue.

Good luck

Narin

Read only

Former Member
0 Likes
835

Use FM CONVERSION_EXIT_ALPHA_OUTPUT

Pass it the variable which is without zeros..

It will return you the output with zeros infront of it

Hope this helps!

Read only

Former Member
0 Likes
835

Hello


data: str type string.
str = value.
write str.

Read only

Former Member
0 Likes
835

hi,

First of all to get the Zeros back in your variable that you are using to display should be of 10 characters.

Now, for displaying the values with Zeros,you should use the command:

UNPACK <variable> to <Variable>

for eg:

v_number type char10 value '123456'.

UNPACK v_number to v_number.

Write:/v_number.

the output will be '0000123456'.

Since this v_number is of char10 it will put Zeros before that number.

Hope this helps.

thanks,

Rashmi.