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

Error message with user name

Former Member
0 Likes
2,142

Hi,

I've a Z table and created table maint. generator.I've also created locks.I've to display a error message when 2 users access the same tcode.I'd like to display the user name who has locked it For ex : "Table locked by <Username>.

Any help is appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,399

If you use function module ENQUEUE_E_TABLE to see if the table has been locked, then if it is locked sy-msgv1 should have the user ID of the person who has locked the table.

- April King

10 REPLIES 10
Read only

Former Member
0 Likes
1,399

Hi,

If you call the function module ENQUEUE_ function module then it will give the messge saying that table is locked by USer

Regards

Sudheer

Read only

Former Member
0 Likes
1,399

when u use ENQUEUE function module, it automatically gives the error message as

<b>locked by user (so & so)</b>

Read only

0 Likes
1,399

Can you give an example to raise error?

Thanks

Read only

0 Likes
1,399

You have to write an event for this

Goto Se11

Give the Viewname --> change

in menu Utilities--->Table maintenance generator

Environment->Modifications-->Events

Select Option ST and give the Form routine name , program name

And in the next column click editor button and write the code

Read only

0 Likes
1,399

Use the syste variable UNAME which always contains the currently logged User name.

So, Pass the system variable ( sy-uname ) in the message.

mesage exxx(zclass) with sy-uname.

e - for error message.

zclass - Is the message class.

xxx - number of themessage.

I think this will resolve ur problem,

<b><u>dont forget to Award if useful</u></b>

Sudheer

Read only

0 Likes
1,399

U need to award points for all the useful replies, and also u nees to mark it as Answered if ur problem is solved.

Regards

Sudheer

Read only

0 Likes
1,399

I did not award points because the answers did not solve my problem.I appreciate the replies.But i searched the forum and found my solution elsewhere and the points were already awarded to that answer.

Read only

0 Likes
1,399

Also one more thing passing a sy-uname is not teh correct solution.it does not give the name of the person who has locked the object but takes the sign on name.

Thanks..

Read only

Former Member
0 Likes
1,399

Create Message in SE91 use message like

000 Table locked by &

then message statement like

message e000(z01) with sy-uname.

Reward Points if it is useful

Thanks

Seshu

Read only

Former Member
0 Likes
1,400

If you use function module ENQUEUE_E_TABLE to see if the table has been locked, then if it is locked sy-msgv1 should have the user ID of the person who has locked the table.

- April King