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

Change field type

Former Member
0 Likes
2,130

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,029

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,

9 REPLIES 9
Read only

Former Member
0 Likes
2,029

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...

Read only

Former Member
0 Likes
2,029

make your internal table field 90 charcters.

Read only

Former Member
0 Likes
2,030

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,

Read only

Former Member
0 Likes
2,029

hi,

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

This will be very beneficial.

Regards

Sumit Agarwal

Read only

former_member195383
Active Contributor
0 Likes
2,029

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

Read only

Former Member
0 Likes
2,029

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

Read only

Former Member
0 Likes
2,029

Hi Abhishek,

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

Hope this helps you,

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
2,029

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.

Read only

former_member787646
Contributor
0 Likes
2,029

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.