‎2008 Dec 03 4:56 PM
Hello,
I've added a new field (key) to an existing database table. Is there an "easy" way to populate field without writing an ABAP program?
FYI: I know field is populated with initial values per field data type when table activated. I want to initially populate with a "real" value.
Thanks in advance,
Billy
‎2008 Dec 03 5:41 PM
there is NO way, easy or otherwise; to populate the new field for the existing records as you have defined that as a key field
‎2008 Dec 03 6:04 PM
Thanks MxG....If it wasn't a key field what would you suggest?
‎2008 Dec 03 6:06 PM
go to se11 create a table maintenence for your table once you have created that ,go to SM30 and start maintaining your table.
In this case you don`t need to write any ABAP Program.
Regards
Neha
Edited by: Neha Shukla on Dec 3, 2008 11:36 PM
‎2008 Dec 03 6:14 PM
Thanks Neha..I did consider that but there are thousands of existing records.
‎2008 Dec 03 6:20 PM
Hi ,
Better write the program in case of having thousand of records rather than the entering through SM30 .
regards,
Bharani
‎2008 Dec 03 6:25 PM
I for myself will write simple code using ABAP query to update the non key field for a custom table if needed
‎2008 Dec 04 12:43 AM
Hi
Generate the table maintains from SE11. Create a LSMW to fill the field from SM30. if the table data in DEV and PRD are same you can atttach the new rows into a request and can transport it to PRD.
You can minimise the efforts this way.
Thanks
Lakshman
‎2008 Dec 08 10:13 PM
Hi
A simple piece of code in program which updates the table field seems very appropriate. ( if the values that need to be updated are less in number and the conditions precise ).
Regards
Raj
Edited by: Rajasekhar Dinavahi on Dec 9, 2008 3:43 AM
‎2008 Dec 16 1:52 PM
Thanks to all who replied....I considered most suggested (SM30, LSMW, ABAP, etc). I was hoping that database utility (SE14) was "smart enough" to reorganize data but obviously not. I probably should have been more specific in my question, but I didn't want to preclude another possibility. Again, thanks to all. FYI: ABAP is the path I choose.
‎2011 Dec 12 9:49 AM
how to populate custom database table through abap program. ? write sample code
‎2011 Dec 12 10:32 AM
Hello friend,
This is the simple code for populating the custom table.
select * from scarr into TABLE t_scarr.
loop at t_scarr into x_scarr.
insert zrtest1 from x_scarr.
ENDLOOP.
zrtest1 is the custom table which will be now populated with the values from the internal table t_scarr which in turn are having the values from scarr.
Thanks,
Sri Hari
‎2011 Dec 13 6:49 AM
Hi,
By using Data Base Structures you can Add any number of new fields to an existing Table.
Warm Regards,
PavanKumar.G
‎2012 Jan 04 8:52 AM
You have added a new field as a primary key in an existing table which is having lots of entries and now you want to fill this field with some real value for all the existing entries.
A lot depends on the usage of this field,the kind of data that it is going to hold and were there any existing programs which is already having some logic build up based on the existing primary keys of this table.
1.If this Z table is getting updated from any standard transaction then it doesn't make any sense to populate a value to existing entries because the existing data is TRANSACTION DATA.
2.Won't this affect the existing programs logic if they are already using this table.
3.I suggest better you do a where used list of this table and check what are the programs that are already using this and accordingly take a call.
Thanks,
K.Kiran.
‎2012 Jan 04 8:57 AM
Deleted as the same reply got posted twice.
Edited by: Kiran K on Jan 4, 2012 9:57 AM