Application Development and Automation 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: 
Read only

Table Maintenance Generator- Username & Systemtime

Former Member
0 Likes
3,537

Hello,

I need to add the Username(sy-uname) and system time (sy-uzeit) fields automatically when the entries are added into the Ztable using the Tcode defined for sm30 transaction.

The user enters the key fields and the "User" & "Time" should get displayed automatically.

Can anybody please suggest a way out of this please...!

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,358

Hi,

You can use the event '05' when the user is trying to create the data..

Also...I believe it is not possible to do it in SM30 without events..

Thanks,

Naren

Hello,

I need to add the Username(sy-uname) and system time (sy-uzeit) fields automatically when the entries are added into the Ztable using the Tcode defined for sm30 transaction.

The user enters the key fields and the "User" & "Time" should get displayed automatically.

Can anybody please suggest a way out of this please...!

Regards

9 REPLIES 9
Read only

Former Member
0 Likes
2,358

Goto table --> Utlities --> Table maintanence generator --> Environment --> Modification --> Events.

Select the event 01 (Before saving the data in the database)--> Enter some name example USER_NAME_TIME. There is one more column Editor near to that click that.

Write the code inside that.

Example:

FORM user_name_time.

zsw_es_docu-user_name = sy-uname.

zsw_es_docu-time = sy-uzeit.

ENDFORM. "user_name_time

Regards,

Prakash.

Read only

Former Member
0 Likes
2,358

Hi,

Go to the view V_TVIMF.

Add an entry with the following entry.

EVent - '01' (Before saving the data in the database)

Form rourtine - 'ADD_USERNAME'

Save the entry in a CR.

Then in the function group that you created for the table maintenance add this subroutine..

FORM ADD_USERNAME.

  • Types Declaration

DATA: BEGIN OF WA_ZTABLE.

INCLUDE STRUCTURE ZTABLE.

DATA: update_fl TYPE char1,

mark TYPE char1,

END OF WA_ZTABLE.

LOOP AT TOTAL.

WA_ZTABLE = TOTAL.

WA_ZTABLE-USER_NAME = SY-UNAME.

WA_ZTABLE-USER_TIME = SY-UZEIT.

TOTAL = WA_ZTABLE.

MODIFY TOTAL.

ENDLOOP.

ENDFORM.

Hope this works..

Thanks,

Naren

Read only

0 Likes
2,358

Its like when the screen is displayed for the user to enter the records on clicking 'new entries', the Username n Time should get displayed automatically. He'll enter the remaining fields and save the data.

Can anybody suggest a way without using the Events!!

2) Also sometimes the Date n Time fields does not appear on the screen while creating entries.

Read only

Former Member
0 Likes
2,359

Hi,

You can use the event '05' when the user is trying to create the data..

Also...I believe it is not possible to do it in SM30 without events..

Thanks,

Naren

Read only

0 Likes
2,358

Hi Naren,

Event 05 could do with us. Thank You.

However sometimes, some of the fields created in the table are missing when the actual Tcode is entered. It doesn't happen all times. Could you please suggest why it could happen? Also when SHOW 'X' is entered, the vaules get displayed improperly. After Show is removed it works fine. Can you please explain in which events can we use 'SHOW'

?

Regards

Innova

Read only

0 Likes
2,358

Always u have to remember that if a table as table manintanence, whenever a new field is added to that table change the table maintanence generator. Ie. Go to table main. gen screen press the change button check all the checkboxes and press enter--> In the next pop-up select the overview check box and press enter.

Regards,

Prakash.

Read only

0 Likes
2,358

Thanks a lot prakash. it worked.. yippeeeeeeee.....

Dot of giving you a 10.... but its not there.. sorry..:-(

Neewas

Bye

Read only

Former Member
0 Likes
2,358

Hello,

You can do this only by using EVENTS. Go to transaction SE54 and enter the table and navigate to the menu path

ENVIRONMENT-->EVENTS.

Now clikc the button NEW ENTRIES. Now in the first column select the proper EVENT and in the second colúmn give the subroutine name that you have created. Press Save. So you can handle the process in that subroutine.

Regs,

Venkat Ramanan N

Read only

Former Member
0 Likes
2,358

Hi,

When SHOW 'X' give in the tcode will show the values in the display mode..

I am not sure what do you mean by "values getting displayed improperly"...Please explain..

Thanks,

Naren