Application Development 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: 

Adding primary field to a customised table and maintaining records for it

Former Member
0 Kudos
384

Hi all ..

I want to enhance one customised table which has got five colomns at present , with one more column ( basically a field which is a primary key ) and that too at the begining( ie. the first field of the table )

The records in the table can be maintained by the transaction code SM30.

When I am inserting the specific field in the table by going to the transaction code SE11, and activating it then that field is not reflected in the transaction code SM30 because of which I am not able to maintain records in the table.

So now when I go to SE16 to see the records of that table , I am left with the same table with a blank new field at the begining of every record.

I would be glad if someone tells me how can I maintain those fields by goin to the transaction code SM30 so that in future also we can easily maintain the records in that table through transaction code SM30.

I hope I have made myself clear.

Thanx

17 REPLIES 17

Former Member
0 Kudos
175

Hi,

You need to regenerate the table maintainance.

Then only SM30 will show the modified structure of the table.

Also, try adusting the table by SE14.

Hope it helps..

Regards,

Shashank

Former Member
0 Kudos
175

Hi Soni,

Since you have changed the table fields.

You have to create a table maintenance generator program again...

Delete your old table maintainence program and recreate it...

Now the changes will be reflected in SM30.

Former Member
0 Kudos
175

create a maintainace view

utilities-->table maintaince generator (SE54)

use SM30 to update the records

and also better u create transactio code for this table/view using SE93( tcode type parameter transaction)

Former Member
0 Kudos
175

hi Soni,

go to <b>se14</b>,

enter the table name..

click on ADJUST AND ACTIVATE..

and then go to <b>se11</b> ..

then go to UTILITIES -> Table maintenance generator.

delete the older one and create a new one..

regards

satesh

0 Kudos
175

Hi Satesh...

Thank you for your answer..

If I follow your procedure then do I need to again insert the old records in the table or it will come automatically after I regenerate the table.?

0 Kudos
175

Hi Soni,

If you adjust the database the original field entries will remain...

0 Kudos
175

HI Soni,

No all the records will be there..

kindly close your thread if the problem is solved..

regards

satesh

0 Kudos
175

Thanks Satesh again

Now since I can see the fields in SM30 transaction code so I can create new records.So that problem is solved.

But how do I modify the already existing records in that table ( Basically I want to populate the new field content for every record ) through that transaction code?

0 Kudos
175

through SM30 and click on maitain button.

0 Kudos
175

Hi again,

1. how do I modify the already existing records in that table

Again we have to use the same sm30

to enter the value in the EXTRA FIELD

, one by one.

2. Or u can write a simple z program for doing it.

regards,

amit m.

0 Kudos
175

Yes Amit You are correct..

and thats what I did..

But All the old records are greyed out so I cant maintain it thru SM30 except the last one( in the change mode)

And regarding your second option , if I write a Z prog then will the new modified records be reflected on that SM30 screen?

Thanks

0 Kudos
175

Hi again,

1. if I write a Z prog then will the new modified records be reflected on that SM30 screen?

Definitely.

(SM30 is nothing but like se11, se16 only)

(just it provides data entry facility into the table,

thats all)

(It shows the actual table data only)

regards,

amit m.

0 Kudos
175

Hi,

if I write a Z prog then will the new modified records be reflected on that SM30 screen?

Yes, it will be reflected.

Cheers

Sunny

jayanthi_jayaraman
Active Contributor
0 Kudos
175

Hi,

For that,you need to delete the already generated Table maintenance and recreate the table maintenance again.

Former Member
0 Kudos
175

Hi subhash

onve you modify the table in se11.

once you have to generate the maintenance.

for that goto SE11 then-->utilities->table Minatenenance generator

regards

kishore

Former Member
0 Kudos
175

Hi subhash,

1. goto se54.

2. type the table name

3. press delete button (to delete the full table maintanance screens and prorams)

4. Again Create new

(This will take care to include

the latest fields which are there in the table)

5. Anytime we make a change to the TABLE

(either data type, or adding columns

or deleting columns etc,)

WE SHOULD TAKE CARE TO

RE-GENERATE THE TABLE MAINTANENCE

(other wise it may give error in sm30)

regards,

amit m.

Former Member
0 Kudos
175

Hi Subhash

One thing to remember is that you will have to perform a Database Adjust whenever you play around with key fields, or else it won't generate which can be done using se14,enter the table name..

click on ADJUST AND ACTIVATE..

Hope this will make you clear

Cheers

Sunny