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

Truncating the initial space

Former Member
0 Likes
816

Hello,

Say for example I would like to print the following line on the report:

title:0

where 0 is passed in as a variable var type i

However, if I do

write: 'title:', var.

I ended up getting something like

title: 0

How can I remove the space before the 0, thank a lot!

Regards,

Anyi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
788

Hi

DATA: VAR TYPE I.

WRITE: 'title:' NO-GAP, VAR LEFT-JUSTIFiED NO-GAP.

Max

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
788

You can do something like this.



report zrich_0001.

data: value type i value 0.
data: value_c(4) type c.
data: output(30) type c value 'Title:'.

value_c = value.
concatenate output value_c into output.
condense output no-gaps.

write:/ output.

Regards,

Rich heilman

Read only

Former Member
0 Likes
788

data: thestring(40).

data: str_i(5).

data: var type i.

str_i = var.

concatenate 'title:' str_i into thestring.

condense TheString no-gaps.

write:/ TheString.

Read only

Former Member
0 Likes
789

Hi

DATA: VAR TYPE I.

WRITE: 'title:' NO-GAP, VAR LEFT-JUSTIFiED NO-GAP.

Max

Read only

Former Member
0 Likes
788

try concatenating 'TITLE' VAR INTO LOCALVAR.

WRITE: LOCALVAR.

Read only

Former Member
0 Likes
788

hi

write: 'title:' no-gap, var no-gap.

Regards,

Ramesh.

Read only

0 Likes
788

or

WRITE: 'title:' NO-GAP, VAR LEFT-JUSTIFiED NO-GAP.

ramesh.

Read only

alejandro_lpez
Contributor
0 Likes
788

Hi Anyi,

Try using NO-GAPS, like this:

WRITE: 'A' NO-GAP, 'B' NO-GAP, 'C'. "Output: ABC

regards,

Alejandro