Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Table Maintanence Generator

ajay_rajareddy
Explorer
0 Kudos

Through custom program ,how can i update TMG...

I am executing one program in se38 , output will be 5 records, those 5 records again i am saving  into new table

when new record going to be saved in TMG . Date and Time Should be auto filled..

an di dont want to hard code time and date in se 38 program.. it should be auto filled, when new record going to be saved in TMG through program.

20 REPLIES 20

shadab_maldar
Active Participant
0 Kudos

Hi ajay,

You can insert/modify records from se38 into your table(For which TMG is generated) with system variables (date = sy-datum and time = sy-uzuit).

Regards,

Shadab.

aditya_pratap
Explorer
0 Kudos

Hi,

If one needs to include the date & time in the new table,system variables like sy-datum, sy-uzeit have to be used.These give the current parameters as desired.

Thanks,

Aditya

Former Member
0 Kudos

Hello Ajay,

Concatenate sy-datum and sy-uzuit into a variable and pass the same variable value to required field.

Hope it will helps you.

Regards,

Naga

revanchatraban
Participant
0 Kudos

Hello Ajay,

For TMG you an populate the Date and Time using the events. Since u are talking about new records, u can use event 05 to populate the date and time fields.

If u are adding the records through report u have to populate the fields in the report. I think without populating the values in the report , its not possible .

Former Member
0 Kudos

Hi Ajay,

         It's not possible to autofill the date and time while you run the program from se38, to update the SM30 table...

You want to write maually in report program for the same...or just try with recording and push the data from the sm30 t.code...

Thanks,

Vijay SR

0 Kudos

yes exactly , I am tried and tried finally I am tired.

so its not possible to update like what I am asking.

former_member185414
Active Contributor
0 Kudos

Hello Ajay,

If I understand you correctly, you are saving the output of a SE38 program to a table.

Now, you can save via two ways -

1. By writing insert statement in the same SE38 program. If you are doing so then you can pick up the date and time values from syst structure(names mentioned by Nagendra).

2. If you are saving via SM30 then you can code TMG Events as suggested by Revan.

BR.

matt
Active Contributor
0 Kudos

You seem confused.


TMG is a tool for automatically generating a table maintenance dialog you can access through SM30. It is not something you update from a program. The idea of saving data into a TMG also is nonsense.

TMG means "Table maintenance generator".

It's not clear, but you seem to want the date and time of when a record is created or perhaps modified to be automatically set in the table.

0 Kudos

Nothing to confuse there.

Actually is it possible to update the TMG with date and time (you never use(hardcode) in your program, zdate = sy-datum and ztime  = sy-uzeit) through program  , is it possible.

matt
Active Contributor
0 Kudos

No. It is possible to update your table with date and time. It's possible to change the programs generated by the Table Maintenance Generator to add date and time when an entry is created or modified. It is not possible to update the Table Maintenance Generator itself with date and time.

The Table Maintenance Generator is a program for generating Table Maintenance dialogs. It has nothing updateable...

0 Kudos

can you tell me , how can I do that.

raymond_giuseppi
Active Contributor
0 Kudos

Did you intend to use some call of VIEW_MAINTENANCE_LOW_LEVEL FM (BC Extended Applications Function Library : Extended table maintenance , Highest level entry / Middle level entry / Lowest level entry) or could you explain/elaborate on following text from your original post ?

when new record going to be saved in TMG .

Else there are events in TMG to fill some hidden fields in customer forms (e.g. time changed by kind of fields, BC - Generate Table Maintenance Dialog : Generate Table Maintenance Dialog , Create a Maintenance Dialog, Maintaining and changing an existing maintenance dialogExtended Table Maintenance Events : Event 01: Before Saving the Data in the Database)


But in your case, you are calling the TMG associated FM so why do you need this ?


Regards,

Raymond

0 Kudos

Actually, the requirement is that when I am executing a program (example:-table have kunnr,name1, ort01,date,time field  and report  have only kunnr ,name1,ort01 field ) so the three field must be updated( means MODIFIY- insert and update) through report and remaining date, time field must be updated through TMG level(However, using EVENTS or any other method at table level only) itself, when each time we are executing the report. The requirement is that I cannot directly update time and date through report level using ztable-date1 = sy-datum and ztable-time1 = sy-uzeit.

So CONCLUSION is that how I can update or modify the date/time field that at the execution level of program ,date and time must update in TMG.

0 Kudos

Hi,

Lets not talk about TMG when you are doing a direct update to the table using a report.

TMG is when you update the table through the TMG itself, not a report.

So to update the table through report, yes you need to fill current date and time in the table fields for date and time along with other fields and send update to the table.

However, your requirement could have been achieved, if the direct update through a report somehow would have triggered the TMG (where we could have written code to update date and time), but that's not the case, and the SAP design is not such. It doesn't trigger the TMG program of the table when sending the direct update to table; it's a direct interaction of your report with the table in database.

Thanks..

0 Kudos

Again, can we please get our terminology right. We never update a table through TMG. We generate a table maintenance dialog using TMG. We update a table through the dialogs created by the TMG.

The generated programs for maintaining programs are not called a TMG! They are generated table maintenances. What has always been referred to in the 18 years I've been working in SAP, as Table Maintenance Dialogs.

Using the wrong terminology leads to confusion about what is actually going on and nonsensical questions (and answers) - especially for people new to the technology. Using the wrong terminology also suggests that you don't know really understand what you are talking about. So write out 100 times

It's not a TMG it's a Table Maintenance Dialog.

0 Kudos

Matthew,

Well, I was just trying to talk in the terms he could understand... because TMG is what he was referring to..

Thanks..

0 Kudos

You are right Shan, i am new to SAP World.. how can i know all the things or terminology's...

no need to get serious reply's here, I am at Learning stage only,

Anyway Thank You so much for your Reply Mr.Matthew.

0 Kudos

You cannot be expected to know the correct terminology. That is why I have provided it to you. Now you know and can use it - your understanding is increased, the scope for confusion is decreased, everyone wins.

0 Kudos

Better to correct than reinforce errors, surely? Or is being corrected now on the list of thing people find offensive?!

0 Kudos

Thank You