09-01-2014 11:57 AM
Dear All,
Can you help me about the problem stated in this thread.
Basically, I have program that Get data from the SAP Server AL11.
The problem is i cannot strip the CR/LF from the file: The file looks like this - " BE10#A#L1211000#ZZZZZZZZ#WD-5#9:00 " .
Ive used the following method but none of them worked.
Note: the file if rom a EXCEL -> then i copy it to a NOTEPAD -> then upload it using CG3Z.
You response is highly appreciated.
09-01-2014 12:23 PM
Hi,
Please use the debugger to find out what is this pesky character....
Here we can see a string that was composed using:
DATA: my_string TYPE string .
CONSTANTS: c_ccc TYPE string VALUE 'aaaa' .
CONCATENATE c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
INTO my_string .
This is a Unicode system.
we can see the 0900 which is the cl_abap_char_utilities=>horizontal_tab
6100 6100 6100 6100 0900 610061006100610009006100610061006100090061006100610061000900
Regards.
09-01-2014 11:59 AM
Hi Mark
Did you try using split statement. It may look like # but can be a junk character not sure
Nabheet
09-01-2014 12:00 PM
Hi
You should use your first method (based on cl_abap_char_utilities=>cr_lf)
Max
09-01-2014 12:03 PM
cl_abap_char_utilities=>cr_lf has length char 2
This does not work?
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN lv_char WITH space.
09-01-2014 12:04 PM
09-01-2014 12:08 PM
Yeah, it looks like it.
By the way Marky, you can check hex value of # in debbuger and see what exactly it is...
09-01-2014 12:05 PM
Hi Nabheet.
yes iused also Split..
SPLIT '#' AT lv_cr INTO: lv_bukrs
lv_mkoar
lv_vkont
lv_bkont
lv_date
lv_time.
and
SPLIT cl_abap_char_utilities=>cr_lf AT lv_cr INTO: lv_bukrs
lv_mkoar
lv_vkont
lv_bkont
lv_date
lv_time.
No good .. ..
Hello MAX...
yes.. that should be used, but i dont know why it WONT worked.
09-01-2014 12:23 PM
Hi,
Please use the debugger to find out what is this pesky character....
Here we can see a string that was composed using:
DATA: my_string TYPE string .
CONSTANTS: c_ccc TYPE string VALUE 'aaaa' .
CONCATENATE c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
c_ccc cl_abap_char_utilities=>horizontal_tab
INTO my_string .
This is a Unicode system.
we can see the 0900 which is the cl_abap_char_utilities=>horizontal_tab
6100 6100 6100 6100 0900 610061006100610009006100610061006100090061006100610061000900
Regards.
09-02-2014 2:46 AM
Thank you also Eitan,
For lending a help to remind about reading HEX values from debugger.
09-01-2014 12:33 PM
HI all,
If you notice LV_CHAR from the right pane has NO VALUE '#'
but in the left pane LV_CHAR HAS a value '#'.
its kind a weird to see this event.: the process is removing '#' is SUCCESS but the actual outcome is NOT success.
the hex value is "2004500310030000900410009004C0031003200310031003000300030000900"
09-01-2014 12:38 PM
Did you notice the repeating hex value '0900'? I think you now know which character you need to use.
09-01-2014 12:41 PM
Hi,
Have you try the split with cl_abap_char_utilities=>horizontal_tab ?
Regards.
09-02-2014 2:44 AM
Hi Suhas,
Thanks for reminding me.. the '0900' value..
I've already solved the problem.
Its just on my previous developments as always assumed that is always CR/LF. anyways thanks again for the hint.
09-01-2014 12:44 PM
Marky,
It seems you are dealing with a file where the fields are separated by #.
Open dataset
Do.
read dataset
if sy-subrc = 0.
using split statement append the data into an internal table.
else.
exit.
endif.
Enddo.
Close dataset.
cr_lf denotes end of the line.I think there is no need to consider that as long as you are reading the data from app server and not writting the data to appserver.cr_lf will be used to denote end of the line while writting a file to the appserver.
K.Kiran.
09-01-2014 1:37 PM
09-02-2014 2:47 AM