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

Default value in ZTABLE field

Former Member
0 Likes
1,292

Hi all,

I have a ZTABLE which has 42 fields,I want to add 3 new fields like UNAME and DATUM(User Name and DATE )in the table.

What I want is,I want to default this with SY-UNAME,SY-DATUM whenever entries created by any program.I know the events for SM30/Table maintainence generator but I want the same when entries created from any program.Is it possible?

Thanks & Regards,

Rock.

Hi all,

I have a ZTABLE which has 42 fields,I want to add 3 new fields like UNAME and DATUM(User Name and DATE )in the table.

What I want is,I want to default this with SY-UNAME,SY-DATUM whenever entries created by any program.I know the events for SM30/Table maintainence generator but I want the same when entries created from any program.Is it possible?

Thanks & Regards,

Rock.

6 REPLIES 6
Read only

Former Member
0 Likes
905

Write the code in the Function group of the Table maintenace generator to handle this requirement. Do any conversion routines for the fields Sy-DATUM and UNAME, it should work.

Edited by: Phanindra Annaparthi on Mar 6, 2009 7:59 AM

Read only

Former Member
0 Likes
905

Hi Dude,

first you create the Table maintanance generator for the table

then go to the below navigation from the Table maintanance generator

Environment>modification-> Events

we have maintanence events 21

According your requirement select the releavnt event

you use 05 event

Thanks & Regards

Ramakrishn aPathi

Read only

0 Likes
905

Hi guyz,

Thanks for u r replies but I think both of u havent read my query,I know abt table maintainence generator events/SM30 events,but I want similar kind of events when we create data from any program.

The problem is I have 16 programs working on that table,I need to change all 16 programs to get the data in these fields and defaulting the data in all those 16 programs will solve my problem but I want a hort cut,is there any short cut for this like table events?

Hope am clear in my questian.

Thanks & Regards,

Rock.

Read only

0 Likes
905

as far as i know there is no SAP event for updating, modifying, inserting into a database table. But i´m quite sure there are database events. Tho i dont think you basis guys will let you do anything that deep in the system.

Read only

0 Likes
905

I read your query, but I'm also surprised as to your answer. So you are saying that there are 16 programs, updating this table, right? Well, in good programming manner, there would only be ONE function module that does the actual update, insert, delete. So, that way, there would only be one place in which you would have to set these fields.

But to get back to your question, I don't really think there is a 'short cut' for this so you will have to do it the hard way. However, since you are about to change all programs, you might want to consider creating these function modules now.

Read only

0 Likes
905

Hi Micky,

Thanks for u r suggetion,here requirement is quite different,every program has its own calculation procedures and I was unable to club them at the time of creation of this development.

I work in an organization where in you dont get u r requirement clear(no FS),the minute u start developing that,the Functional people will start changing the requirement.Iam the only ABAP consulatant in the team where in SD-MM-PS-FI-CO modules are getting implemented.So no time to think.

Solution to my problem :

It seems no way other than changing my programs to fullfill this requirement.

Thanks all who spent time answering my question.

Thanks & Regards,

Rock.