12-22-2008 11:34 PM
Hi, Gurus:
Our ABAP report reads flat file, the file is created by a legacy system.
Previously, it works fine.
Recently, the each line of file ended with symbol '#'.
We want to get rid of it, but not lucky:
We have tried using replace it with '', and tried using SHIFT by one space, all does not work.
Any one have good suggestion ?
Thanks in advance.
Liang
12-23-2008 4:11 AM
Hi,
Get the length of the record for each line & reduce the length by 1.
loop at gt_tab into watab.
delete trailing spaces of wa_tab-data.........
lv_len = strlen(wa_tab-data),
lv_len = lv_len - 1.
lv_data = wa_tab-data+0(lv_len). " lv_data will have the data without #
..........
.............
.............
endloop.
Best regards,
Prashant
12-23-2008 12:08 AM
12-23-2008 2:17 AM
Hi, Rich:
Thank you for your valuable input.
I have tried your suggestion, but it does not work yet:
when I debug our program, I shift the string, with only '#' left,
now I saw its value is '000D002000200020'
its type is: \TYPE=%_T00006S00000000O0000000289
any idea ?
Thanks
Liang
12-23-2008 2:20 AM
Check the file you upload.
It may have blanck space at the end. You need to clear that off before uploading into SAP.
Regards
Mohan
12-23-2008 2:32 AM
Mohankumar:
I also tried deleting all the tailing spaces and it does not help...
More ideas ?
Liang
12-23-2008 2:43 AM
Create a file on your own... Don't try to copy the values from the existiung file. You key in the values on your own... SAVE it and upload it using the same program.
This is to check whether "content of the file" coming from Legacy file is Compatible with SAP or not.
May be this would help you to find the root cause...
Regards
Mohan.
12-23-2008 2:45 AM
when you read line , you can use subtr to remove the last chacterif it is '#'.
12-23-2008 4:11 AM
Hi,
Get the length of the record for each line & reduce the length by 1.
loop at gt_tab into watab.
delete trailing spaces of wa_tab-data.........
lv_len = strlen(wa_tab-data),
lv_len = lv_len - 1.
lv_data = wa_tab-data+0(lv_len). " lv_data will have the data without #
..........
.............
.............
endloop.
Best regards,
Prashant