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 maintainance - populate the fied values by coding

Former Member
0 Likes
555

Hi All,

My requirement is whenever new table entry is made using table maintaince , automatically username and date should be populated to the respective two fileds.

For this I created the subroutine POPULATE_FIELDS for EVENT 01 . Here I wanted to code to update the UNAME AND DATE fileds.

Could you please suggest the way or possibly with sample code to update these two filed's automatically.

Regards,

Chandra Mohan V

Hi All,

My requirement is whenever new table entry is made using table maintaince , automatically username and date should be populated to the respective two fileds.

For this I created the subroutine POPULATE_FIELDS for EVENT 01 . Here I wanted to code to update the UNAME AND DATE fileds.

Could you please suggest the way or possibly with sample code to update these two filed's automatically.

Regards,

Chandra Mohan V

3 REPLIES 3
Read only

Former Member
0 Likes
527

Hi

I f you have a maintenance view created then you should be able to use events to make changes to the table:

SM30

Environemnt | Events

I've not done it myself so don't know exactly what to do but I believe it works in a similar way to user_exits.

Hope this helps

Andy

Read only

Former Member
0 Likes
527

Hello Chandra,

Event 01 is the correct one. Your coding should look like this:

form populate_fields.

DATA: ls_wa TYPE (line type of your table).

LOOP AT total.

check <action> eq 'N'. (only for new entries)

ls_wa = <vim_total_struc>. (this is the workarea for table total)

ls_wa-uname = sy-uname.

ls_wa-date = sy-datum.

<vim_total_struc> = ls_wa.

modify total.

ENDLOOP.

This will automatically add user and date to your new entries.

Regards,

Michael

Read only

0 Likes
527

You may also want to go into the screen painter and grey out these fields so that users don't try to update them.

Rob