2011 Feb 08 12:20 AM
Yo Gurus,
I am trying to import data from a .csv flat file via ABAP in BW.
The data is externally sourced and I have no control over its quality.
Sometimes the data has bad characters that stop the .csv split working when I try to load via a DTP.
To avoid this I have an ABAP that runs through the input record and replaces bad characters with spaces.
So far so good.
The problem occurs when the input record extends past 1000 characters - ABAP simply truncates it at the 1000 character limit and I cannot check beyond this and my nice clean output record is also truncated at 1000 characters.
Undoubtedly there is a simple solution to this but it eludes me - please help
Many thanks,
Pierre
Yo Gurus,
I am trying to import data from a .csv flat file via ABAP in BW.
The data is externally sourced and I have no control over its quality.
Sometimes the data has bad characters that stop the .csv split working when I try to load via a DTP.
To avoid this I have an ABAP that runs through the input record and replaces bad characters with spaces.
So far so good.
The problem occurs when the input record extends past 1000 characters - ABAP simply truncates it at the 1000 character limit and I cannot check beyond this and my nice clean output record is also truncated at 1000 characters.
Undoubtedly there is a simple solution to this but it eludes me - please help
Many thanks,
Pierre
2011 Feb 08 12:58 PM
data type you're using in your input?
I declare lv_input(65535) type c, since that's the longest character field/value I can deal with in ABAP (but I can't save that length to a table)..works great for handling an input of unknown length.
What are you seeing or using that makes you think you have a 1000 character limit? GUI_UPLOAD will handle 1024, but read dataset from the apps server removes that limitation.
2011 Feb 08 10:10 PM
I'm using 'read dataset' and the Abap has no problem defining large character fields - it's the read that truncates the input at 1000 characters
I proved it by a adding a series of write statements to dump the contents of the input area:
READ DATASET V_inFILENAME MAXIMUM LENGTH 5000 INTO V_input_area.
write: /3 'V_input_area = ', V_input_area+0(100).
write: /1 '101 ', V_input_area+100(100).
write: /1 '201 ', V_input_area+200(100)....and so on.
The input is being truncated at 1000 characters - perhaps there's a system parametersomewhere that I'm not aware of?