Application Development 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: 

Formatting

Former Member
0 Kudos

I want to format my output as following in the write statement.

i am getting the output as

34.00

45.00

4.00

7.00

But i want the output to be

34.00

45.00

4.00

7.00

I tried right Justified. But i am not getting the exact alignment. can anyone help me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use:

write: 1(10) NUMBER right-justified.

4 REPLIES 4

Former Member
0 Kudos

hi Aruthra,

u'r required output and the output u r getting seem be the same here ... but to wat i have understood is u'r output should have to be right justified in that case declare the fields where u r are collecting the data as type c and then use right-justified statement...

i.e, Data: v_matnr(20) type c.

write: v_matnr <b>right-justified</b>.

Regards,

Santosh

Former Member
0 Kudos

use:

write: 1(10) NUMBER right-justified.

Former Member
0 Kudos

Hi

Check out your question again i think there is some minor problem in it.Anyway if you want to display in a appropriate format than try to give the spaces before or after the variable name and than print it.

Thanks

Mrutyunjaya Tripathy

Former Member
0 Kudos

Hi Aruthra,

I suppose your question is how to right-justify / left justify the output.

You can make use of formatting option of write statement.

See this code.

data value type i value 10.

write: value right-justified.

For more details, just refer the SAP Help.

Regards,

SP.