Find workitem id

We have custom work flow and custom application for eleave. The submitted leave requests from portal
are stored in custom 'z' tables with workitem id's. Nearly we have 5k+ users who uses this application.
1. Daily we have few cases 4-5, where the workitem field is blank in the z table, though the workitem is triggered.
   we can confirm this from seeing the workitem in SWIA. We do patch the workitem manually in the custom table.
   why this is happening intermitently?
2. we are in process of automate this manual patching process. (ie) to write a program that
   picks up blank workitem records from the custom table and patch it with correct work items.
   >> how to find workitems based on the employee who triggered?
Thanks!

Hi
  I would suggest you to determine the work item ids in the other way. I Mean You are saying that you know the workflow
initiator.
2. So get the workflow initiator pernr and get all his documents by making use of the transaction PTARQ.
3. Execute PTARQ transaction and get all employee specific document Id's and in the ptreq_header table you find the top work item ID of the leave request.
4. So by making use of the top work item ID get all the dependent work items by making use of the function module SAP_WAPI_GET_DEPENDENT_WIS and try to filter the work items by using work item type eq W. and this will give you all the leave work item IDs.
Now its up to you and your business requirement like what work item ID you are saving in the Z custom table.
Regards
Pavan

Similar Messages

  • Any Function modules or tables to find workitem in ready status for user

    Hi all,
    Is there any way i can find the possible workitems which is in ready state in a users inbox.
    Thanks,
    Neslin.

    Hi Neslin
    You can use this FM RH_LOCAL_INBOX_GET which gives all the details of the work item for the particulaer user. In this FM goto table tab WI_LIST willl give all the details WI_LIST-WI_STAT give the status of the work item.
    Regards
    vijay

  • Tcode for finding workitems executed by a user

    Hello All:
    Could you please tell me the t-code which is used to find the workitems executed by a user.
    Thanks

    Hi,
    Yes, SWI5 will do the job...
    I have additional question: Does someone know any other way(s) to find the work items executed by a user? Function modules, etc.? SWI5 gets extremely slow when you have a "billions" of work items in the system...
    Regards,
    Karri

  • Finding  workitem for a certain idoc

    Hello,
    is there a way to find a woritem for a certain error idoc. Using SWI1 is extremly slow. There must exits a direct link
    between the idoc and the workitem. When I delete/book  a error idoc in BD87 the corresponig workitem disapears from SO01.
    Ralf

    I found a solution:
    a possible way to do it is transaction SWI6.
    for a ORDERS Idoc enter
    Object type cat,:  BO
    Obect type:         IDOCORDERS
    Obect key:          Idoc number
    Ralf
    Edited by: Ralf Schäfer on Feb 16, 2010 12:22 PM

  • Workitems struck with UserDecision

    Hi All,
           I need to know how to find workitems that are struck in user decision step. Is there a tcode to find the list?
    Please inform.
    Regards,
    Anand

    Hello,
    "Stuck" is not a technical term. If you mean waiting on an agent, try looking for status READY in SWI1.
    regards
    Rick Bakker
    hanabi technology

  • Issue in scheduling /sapsrm/offlineapprovalsend in background

    Hello Guys,
    My requirement is to send Email to Approver once workitem is send to him in UWL after creation/change of contract. This is not offline approval but just an email specifying to check UWL.
    In SRM 7.0 SAP has provided standard program /SAPSRM/OFFLINEAPPROVALSEND. This program sends email correctly to Approvers if correct date and time is mentioned on the screen.
    But if I call this program in background through another program, it does not work. Program unables to find workitem in mentioned period since doesnot accept date and time parameters passed in the submit statement. It considers those blank and then internally assign system date and time to it.
    Below is the sample code: ( we have also implemented BADI BBP_OFFLINE_APP_BADI to change text )
    START-OF-SELECTION.
    gv_time  = sy-uzeit.
    gv_datum = sy-datum.
    to identify workitems which are generated in last 1 hour only
    gv_time = gv_time - 3600.
    SUBMIT /sapsrm/offlineapprovalsend WITH : p_jobsuf  = '2',
                                              p_bo_ty   = 'BUS2000113',
                                              x_n14all  = c_x,
                                              x_o_html  = c_x,
                                              x_o_dec   = c_x,
                                              x_wi_txt  = c_x,
                                              p_fromd   = gv_datum,
                                              p_fromt   = gv_time,
                                              x_alw_tr  = c_x,
                                              x_prio_2  = c_x .
    Kindly help.
    Regards,
    Hema

    Hello,
    Reason is I need to change Value of the parameter Date and time on the screen. Contract( workitem) created in last 1 hour need to be executed only.
    Date and time on screen work in a way that.. After that particular date and time whatever items are created mail is being send for all those items. Hence I can not keep those constant and should vary at each execution.
    Regards,
    Hema

  • Inbound Idoc - permitted agents

    In my inbound IDOC my partner profile permitted agents do not get a work item when the IDOC does not post due to some error. I seem to recall that some work needed to be done with the organization structure. Can you point me in the right direction as to which steps I may have missed?
    Thanks

    Hi Raynald,
    Next step is to check with transaction SWETYPV if the type linkage for IDOCAPPL and event INPUTERROROCCURRED has been activated.
    If this is the case you will find workitems for this task in the monitor (use transaction SWI2_FREQ) whenever an IDoc with status 51 has arrived for your message type.
    Could you please check is the type linkage is active and if so wether or not work items have been created?
    Regards,
    John.

  • Contract Approval

    Hello SRM Folks,
    We are on SRM SERVER 550 with support package SAPKIBKT09 - strategic sourcing. We have activated the Workflow Without Approval for Contract for event  saved and save change version (no approval required ). The strange part is that the contract status is still Awaiting Approval  although the contract header data - approval preview says No Approval Required.
    The SAP note '1018880 - Contract Remains in Status Awaiting Approval' describe the same issue but we  already have that correction in our system. Could you please suggest your view about this issue.
    Full points to those who answer..
    Cheers,
    Amit

    Hi,
    General steps for trouble shooting.
    1. Transaction BBP_PD
        - Check document status
        - Find workitem ID
    2. Transaction SWI1 or SWI6
       - paste the workitem ID
       - Check workflow status and log
    3. If you find some errors
      - check SWU2 and ST22
    4. In case your workflow template was not generated.
    Please check the note 962488 "Workflow definition '&' not in version '&'".
    1. Run the function module SWD_WFD_REPLICATE_FROM_9999 and copy it.
    2. Re-activate the WF definitions in the transaction SWDD
    3. Check Consistency in the transaction SWUD
    Also check the sub workflow.
    Regards,
    Masa

  • Restart Workflow after error in Production Server.

    Hi Experts,
                     We had a Problem in PO Release in production Server no we have set the release strategy again.
    1)Can i Restart the Workflows from that date so that the PO which where in error will work with the new release strategy ?
    2) T code to Restart WF after Error is SWPR Right ? or should i Use SWPC
    3) Please tell me where to find WorkItem ID
    Regards,
    Hari

    Hi,
    if you know for what Key id you had wflow errored out, you can find it. FOr example, any invoice, Notification, etc., go to that document or notification, and click on the "Services for Obj" icon and go to workflow--->wflow over view. THis is how you get to the wflow log. And in that, youcan choose the Technical Details view which gives you the witem id.
    Instead, you can use SWI6 and give the BO and exact key and you will get to wflow log..Or you can use Txn SWI2_DIAG..
    Hope this helps
    venu

  • TaskInstance gets deleted intermittently

    Hello there,
    I have made an application where i have craeted seperate workflows for creation, modification of user accounts. The system is Live now and we have been facing a peculiar problem.
    The requests raised goes to SQL database(not repository databse, we have serperate databse for storing requests details) and it is picked up and shown to the users who has approver's rights in the organisation.
    Find below the flow of the workflow:
    1. User A raises a request and it goes in the SQL database where it also stores the TaskInstanceID of the taskInstance generated(corresponding to TID column of DB). The request lies in the database and hence can be seen by all the users of organisation. But the request needs approval and can only be approved by a user with appropriate rights.
    2. User B who is an approver logs-in and opens the request. He can see the approve button and would approve it. Now the request will need second level approval in a similar fashion.
    3. User C who is a second level approver logs-in and opens the request. He can see the approve button and would approve it finally.
    Now the intermittent problem lies between step 1 & 2 and Step 2 & 3.
    Sometimes when user B opens the request he finds the error that workitem does not exist. we checked from repository that both the taskInstance and Workitem has been deleted.
    The samething sometimes happens with user C. They are able to see the request because request is stored in SQL databse but when workitem is displayed then sysetm is not able to find workitem as well as TaskInstance.
    This is a very old issue and due to a alrge number of users we cannot afford to put trace to see from where atskInstance is terminated.
    Additionally, i found that there is a activity whoch does not have a default transition and hence when none of Transition condition is met, the TaskInstance & Workitem terminate immediately. I added a default transition to avoid it but still we are facing the same issue.
    can you please help me to find out the cause?(we are not able to see the taskInstance because it gets deleted and we never come to know where the taskInstance actually terminated)
    This is an urgent issue and i shall be very thankfula for any help....Thanks in advance

    Hello mates.....I forgot to mention few things here...... My only concern in this issue is that i want to know that at what point the taskInstance gets terminated. I have mentioned few possible reasons which came to my mind:
    The taskInstance can get terminated in following circumstances:
    1. If there is no default transition (as i mentioned). In this case if the workflow does not meet the conditions in any of the transtions, then it terminates immediately. I could find one such transition and corrected it but in vain.
    2. Possibly, the workflow enters in cycle of transitions between two activities (with no manual Action), i goes in infinite loop and when maximum number of steps in taskInstance is reached, then it terminates. The maximum number of steps is configured as 5000 in systemConfiguration file.
    3. Some unwanted transition is forwarding the control to "end" activity causing termination of taskInstance.
    I AM NOT ABLE TO THINK OF SOME OTHER POSSIBILTY.
    I dont have much expertise in IDM and want to know if there is any way to detect the path a taskInstance followed(1 , 2 or 3).
    I am left with the taskInstance ID but it cannot give me details because taskInstance termination causes its removal from repository and it is not found from DEBUG console.
    I cannot use trace in the whole workflow because daily there are around 2000 requests raised and i wont be able to figure out the path from the mixed trace output in logs.
    I am totally confused and have spent more than a month investigating this issue. I am here in a hope to get some expert advise.
    Thanks

  • Work Item or Document is disappear from Inbox

    Hiya,
    Any ideas on why the workflow item or document is disappear from inbox SBWP once you clicked to display/view the document without perform any task action.
    Cheers,

    Hiya Raj,
    "you can check log of executed workitem from SBWP, go to OUTBOX-> "WORK ITEMS EXECUTED BY ME" .there you can find workitems you performed from your INBOX."
    Those work items which have executed are flow to OUTBOX -> Work Items Executed By ME.
    Where is the place to check logs?
    However as mentioned those messages in both inbox folder "Unread Document" or "Document" is disappear after you clicked on either those folders without read the message or perform any action. Any ideas?
    Cheers..

  • IF_SWF_IFS_WORKITEM_EXIT: How to find out recipient of forwarded Workitem

    Hello everybody,
    I am developping a workflow application with an external status monitoring, i.e. for each workitem I must write the current status as well as the person or organizational unit who is reponsible for the workitem to an external Z-table.
    I found that the programming exits using the interface IF_SWF_IFS_WORKITEM_EXIT would be the right way to do this. However, I cannot find the recipient of a forwarded workitem in the whole object, neither a method which would return this information.
    Does anybody have an idea?
    Thanks a lot
    Martin

    Hi,
    not quite.
    I want to achieve the following:
    Let's assume, the workitem is in the inbox of user DILBERT.
    Now DILBERT is in his Business workplace, selects the workitem and clicks "forward". He gets the popup to enter the user he wants to send the workitem to. Let's say, he picks user WALLY.
    Now I want to upate my custom status table with the user WALLY as the actual agent. Unfortunately, when I call the mehtod IM_WORKITEM_CONTEXT->get_header, the field WI_AAGENT still contains the value DILBERT instead fo WALLY.
    And I can find the value WALLY in no other accessible field either.
    Thanks,
    Martin
    Edited by: Martin Krausch on Apr 19, 2009 4:47 PM --> corrected typo only

  • How to find the user who approved the workitem.

    Hi experts,
    I have created a parking/posting workflow.
    When the user Approves, parked document is posted and BKPF table is updated with WF-BATCH as user name.
    Now I need to find the actual user who approved the workitem for posting.
    My plan is:
    1. Find the workitem id using the BOR, company code, document no, year, task no.
    2. Find the user who processed the above obtained worktem id.
    Please let me know the tables for the above points 1 and 2.
    Or let me know if there is any other way to find the actual user.
    Regards,
    Karthik

    Hi,
    To get the workitem ID with respect to a specific business object instance make use of the FM SAP_WAPI_WORKITEMS_TO_OBJECT
    To know who processed the determined workitem either you can make use of the FM SAP_WAPI_GET_WORKITEM_DETAIL or directly read the table SWWWIHEAD and you can find the actual agent WI_AAGENT this is the field which says who has executed the workitem.
    Regards
    Pavan

  • Find the list of forwarded workitems, forwarded by and forwarded to agents

    Hi experts,
    I want to find the list of workitems which were forwarded and the corresponding forwarded by and forwarded to agents.
    The above requirement is for workitems of all kinds of status (might be completed, ready etc..)
    Please suggest.
    Regards,
    Karthik

    Thanks a lot vikram,
    Hence the answer is refering to SWWLOGHIST table.
    We need to pass the value 'SWW_WI_FORWARD' (which is an FM) to the field 'METHOD' of SWWLOGHIST table and get forwarded by and forwarded to agents from 'METH_USER' and 'PARA_VAL_1' fields for the worktiems in any date range.
    Regards,
    Karthik

  • How to find all workitems in sap

    Hi All,
    I need to find all the workitems present in user's inbox in sap.Pls let me know how to find it.
    In my case, i am getting issue lock table overflow due to which user not able to login to sap system. I checked in SM12 & it show that it happened during execution of half-hourly report RSWWCOND by WF-BATCH.
    Is it bcos i have no of workitems pending & locked by this report & when the next lock requested by this report , we get the above overflow issue.
    pls do help.
    Thanks.

    Hi Harrysingh,
           A Standard workflow design will never get into Lock Table overflow. and unprocessed Workitem will not create any entry in the lock table. This should because of some Bespoke and can be found out from SM12. Once you get the table which is creating maximum no if locks, you would be able to guess where the problem is. Processing all the unprocessed workitem will not solve the lock issue, provided the method coding do not have junk codes.
    Regards,
    Simin Raveendran.

Maybe you are looking for