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

sm30 tcode maintainance

Former Member
0 Likes
580

hi friends,

i had created a table which has 4 primary key fields and 2 more fields which are creation date (ersda) and created by (ernam). and maintainance generator is also created for this table in sm30. now user says that he will manually insert the data for the 4 key fields, but for the other two fields the transaction should automatically pick the values as sy-datum and sy-uname. Is there any way to maintain such kind of data in the transaction.

would appreciate quick response.

thanks,

Sakshi

4 REPLIES 4
Read only

Former Member
0 Likes
554

Since this is a Z-table and a custome maintenance dialog, the easiest thing to do would be to hook into the PAI and insert a module that automatically populates those values.

Within the LOOP AT ITAB - ENDLOOP in the PAI you should enter MODULE POPULATE_AUDIT_TRAIL (or any other name) where you populate the fields for created at and by.

Once the user saves the data those fields will be saved as well.

Regards,

Michael

Read only

Former Member
0 Likes
554

You can do this at event 1 (Save data).

Rob

Read only

Former Member
0 Likes
554

Hi,

You can create table maintenance generator for the custom table. After creation of table maintenance generator go to menu environment - > modification - > events

you will get the screen Display view "Form routines to be called from view maintenance"

There you can write routines 01 - > for create

05 - > update

For example............

FORM zfgl_accounting_create.

*User Name.

zfgl_accounting-uname = sy-uname.

*Date.

zfgl_accounting-datum = sy-datum.

*Time

zfgl_accounting-uzeit = sy-uzeit.

ENDFORM. "ZFGL_ACCOUNTING_CREATE

Try this logic...you can able to pass the date and time values in the fields.

Thanks & Regards

Read only

Former Member
0 Likes
554

Hi,

Go to the Table Maintenance Generator of your table.

Got to Environment>Modification>Events.

Create a even '01' (Before saving the data in the database).

You can do you necessary timestamp update in this event.

hope this helps.

Regards,

Sandeep