‎2006 Jan 05 2:41 PM
Hi All,
Actually while i upload the file using CSV Format , a field contains a text with comma. If i use split to delimit the comma then the fields are getting wrongly.
Please see the example given by me below
DATA
12,189,pjswami,"this is a long , statement,12
the above data contains 5 fields but the 4th field has text with comma. so the field datas are misplaced like the one given below
12
189
pjswami
"this is a long
statement,12
Please help me out as this is very very urgent.
Hope to get response immediately
Thanks
Siva
‎2006 Jan 05 2:46 PM
Well, you have two choices, you can either make sure that there are no commas in the text field before running the program, or you need to change the delimiter to something else. Personally, when doing this kind of thing, I tell the user, that there must not be any commas in the text fields.
Regards,
Rich Heilman
‎2006 Jan 05 2:46 PM
hi,
you need to use offset to achieve the proper results.
try this also
FM KCD_CSV_FILE_TO_INTERN_CONVERT.
and check ..
thanks
vijay
‎2006 Jan 05 2:57 PM
Hi Vijay,
Thanks for ur reply.
It works fine with the FM but if the total length of the text of a field is morethan 32 then it is truncated.
So, any other solution for this
Please clarify
Thanks
Siva
‎2006 Jan 05 3:07 PM
call function 'KCD_CSV_FILE_TO_INTERN_CONVERT'
exporting
i_filename = 'C:test.csv'
i_separator = ','
tables
e_intern = itab
exceptions
upload_csv = 1
upload_filetype = 2.this is how you are calling ,
then check lengths of fields are you giving correctly..
another possible solutions is
offset--->you need to take big char variable and condense it and offset accroding to the field length.
thanks
vijay
Message was edited by: Vijay Babu Dudla
‎2006 Jan 05 3:07 PM
Hi,
As you said the requirement is quite urgent,
you can do this i think.
Copy the function module into z_function module and change it as required.
*" TABLES
*" E_INTERN TYPE KCDE_INTERN
Instead of KCDE_INTERN,
create a ztable with the same fields and change the data type of the field VALUE from char to what ever you need (say char132).
*" TABLES
*" E_INTERN TYPE ztable
Regards,
Sailaja.