on 04-24-2009 8:33 PM
Hi all,
I'm working on a project to put some kind of object "lock" indicators onto the cProjects dashboards. Has anyone here attempted to do such a thing?
The purpose of this exercise is to allow users to see which objects in their dashboards are locked prior to accessing (via "Edit" or "Open") the data, only to find out upon entering change mode that the object they were meaning to edit is locked.
I'm familiar with the config necessary for adding dashboard fields (OSS Note 971394 - Displaying additional fields in the dashboard); however, what I don't know at this time is the tables and fields I need to achieve this. (I don't believe this comes as a standard attrib value in the dashboard extract layout.) Furthermore, if I could find the table and field that displays just the user ID pegged to the lock object, that would be more than sufficient - it would be most intuitive for folks to know who has the object locked as opposed to a boolean "locked" or "unlocked" indicator.
I'd really appreciate any kind of feedback! I'm sure there are other ways to achieve this same end. By all means, please feel free to share
Thanks!
- Lawrence Miranda
Hi Lawrence,
If you already added the field to the dashboard, there's one remaining thing to be done: populate the field. To do so, please implement BADI dpr_eve_dashboard, method change_attributes with the following code (it's the one we're currently using, it seems the need is for all customers). This code populates the field with the user ID that is locking the object. Please change it based on your need.
Matthias
Use this method to change dashboard attributes during runtime.
DATA: ls_dashboard_data TYPE dpr_ts_dashboard_ext,
lv_subrc TYPE sy-subrc,
lv_number TYPE sy-tabix,
lv_arg TYPE seqg3-garg,
i_enq TYPE TABLE OF seqg7,
lw_enq TYPE seqg7.
Is a user locking the current object?
LOOP AT ct_dashboard_data INTO ls_dashboard_data.
CONCATENATE sy-mandt 'DPR' ls_dashboard_data-root_object_guid_id INTO lv_arg.
CALL FUNCTION 'ENQUE_READ2'
EXPORTING GCLIENT = space
GUNAME = space
GNAME = space
GARG = lv_arg
IMPORTING SUBRC = lv_subrc
NUMBER = lv_number
TABLES ENQ = i_enq.
IF i_enq[] IS NOT INITIAL.
READ TABLE i_enq INTO lw_enq INDEX 1.
CHECK lw_enq-gmode = 'E'.
ls_dashboard_data-userlock = lw_enq-guname. "user_lock is the name of our custom field
MODIFY ct_dashboard_data FROM ls_dashboard_data.
ENDIF.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.