2007 Oct 18 3:22 PM
Hi All,
My requirement is whenever new table entry is made using table maintaince , automatically username and date should be populated to the respective two fileds.
For this I created the subroutine POPULATE_FIELDS for EVENT 01 . Here I wanted to code to update the UNAME AND DATE fileds.
Could you please suggest the way or possibly with sample code to update these two filed's automatically.
Regards,
Chandra Mohan V
Hi All,
My requirement is whenever new table entry is made using table maintaince , automatically username and date should be populated to the respective two fileds.
For this I created the subroutine POPULATE_FIELDS for EVENT 01 . Here I wanted to code to update the UNAME AND DATE fileds.
Could you please suggest the way or possibly with sample code to update these two filed's automatically.
Regards,
Chandra Mohan V
2007 Oct 18 4:06 PM
Hi
I f you have a maintenance view created then you should be able to use events to make changes to the table:
SM30
Environemnt | Events
I've not done it myself so don't know exactly what to do but I believe it works in a similar way to user_exits.
Hope this helps
Andy
2007 Oct 18 7:14 PM
Hello Chandra,
Event 01 is the correct one. Your coding should look like this:
form populate_fields.
DATA: ls_wa TYPE (line type of your table).
LOOP AT total.
check <action> eq 'N'. (only for new entries)
ls_wa = <vim_total_struc>. (this is the workarea for table total)
ls_wa-uname = sy-uname.
ls_wa-date = sy-datum.
<vim_total_struc> = ls_wa.
modify total.
ENDLOOP.
This will automatically add user and date to your new entries.
Regards,
Michael
2007 Oct 18 7:18 PM
You may also want to go into the screen painter and grey out these fields so that users don't try to update them.
Rob