Skip to Content
0
Former Member
Dec 06, 2006 at 11:11 AM

Write protect for transaction

75 Views

Hi,

I have a dialog program callable by a transaction. In this program there are

many tab strips with a database table for each tab strip. You can see, change

and delete the data of the database tables on each tab strip.

Now it should be possible, that only one user can change and delete data at

the same time. So I have thought about writing a value in the memory and read

it every time at the beginning of the program.

If one user is starting the program and there isn´t an entry in the memory, the

memory should be set now. If another user is starting the program now, there

should be an entry in the memory, that I can protect the tables for changing and

deleting.

I tried it like that:

  DATA:  user  TYPE  sy-uname.

  IMPORT user FROM MEMORY ID 'user'.

  IF user IS INITIAL.
    user = sy-uname.
    EXPORT user TO MEMORY ID 'user'.
    CLEAR user.
  ENDIF.

It is working, if You call the transaction at once. The username is stored in the

memory.

But when I now start the transaction in another mode the same time, I´m not

getting any entry for the field 'user' in the memory.

Any ideas? Or do You have any better ways how to protect the data?

Thank You very much!

Reward points guaranteed.