Application Development 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: 

uploading text to ztable

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Hello Swathi,

Could you tell ur requirement more precise.

Vasanth

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

data itab like ztable occurs 0 with header line.

insert ztable from table itab.

define qty as character in ztable .

Regards

Amole

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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