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

restrict blank spaces

Former Member
0 Likes
1,071

Hi Experts,

In a Report Program i am printing text say mail id seventy characters. In some cases if there is no value in that field i am getting blank spaces (70 blank spaces) i don't want this 70 blank spaces to be printed how to i restrict this blank spaces.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
987

hi,

check if the field has value, before printing:

IF email IS NOT INITIAL.
WRITE email.
ENDIF.

hope this helps

ec

hi,

check if the field has value, before printing:

IF email IS NOT INITIAL.
WRITE email.
ENDIF.

hope this helps

ec

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
988

hi,

check if the field has value, before printing:

IF email IS NOT INITIAL.
WRITE email.
ENDIF.

hope this helps

ec

Read only

Former Member
0 Likes
987

hii

you can use

CONDENSE STRING NO-GAPS.

regards

twinkal

Read only

Former Member
0 Likes
987

Use key word CONDENSE...

It is used to remove blank spaces...

Regards,

Kunjal

Read only

Former Member
0 Likes
987

Hi Hari,

Suppose the Firld for email in in the internal table is email.

Write-

Delete  t_email  from wa_email where email = '  '.

now print this internal table.

Regards,

Sujit

Read only

kostas_tsioubris
Contributor
0 Likes
987

Hi,

if you want to print only the the number of the characters and no blank spaces (e.g if mail is mail_id (at) mail-server.com and you want to print only the first 23 characters) use something like this.

DATA: mail(70) TYPE c,
      length TYPE i.

mail = 'mail_id (at) mail_server.com'.

length = STRLEN( mail ).
IF length > 0.
  WRITE mail(length).
ENDIF.

Kostas