Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to avoid the split problem when uploading the data from csv file

Former Member
0 Likes
823

Dear Friends,

I have to upload data from the .csv file to my custom table , i have found a problem when uploading the data .

i am using the code as below , please suggest me what i have to do in this regard

SPLIT wa_raw_csv AT ',' INTO

wa_empdata_csv-status

wa_empdata_csv-userid

wa_empdata_csv-username

wa_empdata_csv-Title

wa_empdata_csv-department.

APPEND wa_empdata_csv TO itab.

in the flat file i can see for one of the record for the field Title as

Director, Finance - NAR............there by through my code the wa_empdata_csv-Title is getting splited data as "Director, and Department field is getting Finance - NAR" , i can see that even though " Director, Finance - NAR" is one word it is getting split .

.......which is the problem iam facing.Please could any body let me know how in this case i should handle in my code that this word

"Director,Finance - NAR" wil not be split into two words.

Thanks & Records

Madhuri

2 REPLIES 2
Read only

Former Member
0 Likes
496

Hi Madhuri,

Best way to avoid such problem is to use TAB delimited file instead of comma separated data. Generally TAB does not appear in data.

If you are generating the file, use tab instead of comma.

If you cannot modify the format of file and data length in file is fixed character, you will need to define the structure and then move data in fixed length structure.

Regards,

Mohaiyuddin

Read only

Former Member
0 Likes
496

Hi Madhuri,

The best way is try to save ur file in other way. i.e you change the delimiter anything other than comma. Or other way is ( Actually it is not the right way) but if only one record is of this type u can just remove comma while uploading. after the record is uploaded u can place it again. Try and also plzz let me know whether we can do this way.

Regards,

Swapna.