2009 Jun 23 9:35 AM
Hi,
Im creating one extract file in application server, and i need to replace all # symbols occured in the file with space. I used
1): REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>CR_LF
IN WorkArea WITH space.
2): REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>newline
IN WorkArea WITH space.
3): REPLACE ALL OCCURRENCES OF '#'
IN WorkArea WITH space.
First is not working.
second is also not working.
third is working in DEV but when the object was moved to next environment(Quality Server) its not working.
Since the third option was already moved to quality and its not working over there, I tried other 2 option but they are not working in Development server.
Please suggest how to fix this issue.
Thanks,
Amal
2009 Jun 23 9:40 AM
Hello,
Im creating one extract file in application server
Then go & check in your code how you have populated the file. I suppose that if you use CRLF or NEWLINE as a separator, then they will be displayed as '#' in the file.
But if you download the file to presentation server you can see the file is being displayed correctly (w/o any '#').
BR,
Suhas
2009 Jun 23 9:49 AM
Im creating a file as tab delimiter using cl_abap_char_utilities=>horizontal_tab. So before creating im trying to replace all '#' symbols in the workarea with space, but its replacing in Development server but not in Quality server.
When I download the file its having the '#' symbol in it.
Thanks,
Amal
2009 Jun 23 9:45 AM
Hi,
Use TRANSLATE V_VAL USING '# space'.
Thanks & Regards
Rajasekhar.T
2009 Jun 23 9:50 AM
I tried translate also, its working in DEvelopment but not in quality server...
2009 Jun 23 9:47 AM
Hi ,
The third dtatement should work in the quality also .
I think you are downloading using binary mode.
Try to download it from the application server in TEXT MODE .
If you read or transfer from the application server in text mode the # will not come.
...... .. IN TEXT MODE ENCODING DEFAULT.
Regards
Pinaki
2009 Jun 23 9:55 AM
Im creating the file in application server using
OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
The main issue is, REPLACE and TRANSLATE is working in development server but not in quality server.
Thanks,
Amal
2009 Jun 23 9:53 AM
Hi,
Try like below:
data: l_sel type CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
REPLACE ALL OCCURRENCES OF l_sel IN WorkArea WITH space.
Regards,
Himanshu
2009 Jun 23 9:59 AM
I tried as,
data: l_sel type CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
REPLACE ALL OCCURRENCES OF l_sel IN WorkArea WITH space.
but its not working.
Thanks,
Amal
2009 Jun 23 10:07 AM
Hey Man,
A small issue there it should be like below:
data: l_sel value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
Regards,
Himanshu
2009 Jun 23 10:25 AM
I tried using variable by assigning horizandal tab to it and used it and used directly. both not working.
data: l_hash value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
IN WorArea
WITH space.
REPLACE ALL OCCURRENCES OF l_hash
IN WorArea
WITH space.
It loks like something related to system or appliction settings. but i dont what is missing.
2009 Jun 23 10:04 AM
Hi Amal,
I dont see any issue with # displayed in a file when you open it in AL11.
Download the file to presentation server ( your local system) using CG3Y transaction & check the file -- # will not be displayed.
Thanks,
Best regards,
Prashant
2009 Jun 23 10:27 AM
User is using some third party tool to download file from application server. and its considering as ab delimited if its having # symbol in file.
2009 Jun 23 10:35 AM
Hello,
Does the user need the file to be tab delimited? If so keep your logic, else as suggested by Prashant remove it.
Its for the best interest of both.
BR,
Suhas
2009 Jun 23 10:40 AM
2009 Jun 23 10:31 AM
Hi Amal,
Well in that case i would suggest to change the logic of populating the file itself.
Remove the logic of including a TAB between data of each field. You will have to modify the OPEN DATASET... TRANSFER... logic.
Thanks,
Best regards,
Prashant
2009 Jun 23 10:38 AM
Prashant,
Before populating the field values into ITAB im replacing all # with space. And its working for few occurance. Its not working only in few places. Example, the symbol in the text as " something having text with symbol##' , the last 2 character having #, but those are not replacing by space. I felt its not workin only when # symbol is having in the last. So i tried to replace line feed asREPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>CR_LF. but that also didnot works.
-Amal
2009 Jun 23 10:47 AM
Hello Amal,
For replacing # with space write the following code:
CONSTANTS: c_hash TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf.
REPLACE ALL OCCURRENCES OF c_hash IN workarea WITH ' '.
And the process of adding space is Type 'and then press Alt type 255 and remove Alt. This will take one space. Then close by '.
Definately this will solve your problem.
Thanks,
Shobhit
2009 Jun 23 11:08 AM
2009 Jun 23 11:19 AM
I have also faced the same problem. As per my understanding this is a interface program and code is written in include which gets triggers when outbound or may be inbound delivery is created. When user maintains the text # gets appended and due to which new line gets created. So we need to replace this by space. By direclty writting Space in syntax Replace all occurance is not readable to editor. We need to do Alt 255 to make that in ASCII. If you require sample code i can send it to you.
Thanks,
Shobhit
2009 Jun 23 11:35 AM
Shobhit,
when I tried using replace all occurance of WA with space its working in DEV server but when its moved to QTY server its not working..
Please provide sample code
Thanks,
amal
Edited by: Amal on Jun 23, 2009 10:36 AM
2015 Feb 24 8:47 AM
Hello,
I also faced the same issue.. got resolved by using the following statement.
OPEN DATASET FILEPATH FOR INPUT IN TEXT MODE
ENCODING UTF-8 WITH WINDOWS LINEFEED SKIPPING BYTE-ORDER MARK
IGNORING CONVERSION ERRORS.
Thanks,
Prakash