‎2008 Feb 19 5:36 PM
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
‎2008 Feb 19 6:35 PM
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
‎2008 Feb 19 6:47 PM
‎2008 Feb 21 2:55 PM
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
‎2008 Feb 22 4:18 AM
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