2011 Dec 28 4:14 AM
Hi All,
we have one 'Z' table in which date of creation and time fields are filling automaticall when we create a entry.
i know by maintaining the events in 'table main generator' we can achive this.
But i dont see any events added here.
can some one tell me is there any other way to maintain the events for a table?
how can i know the maintained events for my table?
i have searced in SDN but dont find any clue.
please help.
Thanks,
Krishna
Hi All,
we have one 'Z' table in which date of creation and time fields are filling automaticall when we create a entry.
i know by maintaining the events in 'table main generator' we can achive this.
But i dont see any events added here.
can some one tell me is there any other way to maintain the events for a table?
how can i know the maintained events for my table?
i have searced in SDN but dont find any clue.
please help.
Thanks,
Krishna
2011 Dec 28 4:18 AM
Hi,
Check there are some wikis available.[Table maintenance and Events|http://wiki.sdn.sap.com/wiki/display/ABAP/TABLEMAINTENANCEGENERATORandITS+EVENTS]
Regards,
Madhu.
2011 Dec 28 4:51 AM
Hi,
follow the below scenario..it might be helpful for you..
-->In your ZTABLE screen > go to menu bar click on Utilities>Table maintainence generator-->then enter required information like authorization group .
>Then go to menu bar>click on Environment>selectmodification>click on events
then screen is displayed.then Click on F4--->table maitainance dialog event box is displayed.
there you can observe that there are different types of events available like before saving the data,
after saving the data, before deleting, after deleting and others.here you can go with u201CCreating a new entryu201D.
-->then Click on the button in the Editor column and enter the following code:
(Please note that you should also code FORM and ENDFORM as well)
Form create_Entry.
ZTESTEVENTS-ERDAT = SY-DATUM.
ZTESTEVENTS-ERNAM = SY-UNAME.
Endform.THEN SAVE AND ACTIVATE THE TABLE .
THEN Testing the scenario:
Go to SM30 and try creating new entries. Do not enter the values for u201CCreated onu201D and u201CCreated byu201D.
Check your entries in the database table. You can observe that the date and user name are automatically filled-in.
Thanks&Regards
Sreenivas Pachva
Edited by: sreenivas.p on Dec 28, 2011 6:03 AM
Edited by: sreenivas.p on Dec 28, 2011 6:09 AM
Edited by: sreenivas.p on Dec 28, 2011 6:13 AM
Edited by: Suhas Saha on Dec 28, 2011 11:46 AM
Edited by: sreenivas.p on Dec 29, 2011 5:32 AM
2011 Dec 28 5:18 AM
HI
Please check this below link, it may be a very useful PDF link about IMPLEMENTING EVENTS IN TABLE MAINTENANCE which can solve your problem
<link-farm removed>
table maintenance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under attributes tab
2) utilities-table maintanance Generator->again from the MENU
ENVIRONMENT->MODIFICATION->EVENTS
you can find different events for this Table maintenance
create function group and assign it under function group input box.
also assign authorization group default &NC& .
3) select standard recording routine radio in table table maintenance generator to move table
contents to quality and production by assigning it to request.
4) select maintenance type as single step.
5) maintenance screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
[http://wiki.sdn.sap.com/wiki/display/ABAP/TABLEMAINTENANCEGENERATORandITS+EVENTS]
[/message/2831202#2831202 [original link is broken];
[/message/2831202#2831202 [original link is broken];
Warm Regards
NZAB
Edited by: Suhas Saha on Dec 28, 2011 11:46 AM
2011 Dec 28 5:35 AM
2011 Dec 28 6:09 AM
Hi,
check the following links:
<link-farm removed>
Warm Regards,
PavanKumar.G
Edited by: Suhas Saha on Dec 28, 2011 11:48 AM
2011 Dec 28 6:23 AM
Hello All,
Try to understand the OP's problem & provide your inputs accordingly.
Please refrain yourself from spoon-feeding & don't post link-farms.
Thanks for your support & happy posting!
BR,
Suhas
2011 Dec 28 8:45 AM
Thanks All for your reply,
the problem currently am having is
we have one z table.
for this table under table main generator>environment>Modifications-->Events there are no events defined.
But when i create a entry in the Z table, creation date and time fields are filling automatically.
i wanted to know is , is there any other method available to define Evevts in table?
How can i know the maintained events for my table?
Thanks
Krishna
2011 Dec 28 8:47 AM
May be some code is written in PAI of maintainence screen.
Go to User TMG double click on screen number and check if some custom code is written there in PAI for defaulting the values.
Nabheet
2011 Dec 28 9:26 AM
Hi,
Do you mean the domain MAINTEVENT contains no values on your system ? and you cannot create a new entry in V_TVIMF view table?
added: OK just get it...srry you want to remove that "thing" that is defaulting your values...
...The only think I can think of is what Nabheet suggested: Check the PAI of your TM screen...
Kr,
Manu.
Edited by: Manu D'Haeyer on Dec 28, 2011 10:32 AM
2011 Dec 28 10:42 AM
Hello friend,
Did you saw my link???
I think its having the necessary information.
Please see that and let me know.
Thanks,
Sri Hari
2011 Dec 28 11:10 AM
Hi krishna
As you know how to maintain table maintenance generator, just briefly I will explain you,
After creation of Fields and Data Elements,
Go to Table Maintenance Generator:
The path is Menu -> Utilities -> Table Maintenance Generator
Enter the details as : Table /View = your table name
Authorization group = &NC& (i.e., without authorization group)
Authorization object = S_TABU_DIS
Function group = Your function group
package = your package
Under Maintenance Screen
Maintenace type : select two step
and Maintain the screen numbersNow click on Environment -> Modification -> Events
The screen will be displayed before you, here
just place your cursor in the T field (i.e., Table Maintenance dialog field)
then Click on F4. Following entries will be displayed before you, here you can select the event which is suitable to your requirement.
Here you can observe that there are different types of events available like before saving the data, after saving the data, before deleting, after deleting and others. Let us go with u201CCreating a new entryu201D.
Click on the button in the Editor column and enter the following code: (Please note that you should also code FORM and ENDFORM as well).
under that include e.g., LyourprognameF01
Form Event_create.
yourprogname-ERDAT = SY-DATUM.
Endform.Save and activate the table.
Testing the scenario:
Go to SM30 and try creating new entries. Do not enter the values for u201CCreated onu201D and u201CCreated byu201D.
Warm Regards
NZAB
2011 Dec 28 11:24 AM
@ Sri Hari, @NZAB,
The problem is not about creating event for a maintenance view....But to know why some fields are automatically filled without any event beeing maintained
cheers,
m.
2011 Dec 28 6:42 PM
Two things you can try:
1) Debug.
2) Go to the main program of the function group of the TMG and do a (global) where used list of the data element(s) of the fields being automatically filled.
Rob
2011 Dec 29 9:20 AM
Thanks Rob/Nabheet/Manu ,
at alst i got that under Function Group PAI Module, custom code is added which we genrally use in the events.
But this code is added between MODULE..and ENDMODULE. we genrally write in FORM..and ENDFORM.
But i cant see this under table events of TMG.
i tried the same thing(added the same code in PAI) by creating another table.
but this is not working.(creation date and time are not filling).
can anybody try this and let me know where am going wrong?
Thanks
Krishna
2011 Dec 29 9:29 AM
Hi,
The screen has modules and inside module you can call your subroutines. So some custom code is written in PAI module that is why it is getting filled.
Can you please tell which table have you created what are the fileds and where have you inserted your module in PAI.
Nabhete
2011 Dec 29 11:07 PM
It's more work, but you should try to remove the code from here and put it in an event. If the TMG screen is ever changed, the code will be re-generated from scratch and you changes lost.
Rob
2011 Dec 30 9:00 AM
Thanks SDN and All,
my issue got resolved. under Table main generator-->events there are no events showing but for new and changed records date and time populating properly.
here is the solution:
PAI Module of function Group, add the same code which we genrally add while creating the evevts in TMG.
but the code should be added between Module...and ENDMODULE.
then under the Screen area of the Function Group, call the module in flow logic area at below 2 places.
MODULE LISTE_INIT_WORKAREA.
MODULE ZMODULE. " For New Records.
.
.
.
MODULE ZMODULE.
MODULE LISTE_UPDATE_LISTE. " For changed records.
Thanks
Krishna