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

gui_upload for csv file with numeric n date fields

abaper_guy
Active Participant
0 Likes
817

Hi ,

i searched on net on how to use GUI_UPLOAD for csv files using split function but the spilt function requires that the data type of all fields of the internal table should be character whereas in my case there is a numeric n data field too.So kindly help me how to do it.

One way ppl might suggest that give all the fields as char in the internal n after recieving the data in the internal convert the required fields back to data n numeric n then finally insert to the database but if i have 80 fields u would really dont want to do that as it requires precision to convert it to the same type n length as in the original database for all the fields.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
735

An N is a character field, it just holds digits only (strange, huh? Only in SAP......Ten thousand programmers....lol)....

Read your documentation on data types.

Hi ,

i searched on net on how to use GUI_UPLOAD for csv files using split function but the spilt function requires that the data type of all fields of the internal table should be character whereas in my case there is a numeric n data field too.So kindly help me how to do it.

One way ppl might suggest that give all the fields as char in the internal n after recieving the data in the internal convert the required fields back to data n numeric n then finally insert to the database but if i have 80 fields u would really dont want to do that as it requires precision to convert it to the same type n length as in the original database for all the fields.

5 REPLIES 5
Read only

Former Member
0 Likes
736

An N is a character field, it just holds digits only (strange, huh? Only in SAP......Ten thousand programmers....lol)....

Read your documentation on data types.

Read only

0 Likes
735

yeah i guess u r talkin about NUMC but my table dont have N type , it has int4 type for the fields (4 byte integer) n spilt doesnt support it i guess

Read only

0 Likes
735

Oh...it's not an N, it's an I....big difference and demonstrates a need for precision in communication....

I'd upload, split into character fields, then put into an internal table, processing each field as needed. I usually do this with field symbols, specific data types, etc., and convert into specific fields like dats, int4, etc., based on the index of the structure as I process the fields left to right.

Read only

0 Likes
735

yeah i guess that would be a bit longer if i m having more no of fields (80) compared to ORACLE where this can be done in a shorter way.

SO i shall use 2 internal tables here rite?? i mean first one(with all fields as char) for storing the split function values and the other one (with actual data types) .CAN u plz tell me how to convert or cast from one data type to another n while moving values from 1st internal table to another which way shall i do.

Thanks for ur help n can u suggest if there is any other method for uploading csv also other than this split method n whether this method is better n faster than others.

THANX

Read only

0 Likes
735

Hey i got it using the split method. Kindly tell me is there any other method to do this which might be better n faster than this.

Thanks a lot