2007 Jan 03 11:48 PM
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.
2007 Jan 04 12:25 AM
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.
2007 Jan 03 11:58 PM
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
2007 Jan 04 12:00 AM
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.
2007 Jan 04 12:07 AM
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
2007 Jan 04 12:14 AM
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
2007 Jan 04 12:25 AM
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
2007 Jan 04 12:45 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |