09-08-2006 3:41 PM
Hi all,
I am uploading a file to a ztable.
1)uploading to internal table
data : begin of i_file occurs 0,
text(1024) type c,
end of i_file.
2)i am splitting i_file into itab
in which i have a quantity field .
"Itab-quantity" must be a character data object (data type C, N, D, T or STRING). field string).
can anyone tell me how to go about this.
when i am moving
09-08-2006 3:44 PM
09-08-2006 3:45 PM
Hi,
Declare all the fields in itab of type c and then move these fields into another internal table with actual data types. Keep the field names in both the internal tables identical.
Hope this helps.
09-08-2006 3:46 PM
Hi,
data itab like ztable occurs 0 with header line.
insert ztable from table itab.
define qty as character in ztable .
Regards
Amole
09-08-2006 3:50 PM
you can use the FM GUI_UPLOAD to upload the file.
call function 'gui_upload'
exporting
filename = 'C:\test.txt'
tables
dtab = i_file.
Loop at i_file.
*Split the data from i_file into your itab.
*it depends whether your file is delimited or fix width.
*Fix Width and in the same order as itab.
itab = i_file.
*Fix Width but different order.
itab-f1 = i_file+0(1).
itab-f2 = i_file+10(30).
*Delimimted
split i_file at '|' into table itab.
append itab.
endloop.
09-08-2006 3:50 PM
SPLIT itab-text at ',' into v_char1 v_char2....
you have to use all character type fields in SPLIT.
<b>this is a required one in UNICODE SYSTEM. you have to use ONLY CHARACTER TYPE FIELDS( C,N,D,T and STRING types) only in character functions.So what you can do is, use all character type fields in SPLIT then pass these values to the quantity or currency fields</b>
example :
data : v_char1(20) type c,
v_char2(20) type c.
data: begin of itab occurs 0,
f1 type brgew,
f2 type ntgew,
end of itab.
<b>SPLIT V_STR AT ',' INTO V_CHAR1 V_CHAR2.
ITAB-F1 = V_CHAR1.
ITAB-F2 = V_CHAR2.</b>APPEND ITAB.
like this you have to write the logic.
Regards,
srikanth.
Message was edited by: Srikanth Kidambi
09-08-2006 3:55 PM
Hi,
You can't use the Split option with Currency/quantity field. so you should change that to Char and split.
then you will not get that error.
Regards
vijay