AW: Substituted work items

Dr. Ulrich Mende wug at mende-edv-beratung.de
Wed Jul 18 17:48:20 EDT 2001


Hi, Abed
 
Here is a quick try, which can solve one part of your question   show the
Wis, which are in the inbox of a substituting user.
 
REPORT  Z_SUBSTITUTED_WIS .
TABLES: SWWWIHEAD, SWWUSERWI, HRUS_D2.
 
DATA: WITAB LIKE SWWWIHEAD-WI_ID OCCURS 0 WITH HEADER LINE.
DATA: USERTAB LIKE SY-UNAME OCCURS 0 WITH HEADER LINE.
 
* Get all active WIs, be carefully in a productive system with lots of WIs
* Set up other restrictions (creation date...)
SELECT WI_ID FROM SWWWIHEAD INTO TABLE WITAB
         WHERE WI_TYPE = 'W'
           AND ( ( WI_STAT = 'READY' ) OR ( WI_STAT = 'STARTED' ) ).
*                                         AND . . .
*                                         AND . . .
 
LOOP AT WITAB.
* Read active users of every WI, this table does not change when
* activating/deactivating a substitution
   SELECT USER_ID FROM SWWUSERWI INTO TABLE USERTAB
            WHERE WI_ID = WITAB.
 
   LOOP AT USERTAB.
* Has the user an active substitution at the given time?
     SELECT * FROM HRUS_D2 WHERE US_NAME = USERTAB
                             AND ACTIVE = 'X'
                             AND BEGDA <= SY-DATUM
                             AND ENDDA >= SY-DATUM.
* active substitution exists, check if substituting HRUS_D2-REP_NAME is
* already in USERTAB. If not, a real substitution is found
       READ TABLE USERTAB WITH KEY = HRUS_D2-REP_NAME
                          TRANSPORTING NO FIELDS.
       IF SY-SUBRC <> 0.
         WRITE: / 'WI:', WITAB,
                   'is in inbox of user',  HRUS_D2-REP_NAME,
                    'substituting user', HRUS_D2-US_NAME.
       ENDIF.
     ENDSELECT.
   ENDLOOP.
ENDLOOP.
 
 
Best regards  Uli Mende
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20010718/3eea8ecf/attachment.htm


More information about the SAP-WUG mailing list