Documente Academic
Documente Profesional
Documente Cultură
Harshada Patil
Nov 20, 2007 10:43 AM
Hi
I have a ztable with date & uname as last two fields. My requirement is whenever user maintains new entry in the table ( thru SM30 - we are giving tcode for Sm30 screen ) , system date & user name should be added along with this record automatically.
We will not display these two fields as input to user. These values should be updated directly.
Somebody told me to write code in module pool for the screen which is generated by table maintainance generator. But I could not proceed.
Pls let me know how this can be acheived.
Regards
Harshada
ENDFORM.
"change_field_vaule
3966 Views
Topics: abap
Manish Kumar
Hi Harshada,
Correct AnswerRe: Auto fill date & user name whenever table is updated
ENDFORM.
"change_field_vaule
o
o
Harshada Patil
Alert Moderator
Like (0)
Re: Auto fill date & user name whenever table is updated
Alert Moderator
Gagan Choudha
Like (0)
Re: Auto fill date & user name whenever table is updated
Hi,
I table maintainance generator screen go to environment->modification-->events and then choode events number 5 which is Creating a new entry and then in form routine give any name of routine then in function group one included will be add now u can
code on that include between routine name which u entered earlier.
tables : makt.
form zcreation.
clear makt.
clear zfib_intco.
select single * from zfib_intco where matnr = zfib_mmpg-bismt.
zfib_mmpg-OLDDC = zfib_intco-maktx.
select single * from makt where matnr = zfib_mmpg-matnr and spras = 'EN'.
zfib_mmpg-maktx = makt-maktx.
IF ZFIB_MMPG-MATNR = SPACE.
zfib_mmpg-maktx = 'Blank Material'.
ENDIF.
endform.
here i am attaching a code on which material description autimatically comes while creating the entry through SM30.
Rewards if helpful.
Regards
Gagan
Alert Moderator
Like (0)
Re: Auto fill date & user name whenever table is updated
Harshada Patil
Alert Moderator
Like (0)
Re: Auto fill date & user name whenever table is updated
Harshada Patil
Alert Moderator
Like (0)
Re: Auto fill date & user name whenever table is updated
Lokesh Aggarwal
Hi Harshada,
Goto the table maintenance generator of the Table.
On this screen.
Environment -> Modification -> Events
Create New entry in the table with T = 05 and Z* <any name>
Save it.
An editor button appears next to the from name.
Click on it and create an include.
Write statements.
Tabname-ChangedBy = sy-uname.
Tabname-ChangedOn = sy-datum.
Hope it helps.
Lokesh
Alert Moderator
Like (0)
Re: Auto fill date & user name whenever table is updated
Gagan Choudha
Hi,
Event no 5 will work only when you create new entry on Z table u can try event 2 for entry at the time of change.
Rewards if helpful.
Regards
Gagan
Alert Moderator
Like (0)