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

Problem in updating table

Former Member
0 Likes
2,154

Hi,

I have a prolem in updating value in new field.

I have a Z - table ZABC with three fields. I have added one more colunm in ZABC.

There are already few rows avaiable in this table.Now i want to update a new Col which i have added to this table.

But while going for a insert i am unable to find the new col which i have added.i can see all the prev col already there.

Can anyone help me out. Did i missed any step while adding a col to existing table.

Vikrant

14 REPLIES 14
Read only

Former Member
0 Likes
1,694

Hi,

try using modify with where condition.

modify table itab from fs where field1 = 'XYZ'.

Read only

Former Member
0 Likes
1,694

hello,

initially you insert itab of specific column then ...

YOU MUST KEEP IN LOOP FOR FUNCTIONING.

HERE IS THE SYNTAX FOR YOU.

LOOP AT ITAB INTO WA.

INSERT ITAB INDEX 1.

MODIFY ITAB FROM WA.

ENDLOOP.

with regards,

sumanth reddy

Edited by: sumanth reddy on Feb 12, 2009 8:14 AM

Read only

Former Member
0 Likes
1,694

Hi ,

Please check in debugging if the sy-subrc value is set 0 . Ans also check teh sy-dbcnt value .It gives the number of lines changed.

Believe that you have activated and adjusted the old table that is modified with a column .

Regards,

Radhika.

Read only

Former Member
0 Likes
1,694

Hi,

Make sure that you have activated the table after making the modifications.

Hope this helps.

Regards.

Read only

Former Member
0 Likes
1,694

hi,

Since its that you are updating the already existing values in DBTABLE,

use,

UPDATE DBTAB FROM W_A.
UPDATE DBTAB FROM TABLE itab

Make sure the primary key specification is done perfectly with respect to data base table.

Read only

Former Member
0 Likes
1,694

Hi vikrant ,

Goto se14 -- > give the table name and press edit.

Then press Adjust and activate table button .

If u want to delete the contents of the table then u can choose the radio button "Delete Data" instead of "save data"

Now make changes in ur table and activate it.

Hope ur pblm is solved .

Read only

Former Member
0 Likes
1,694

Hi,

first declare internal table as that of your Z custom table.

  • internal tables

DATA : i_table TYPE TABLE OF z_custom_table.

  • work areas

DATA : i_table_line LIKE LINE OF i_table.

Then update your Zcustom table with the help of internal table work area.

INSERT INTO z_custom_table VALUES i_table_line.

COMMIT WORK.

Hope this works for you.

Thanks.............

Edited by: Mandar kale on Feb 12, 2009 10:18 AM

Read only

Former Member
0 Likes
1,694

hi,

May be u have not activated the table after thet new coloum,

Please check that.

hope this helps u.

Read only

Former Member
0 Likes
1,694

Hi, You can use modify stataement with key fileds .

so that for that key field wta ever value your are giving for extra it will take without changing the data of other fields for that key./

thanks

Rajendra

Read only

Former Member
0 Likes
1,694

Hi Vikrant

After changing modifications to table please activate the table and instead of using INSERT Statement we can go for MODIFY.you added one more column to the table so in this case if you use MODIFY you can modify the previous entries.Using INSERT we cannot change any modifications,if we are inserting the same record which is already in the table it will go for short dump.so go for MODIFY statement.

MODIFY dbtable from workarea.

Thanks.

Read only

Former Member
0 Likes
1,694

hi,

did u activated the table using se14 transaction if not activate it. and try.

thanq,

rajesh.k

Read only

Former Member
0 Likes
1,694

Hi,

Write program to download existing records in that Ztab and delecte records from that table. Goto menu active and adjust database table and activate that. Now upload the data in that ztable.

Regards

Md.MahaboobKhan

Read only

Former Member
0 Likes
1,694

As JK anwer You need go to transaction SE14.

Give the table name and press edit.

Then press Adjust and activate table button. The option save data must be flaged, but if you dont need the old data you can flag delete data (I guest the last one is the best choise).

good lucky.

Read only

Former Member
0 Likes
1,694

thanks