cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow question - SWWWIHEAD TABLE

Former Member
0 Kudos

Hello Workflow Gurus,

Is there anyway I can get the current work item ID given the fact that I have the top work item ID. Right now I am using table SWWWIHEAD but I am facing runtime issues. I was using the function module SAP_WAPI_WORKITEMS_TO_OBJECT which is horrible runtime wise. Please advise if there is a way to get the current work item ID.

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Rachana,

there's a nice place to leave workflow topics:


* Prerequesites: There are no sub-workflows

   DATA: wi_id          TYPE swwwihead-wi_id.
   ... 
   wi_id = <your workitem id here>.
   ...

   DATA: items_in_work  TYPE STANDARD TABLE
                             OF swwwihead
                             INITIAL SIZE 10.
   SELECT * FROM swwwihead
            INTO TABLE items_in_work
            WHERE WI_CHCKWI = wi_id
              AND ( wi_type = 'D' OR
                    wi_type = 'B' )
              AND ( wi_stat = 'READY'   OR
                    wi_stat = 'STARTED' OR
                    wi_stat = 'ERROR' ).
* finished

There is a database index on the field wi_chkwi, so do not worry about performance here.

Best regards,

Florin