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

Change field type

Hi,

I have a select query in which I am using FOR ALL ENTRIES IN itab. The internal table's field which I need to compare has type of CHAR 10 but the field in the database table has type CHAR 90. I need to make both the fields of the same type. Please advice me how can I do that.

Thanks,

Abhishek

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:15 AM

    Dear,

    Define other Itab with same fields of the forall entries internal table except one change that is change char 10 field to char 90.

    Using move u can fill the itab from previous internal table.

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:14 AM

    hi....

    in the internal table itself you can declare a field of 90 characters rather than uing it of 10 characters.why are you using it of 10 characters...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:14 AM

    make your internal table field 90 charcters.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:16 AM

    hi,

    You can very easily change the size of Your internal Table field.

    This will be very beneficial.

    Regards

    Sumit Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 07, 2008 at 10:16 AM

    suppose itab1 is the table which has the field of type char10.

    Declare another internal table itab2 which will have the field of type char90.

    fill the itab1 in the normal way.

    Then write

    itab2 [ ] = itab1[ ].

    then use itab2[] in the select query whr u r using For all entries...

    Hope it helps...

    Reward points if useful....

    Edited by: Rudra Prasanna Mohapatra on Jul 7, 2008 12:16 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:16 AM

    Hi,

    If The Database Table is SAP Standard Table you can not change it without Access key.

    To Change that you have to Go for ALTER table ,Again you have to think about the Data in that table.You May Lost Data if you Decrease teh The Field Length.

    It s better To change the Internal table field Type according to the Database Table.

    In this case you do not have to bother about the data in Database table.

    Regards,

    Sujit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:17 AM

    Hi Abhishek,

    Its better to change you internal table field length to 90 characters.

    Hope this helps you,

    Regards,

    Chandra Sekhar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:18 AM

    hi abhishek,

    in the condition of FOR ALL ENTRIES you have to go same type. so in this case you have to change the length of the field of your internal table..

    with luck,

    pritam.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 11:39 AM

    Hi,

    Try the following...

    DATA: Begin of ITAB...... .

    FLD1 TYPE <DB Table>-<Field Name>.

    (In this case the field name is the one which is of

    90 characters length.

    .................

    .................

    End of ITAB.

    Hope it helps you.

    Murthy.

    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.