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

Update DB table

Former Member
0 Likes
878

Hi,

I want to update a standard DB table, but the structure of my internal table is different from the structure of the DB table.

ex: DB Table structure:

field1

field2

field3

IT structure is

field1

field3.

When we try to update the DB Table using this ITAB its giving error "The Work area 'ITAB' is not long enough'.

Help and suggestions will be much appreciated.

Thanks & Regards.

Ramesh.

1 ACCEPTED SOLUTION
Read only

former_member229729
Active Participant
0 Likes
842

Hi Ramesh,

The Internal Table must of the same type of Standard Table.

Hence, create an ITAB of Standard Table type. And try with the syntax "MODIFY".

Rgds,

Ramani N

8 REPLIES 8
Read only

former_member229729
Active Participant
0 Likes
843

Hi Ramesh,

The Internal Table must of the same type of Standard Table.

Hence, create an ITAB of Standard Table type. And try with the syntax "MODIFY".

Rgds,

Ramani N

Read only

0 Likes
842

Hi,

The requirement is to update only those 3 fields in the DB table not the entire table.

Thanks & Regards.

Ramesh

Read only

Former Member
0 Likes
842

Try with the structure of same tyoe as of the Database Table, and fill only those fields of the strcuture that you are looking to update.

Read only

0 Likes
842

Hi,

Try with the structure of same tyoe as of the Database Table, and fill only those fields of the strcuture that you are looking to update

When we tried with the same structure if DB table the field values are mispalced in 1st three fields and not in the correcponding fields.

ex: wa like <DB Table>

loop at itab into wa

update <DB Table> from wa.

endloop.

Thanks & Regards.

Ramesh

Read only

0 Likes
842

Hi,

Sorry there was some typing mistake.

The exact scenario is when we tried with the same structure like DB table, the field values are mispalced in the work area (i.e)fields values and not in the correcponding fields.

Here is the syntax which we used

data: wa like <DB Table>

loop at itab into wa

update <DB Table> from wa.

endloop.

Thanks & Regards.

Ramesh

Read only

0 Likes
842

Hi Ramesh,

Make use of other alternative of UPDATE command.

Update dbtable

SET field1 = itab1-field1

field2 = itab1-field2

where (conditions if you have any).

Using the above alternative of UPDATE stament you can set values for particular fields of the database table.

Hope this helps.

Thanks & Regards,

Anand Patil

Read only

Former Member
Read only

Former Member
0 Likes
842

Resolved the Issue