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

itab spaces

Former Member
0 Likes
879

Hi experts,

Iam working on smartforms and i have to display 6 field values.One of the fields having long text with 40 charecters.If longtext is not having any value,my data is getting misalligned.

So i want to pass some space into that field to avoid misalignment for the next few fields.


DATA: G_LENG(50) VALUE '                '.

IF WA_DET-LTEXT = SPACE.
   WA_DET-LTEXT = G_LENG.
ENDIF.   

Why this code is not working? Means,it is not taking it is as space.Still data is misaligning.

What i need to do?

Thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
818

Hi Kaki,

It should work, I think you are missing somthing else. I tried with a sample code:


REPORT ztest .

DATA: G_LENG(50) VALUE ' '.

write : 'test', g_leng, 'done'.

Regards,

Anjali

Hi Kaki,

It should work, I think you are missing somthing else. I tried with a sample code:


REPORT ztest .

DATA: G_LENG(50) VALUE ' '.

write : 'test', g_leng, 'done'.

Regards,

Anjali

4 REPLIES 4
Read only

Former Member
0 Likes
818

create template and assing the variables ...

I think this may work?

Read only

Former Member
0 Likes
818

Hi Kaki

Your code'll do nothing.

You're saying: if no value is in my variable, so my variable is equal no value... it's strange, isn't it?

If you want to be sure of allignement why don't you use a TEMPLATE?

Max

Read only

Former Member
0 Likes
818

Hi kaki,

1. for such ALIGNMENT PROBLEMS,

2. the best thing is to

use TAB Concept (just like sapscript)

3. I don't know about smartforms,

but some concept must be there.

4. This alignment will also cause problem,

even when the string is there,

but IN CAPITAL letter,

bcos

CAPITAL character takes more space,

as compared to lower case,

and a SPACE takes even less width.

5. However, if the font is COURIER,

then it will have fixed width of ANY CHARACTER,

whether space, lowercase, or capital !!!

regards,

amit m.

Read only

Former Member
0 Likes
819

Hi Kaki,

It should work, I think you are missing somthing else. I tried with a sample code:


REPORT ztest .

DATA: G_LENG(50) VALUE ' '.

write : 'test', g_leng, 'done'.

Regards,

Anjali