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

WRITE issue with a N type

Former Member
0 Likes
898

Hi, follows the scenario I'm using for the following question (I'm using ABAP/6):

DATA v8(7) TYPE N value '1234567'.

WRITE: / 'V8: ', v8.

--> there's a space after V8:

The output shows V8: 1234567 - with TWO spaces after V8:.

If, however, I use

WRITE: / 'V8: ' NO-GAP, v8

, the output shows the expected result:

V8: 1234567

instead of

V8:  1234567

My question is, thus: why does the sole WRITE command displays this 2nd space in the output ? It may have something to do with the N type, perhaps, but I declared a 7-long N field and I filled it all.

Thanks,

Avraham

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
876

When U write two variables .. they'll be separated by space..

In your case UR writing ( 'V8: ', v8 ) ..

One space is of 'V8: ' .. the other will be like a separator ..

Instead write ..

Write :/3 'V8: ',

7 v8.

8 REPLIES 8
Read only

Former Member
0 Likes
876

Hello,

Can U check if in ur write stmnt:

WRITE: / 'V8: ', v8.

there is a gap between ': and the '.

Reward, if it works,

Rgds,

Raghu.

Read only

Former Member
0 Likes
876

hi,

do this way ...

Make use of concatenate statement ...


data: v_final(10).

concatenate 'V8: ' v8 into v_final.

WRITE: / v_final.

Read only

Former Member
0 Likes
876

use this..

why are you giving space next to 'V8: '

WRITE: / 'V8:', v8.

Read only

Former Member
0 Likes
876

Hi,

DATA v8(7) TYPE N value '1234567'.
WRITE: / 'V8:' no-gap , v8.

remove the space after 'v8:' .

Regards

Adil

Read only

Former Member
0 Likes
876

hiii

gap will be display because you have put gap between V8: & '...

so change it like below.No-gap will delete space but after ', only

WRITE: / 'V8:', v8.

reward if useful

thx

twinkal

Read only

0 Likes
876

I may not have made myself clear, I know how to solve the problem, all I wanted was an answer for why does this happen. Where does the 2nd space come from.

Avraham

Read only

Former Member
0 Likes
876

Hi Avraham,

Just do the following.

write:/ ' V8: ', 3 V8.

here 3 is the number of spaces you want. It can be any number.

Hope this helps you.

Any queries, please get back to me.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
877

When U write two variables .. they'll be separated by space..

In your case UR writing ( 'V8: ', v8 ) ..

One space is of 'V8: ' .. the other will be like a separator ..

Instead write ..

Write :/3 'V8: ',

7 v8.