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

Report Output

Former Member
0 Likes
916

Hello friends,

I have everything in atext file and am looping the text file and writing it out.

LOOP AT IT_OUTFILE.

IF IT_OUTFILE(4) = '520I'.

WRITE : / IT_OUTFILE(4),

IT_OUTFILE+4(8) COLOR COL_TOTAL,

IT_OUTFILE+12(22).

ELSE.

WRITE : / IT_OUTFILE.

ENDIF.

CLEAR : IT_OUTFILE.

ENDLOOP.

The problem is it is writing everything but after the first 4 characters with the If clause there is a space and then the next 8 char and tehn a space and the rest. I dont want the spaces.

Any suggestions,

MAdhu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
890

Hi,

Ok..got it..Use the column position when writing..

Example

-


DATA: IT_OUTFILE TYPE STRING OCCURS 0 WITH HEADER LINE.

IT_OUTFILE = '123412345678901234'.append it_outfile.

LOOP AT it_outfile.

write : / it_outfile(4).

format color 3 on.

write: <b>5(10)</b> it_outfile+4(10).

format color off.

write: <b>15</b> it_outfile+14.

ENDLOOP.

Thanks,

Naren

Hello friends,

I have everything in atext file and am looping the text file and writing it out.

LOOP AT IT_OUTFILE.

IF IT_OUTFILE(4) = '520I'.

WRITE : / IT_OUTFILE(4),

IT_OUTFILE+4(8) COLOR COL_TOTAL,

IT_OUTFILE+12(22).

ELSE.

WRITE : / IT_OUTFILE.

ENDIF.

CLEAR : IT_OUTFILE.

ENDLOOP.

The problem is it is writing everything but after the first 4 characters with the If clause there is a space and then the next 8 char and tehn a space and the rest. I dont want the spaces.

Any suggestions,

MAdhu.

6 REPLIES 6
Read only

Former Member
0 Likes
890

Hi,

In the report output you don't want to have spaces in between columns..

Example

-


Instead of displaying

1234 12345678 90 1111 2222

You want

1234123456789011112222.

Thanks,

Naren

Read only

0 Likes
890

Thanks Naren,

I didnt understand what u meant. I am having my output as

1234 99999999 123456789

but i want my output as

123499999999123456789

Let me know how can i get this

Thanks, Madhu.

Read only

Former Member
0 Likes
890

Hi,

Check this example..

DATA: it_split TYPE string OCCURS 0 WITH HEADER LINE.

DATA: v_string TYPE string.

  • Process the internal table.

LOOP AT it_outfile.

REFRESH: it_split.

CLEAR: v_string.

  • Split the record at space.

SPLIT it_outfile AT ' ' INTO TABLE it_split.

LOOP AT it_split.

  • Concatenate and store it in the string.

CONCATENATE v_string it_split INTO v_string.

ENDLOOP.

  • Display the string.

WRITE: / v_string.

ENDLOOP.

Hope this helps..

Thanks,

Naren

Read only

0 Likes
890

Thanks Naren.

I looked into the example but it dosent satisfy my condition.

mu output should be exactly like this

123499999999PD : 01 01/03/2007

When i am using just the write statement everything looks good but when i am coloring the the 8 characters after 1234 the output changes.

it looks like this

1234 99999999 PD : 01 01/03/2007

Thanks for the Help.

MADHU

Read only

Former Member
0 Likes
891

Hi,

Ok..got it..Use the column position when writing..

Example

-


DATA: IT_OUTFILE TYPE STRING OCCURS 0 WITH HEADER LINE.

IT_OUTFILE = '123412345678901234'.append it_outfile.

LOOP AT it_outfile.

write : / it_outfile(4).

format color 3 on.

write: <b>5(10)</b> it_outfile+4(10).

format color off.

write: <b>15</b> it_outfile+14.

ENDLOOP.

Thanks,

Naren

Read only

0 Likes
890

Thanks Got it.

MAdhu