04-27-2006 8:23 AM
Hi Everyone,
I am picking one text file from application server in my program.The format is:
The format of the file is
ITM^^95010620T9S7^^
CONSYMU600408140GE785799475247.00
CTN100069350408001759498163450030443202400027810
While saving the text file in application server,SAP automatically inserts the character # at the end of each line and the file gets stored in this format in application server.
ITM^^95010620T9S7^^#
CONSYMU600408140GE785799475247.00#
CTN100069350408001759498163450030443202400027810#
What does this symbol # represents?
When i read the data in my internal table, the symbol # gets appended at the end of the field.
I am not able to separate the symbol # from value 27810.
I tried with this option also(carriage return)
CONSTANTS: con_cr type x value '0D'.
But not able to split my last field from symbol #.
Any idea how to get rid of symbol #.
Thanks in advance.
Regards,
Tarun
04-27-2006 8:40 AM
04-27-2006 8:34 AM
use split command
SPLIT T_FLAT AT <b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b>
<b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b> this represent #
regards
vinod
04-27-2006 8:37 AM
hi,
This question was asked many times in the forum so please search for the same
Regards,
Santosh
04-27-2006 8:40 AM
Hi Vinod,
I tried with the method provided by you but this is not working.
Any other solution about this.
Regards,
Tarun
04-27-2006 8:40 AM
04-27-2006 8:42 AM
04-27-2006 8:46 AM
Hi Tanveer,
I am opening the file in this mode:
OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
Regards,
Tarun
04-27-2006 8:55 AM
Hi,
In my case, the symbol # automatically gets appended at the end of each line while writing data in the application server.
Any idea how to avoid this symbol #.
Regards,
Tarun
04-27-2006 9:03 AM
Hi,
in your case the '#' is coming at the end , that is indicating the newline.
ITM^^95010620T9S7^^#
CONSYMU600408140GE785799475247.00#
CTN100069350408001759498163450030443202400027810#
if you want to avoid that you need to use
replace all occurences of CL_ABAP_CHAR_UTILITIES=>NEWLINE in record with ''.
you should do it inside do loop. since for each record you need to do it.
Regards
vijay
04-27-2006 9:28 AM
Hi Vijay,
I tried now with replace option but could not succeed.
REPLACE '#' IN wa_data-height WITH ' '.
wa_data-height still contains the value 27810#
Regards,
Tarun
04-27-2006 9:37 AM
Hi Tarun,
Use this code.
data: l_sep1 TYPE c,
l_sep = cl_abap_char_utilities=>cr_lf.
REPLACE ALL OCCURRENCES OF l_sep IN l_wa_data-data WITH space.
Thanks
Swagatika
04-27-2006 8:57 AM
Dear TRun,
Try using the Function Module 'KCD_CSV_FILE_TO_INTERN_CONVERT'.
CYA,
YJR.