Professional Documents
Culture Documents
https://archive.sap.com/discussions/thread/3408672
(http://go.sap.com/index.html)
(https://onedx.find.sap.com)
(htt
ps:/
/sh
are
dui.
ser
vice
s.sa
p.c
om
/pro
tect
ed.
htm
l?re
f=ht
tps:
//ar
chiv
e.s
ap.
co
m/)
(https://www.facebook.com/sapcommunitynetwork?ref=ts)
(https://plus.google.com/u/0/+SAPCommunities/posts)
(https://twitter.com/sapcommnet)
(https://instagram.com/sap/)
(https://www.youtube.com/user/SAPCommunities)
(https://www.linkedin.com/company/sap)
(http://www.slideshare.net/SAP)
Privacy (http://go.sap.com/about/legal/privacy.html)
Terms of Use (http://go.sap.com/corporate/en/legal/terms-of-use.html)
Legal Disclosure (http://go.sap.com/about/legal/impressum.html)
Copyright (http://go.sap.com/about
/legal/copyright.html)
Trademark (http://go.sap.com/about/legal/trademark.html)
Sitemap (http://www.sap.com/sitemap/index.html)
Newsletter (https://go.sap.com/registration/newsletter.html)
1 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
Archives (/) /
using Events
Hi,
(https://people.sap.com
I have a z table and have created table maintenanace for it. In my Z table I have below fields.
/vikas.badhan2)
delivery no
delivery type
created on
0 Likes
created by
changed on
chnged by
When I am creating a new entry. Created on and Created by are geeting filled automatically
using Event 05.
But, When I am trying to change the record any field. Change on and changed By are not
getting filled in the maintenace screen as well as in database.
Please let me know how we can handle this.
Thanks in Advance.
Vikas
(https://people.sap.com/arindam.mondal)
2 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
Hi,
May be you need to do it in the following event:
01
(https://people.sap.com/arahiman.nadaf)
Hi,
Use event number 01 to serve your requirement.
And in subroutine,use EXTRACT and TOTAL internal tables to update your database
table.
EXTRACT and TOTAL are system defined internal tables.Check for these tables on
internet.
This would help you.Let me know if you want more help.
Regards,
Abdul
0
(https://people.sap.com/vikas.badhan2)
Hi Abdul,
I have checked in Debugging mode and changed the values. It worked. but not sure
how we will achieve this through code because the values are coming as text in field
LINE.
Please help.
Thanks in Advance.
3 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
Vikas
0
(https://people.sap.com/venkat.sesha)
Hi Vikas,
How many screen do you have...?
These discussions happened lot of times in SCN. so
Please be specific about the issue.
You can achieve it several ways.. Using Events or
using PBO/PAI code of the particular screen in the
TMG and the Function Group. What is your problem
exactly.
0
(https://people.sap.com/arahiman.nadaf)
Hi Vikas,
What is the issue exactly??
Regards,
Abdul
0
(https://people.sap.com/swadhin.ghatuary)
Hello Vikas ,
you have to use 01 event instead of 05 as you already create the record.
01
02
03
04
05
4 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
(https://people.sap.com/prabakaran.a)
Prabakaran A (https://people.sap.com/prabakaran.a)replied
Hi,
Have to write code for updating the field Change on and changed by.
We can use the Even 01 and create the form routine
The field <VIM_XTOTAL_KEY> contains the key.
For changing the current record, we need to modify both the corresponding extract and
total table values.
The <ACTION> field indicates the current user action : new insertion or updation or
deletion.
(https://people.sap.com/sravan.kilari3)
Hi Vikas,
you created table key field is delivery no.
5 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
can you check the one how to created table entries and events in table maintenance generator
.
http://wiki.sdn.sap.com/wiki/display/ABAP/TABLE+MAINTENANCE+GENERATOR+and+ITS+EVENTS (http://wiki.sdn.sap.com
/wiki/display/ABAP/TABLE+MAINTENANCE+GENERATOR+and+ITS+EVENTS)
0
(https://people.sap.com/chittari.sreedhar)
Hi Vikas,
Table maintenance event 5 will be triggered only, when a new entry is created.
Try other events like 01(Before saving) or 02(After Saving) to fill change date and change
time while changing a table entry
Hope this Helps
Sreedhar
0
(https://people.sap.com/jeffingeorge)
Hi Vikas,
The event 05 (New entries) will work only if you create new entries
When changing the data the event 05 will not work.
You have to use the event 01 (Before saving the data).
This event will be triggered when you save the data.
Regards,
Jeffin
0
6 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
(https://people.sap.com/alext.jose)
Hi Vikas,
Go to the flow logic of the TMG screen where you input the values to the filled.
Ceck whether your field is included in the
CHAIN.
.
.
.
ENDCHAIN.
Statement in the PAI of the screen.
Please refer this code of such a TMG Screen attached below.
Regards.
0
(https://people.sap.com/eric.peterson2)
I had this exact problem a month ago and solved it by putting this code in event 01, before
saving in the database.
7 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
FORM before_save.
"before_save
The code was adapted from the sample in Event 01: Before Saving the Data in the Database (http://help.sap.com
/erp2005_ehp_04/helpdata/EN/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm). Let me know if this doesn't work for you!
8 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
(https://people.sap.com/benjnw)
In my case, the problem wasn't solved. The fields aren't filled when I update data.
0
K Suresh (https://people.sap.com/k.suresh2)replied
(https://people.sap.com/k.suresh2)
Use event 21 as change by and change date is for modification history, hence you
can keep them as hidden fields by changing the attributes of TMG screen and
populate as below. It will work in all scenarios.
ztab-changedby = sy-uname.
ztab-udate
= sy-datum.
ztab-utime
= sy-uzeit.
Thanks,
Suresh
1
(https://people.sap.com/benjnw)
Amanda Ho (https://people.sap.com/aho)replied
(https://people.sap.com/aho)
Thanks with event 21 the field was able to update. Example code as below:
" Populate update date field with today's date
ztbl-udate = sy-datum.
9 of 10
23-12-2016 18:04
https://archive.sap.com/discussions/thread/3408672
IF <action> = aendern.
MODIFY ztbl.
ENDIF.
(https://people.sap.com/tharindud)
10 of 10
23-12-2016 18:04