Skip to Content
author's profile photo Former Member
Former Member

uploading text to ztable

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 02:44 PM

    Hello Swathi,

    Could you tell ur requirement more precise.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 02:50 PM

    SPLIT itab-text at ',' into v_char1 v_char2....

    you have to use all character type fields in SPLIT.

    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

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.