How to set the status of an Workitem, while processing?

Hi,
My requirement is to set/ Change the workitem status after/ while procecssing if certain condition is not met for all the users. I have one workitem assigned to multiple users. If any one of the user's executes the workitem, it displays a zprogram, but the user has not taken any action (SAVE), he simply came out of the transaction using "BACK" button. Here the Workitem has been vanished/disappeared from the other two users Inbox, and the workitem is in "In Processu201D Status for the User who executed the workitem. But my requirement is to set the workitem to be in "READY" status for all the users to whom the workitem is assigned; until the user "SAVE" the transaction I need the workitems to be in "READY" status only.
Please suggest me with your ideas to get the above results.
Note: I have used the function modules u201CSAP_WAPI_SET_WORKITEM_STATUS (or) SWW_WI_ADMIN_READY ", to change the status of the workitem while processing, it's throwing an error u201CWork item & locked by user & (enqueue erroru201D.
Thanks in advance,
Ajay Kumar

Thanks Florin,
Your piece of code has worked alot, and it was very helpful in changing the Status of the Workitem to "READY" for all the Users fo the workitem.
Points have been rewarded for your help.
Process: We have acheived this using the "Work Item Exits", Usng "AFTER_EXECUTION" Method.
Note: The Exit will be executed if "exit_cancelled"  statement is present/used in the work item method. if not it is not taking to the exit code. I'm unable to find the reason for it. Florin can u please explain this point.
Please check the link for adding the code in Work Item Exits.
http://wiki.sdn.sap.com/wiki/display/ABAP/ProgramExitsIn+Workflow
Please find the Code:
method IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED.
Get the context of the workitem
  me->wi_context = im_workitem_context.
After execution of the workitem call the method AFTER_EXECUTION
  if im_event_name eq swrco_event_after_execution.
    me->after_execution( ).
  endif.
endmethod.
METHOD AFTER_EXECUTION.
This method acts as the Event Handler for SWRCO_EVENT_AFTER_EXECUTION
  DATA: LCL_L_WID TYPE SWW_WIID,
        L_STATUS TYPE SWR_WISTAT-STATUS,
        L_NEW_STATUS  TYPE SWR_WISTAT,
        L_SWR_MESSAG  TYPE STANDARD TABLE OF SWR_MESSAG,
        L_SWR_MSTRUC  TYPE STANDARD TABLE OF SWR_MSTRUC.
Get work item
  CALL METHOD WI_CONTEXT->GET_WORKITEM_ID
    RECEIVING
      RE_WORKITEM = LCL_L_WID.
  L_STATUS = 'READY'.
  CALL FUNCTION 'SAP_WAPI_SET_WORKITEM_STATUS'
    EXPORTING
      WORKITEM_ID    = LCL_L_WID
      STATUS         = L_STATUS
      USER           = SY-UNAME
      LANGUAGE       = SY-LANGU
      DO_COMMIT      = 'X'
    IMPORTING
      NEW_STATUS     = L_NEW_STATUS
     RETURN_CODE    = SY-SUBRC
    TABLES
      MESSAGE_LINES  = L_SWR_MESSAG
      MESSAGE_STRUCT = L_SWR_MSTRUC.
  IF SY-SUBRC EQ 0.
  ENDIF.
ENDMETHOD.
Thank You Once Again,
Ajay Kumar Chippa

Similar Messages

  • How to set the status for a customer plan to RELEASED.

    Hello all,
    I created a program for mass creation of customer plans. But after the creation of a plan, the status should be set to released, so that the user can go about creating the trade promotions for the customer plan. Can anybody tell me how to set the status of a customer plan to RELEASED.
    Thanks,
    Disha.

    Hi Clemens,
    I am not talking about doing it in the CRM_UI transaction..I created a program..which would create the customer plans based on the planning account data provided. I was succesfull in creating the plans, but I am not knowing how to release it, if only anybody can tell me about a Function module or method, which can help me do this, that would be great
    Thanks,
    Disha.

  • How to set custmer master block for posting & how to set the status .....

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. Use an appropriate subject in your message thread. >
    Hi ...
    How to set custmer master blocked for posting & how to set the status has deleted. please provide the steps for the above two actions.
    thanks

    Hi,
    U can use T-code FD05 for Blocking the customer and
    T-code FD06 in order to set for deletion,
    Assign Points if useful,
    Regards,

  • How to set the Status

    Hi
    How to set the status of  user defined form as "closed" . I have one form, i want that form should not be editable after one condition is true. Can anyone tell one solution
    Advance Thanks
    jintu

    Hiii,
    Use this
    Sub FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
            Try
                Select Case BusinessObjectInfo.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD, SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE
                        If BusinessObjectInfo.BeforeAction = True Then
                            objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
                        ElseIf BusinessObjectInfo.ActionSuccess = True Then
                            If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE Then
                            End If
                        End If
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD
                        If BusinessObjectInfo.ActionSuccess = True Then
                            objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
                            objForm.Freeze(True)
                            If (objForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE) Then
                               if objForm.Item.Items("Status").Value.equals("Closed")= True
                             objForm.Mode = SAPbouiCOM.BoFormMode.fm_VIEW_MODE
                             End If
                              end if              
                        End If
                End Select
            Catch ex As Exception
                objMain.objApplication.StatusBar.SetText(ex.Message)
            End Try
        End Sub

  • How to set the status when Idoc fails

    Hai ,
    I created Idoc extension & created a segment under that(Delivery related).
    My requirement is,
    if certain data not found,
    Idoc should fail with text"Shipemnt for delivery <del. No> not found.
    Could you please help me how to do this?
    I checked the table EDIDC table but the above mentioned status is  not there.
    Thanks & Best Regards,
    Bhaskar.

    you need to set the status using IDOC_STATUS
    where ever error occurs populate the status table.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
       IDOC_STATUS-STATUS = '51' ." if it is inbound
       IDOC_STATUS-MSGTY  = Message-type.
       IDOC_STATUS-MSGID  = message-id.
       IDOC_STATUS-MSGNO  = message-MSGNR.
       IDOC_STATUS-MSGV1  = message-MSGV1.
       IDOC_STATUS-MSGV2  = message-MSGV2.
       IDOC_STATUS-MSGV3  = message-MSGV3.
       IDOC_STATUS-MSGV4  = message-MSGV4.
    *  IDOC_STATUS-SEGNUM = ?????????????????
    *  IDOC_STATUS-SEGFLD = ?????????????????
    *  IDOC_STATUS-UNAME  = ?????????????????
       IDOC_STATUS-REPID  = SY-REPID
    *  IDOC_STATUS-ROUTID = ?????????????????
       APPEND IDOC_STATUS.

  • How to set the number of sockets for batch processing at runtime?

    Hello all,
    I need to change the execution model at runtime. I have achieved this by setting the 'ModelPath' property of the sequence file at runtime. When I set the sequence file model as batchmodel, i need to set the number of test sockets also dynamically. How can this be done? Once i set the number of sockets, i would also have to set the UUT serial number for each socket. Please help me out in solving this.
    Thanks and Regards
    Madhu Srinivasan.

    Hi Madhu,
        You can do this by inserting a sequence file callback into your main sequence and choose the ModelOptions callback. You can then use the expression step to set the "Parameters.ModelOptions.NumTestSockets" value to whatever you want. If you then use the Test UUTs execution entry point you will be prompted for serial numbers automatically. You could also use this same procedure but alter the ModelOptions callback in the process model directly, either way works just as well but I think that using a sequence file callback gives a bit more flexibility in the system.
    Hope this helps,
       Nick

  • How to check the status of instance in my Process

    Hi,
    I have a requirement where I want to check for the status of an instance and if completes in error then send an email. I've been told that there are Bpel tables where I can check the status and there are also Bpel API's I can use.
    Can you please let me know what is the best way to do this and if so, some guidelines on how do I design this...I'm fairly new to BPEL and would really appreciate your help
    Thanks
    -Prapoorna

    Hi
    First let me explain how I understand your requirement.
    There is a bpel instance. This can either complete successfully or with error (basically some fault has occurred).
    If the process completes with error a email should be sent.
    Well this is how I would design this.
    Put the code that might succeed or fault in a scope. Add catch or catchAll block in the faultHandler of the scope.
    Write the email stuff in the faultHandler.
    Just in case you are still interested you can find the instance state Bpel table details in the below link.
    http://oraclebpelindepth.blogspot.com/2008/08/bpel-process-states.html
    If you are willing to explore the Java API stuff you can find some useful stuff in here.
    http://oraclebpelindepth.blogspot.com/search/label/Java%20API
    This will tell you how to setup context, include which jars and a simple java thing to see some thing working.
    Now regarding state, you can use locator.listInstances(WhereCondition wc) to get instances list in IInstanceHandle[].
    In the IInstanceHandle use the method getState() to get the state of the instance.
    Every Little Helps
    Kalidass Mookkaiah
    http://oraclebpelindepth.blogspot.com/

  • How to determine the status of  Maintenance Order while working in workflow

    Hello Experts,
       I am working on a workflow to release production related maintenance order.In this workflow I need to determine the status of the Maintenance Order (BOR object BUS2007) whether it has been released or not.I am trying to do this by condition step type.I can't understand which field of BUS2007 object I need to check to know the status of the maintenance order.
    Can somebody help please?
    Regards,
    Manas

    Hi,
    Have you not getting any value in Status Profile attribute.
    For new attribute u need to write coding, getting the value of that released field.
    First, u need to implement by going to Edit->Change Release Status ->To implemented.
    Then check your BO and generate it. If any error occurs in Menu bar Goto->Error List and see what is the error.
    After generation of your BO, test your BO.
    If test works fine, then Delegate with the standard BO.
    To delegate, u need to be in initial screen of SWO1 and goto Settings->Delegate. Give Super type as Std BO and delegate type as your custom BO and use the Std BO in your workflow.

  • How to set 'error' status with DB poll Adapter in OSB

    1. Configured DB Adapter to poll rows with status 'notprocessed' and set the status to 'processed'
    2. Configured FTP Adapter to write fetched rows from DB into a CSV file
    Now my requirement is if any error like FTP server is not available, how to set the status in DB table to 'error'

    Yes Vlad you are right, this will avoid another DB connection created in Error Handler.
    I hope this will provide some lights on the usefulness of "Transaction"
    http://www.nysolutionsltd.com/transaction-handling-in-oracle-service-bus/
    http://kd-blog-tech.blogspot.com.au/2010/12/transaction-management-for-osb-service.html
    Regards
    RK
    Edited by: RK.. on 27/03/2013 17:10

  • Set the status of mass orders from CLSD (Business completion) to TECO

    Hi All,
    Can you please help me out on how to set the status of multiple orders from CLSD (Business completion) to TECO(Technical Complete) .
    Regards,
    Shruthi.

    I'm assuming production orders, you can do that in COHV, selection criteria Sys. Status "CLSD". Click on Mass Processing button and select Technically Complete.

  • Exit to set the automatic PGI and picking while creating outbound delivery

    Hi experts,
    Could anybody suggest how to set the automatic PGI and Picking while creating outbound delivery.
    Currently we are settting VBUK-WBSTK field with value C. But PGI is not happening.
    kindly help me.
    Regards,
    Ravi

    Hello Parihar,
    thanks for reply.
    yes we know that "This process of picking and GI involves reducing the stock and allocating the goods to the delivery"
    if you go for Custom program and Use FM WS_DELIVERY_UPDATE, we can do Picking and PGI.
    our requirement is to do pickong and PGI while creating Delivery it self, based on this output types will be processed.

  • How to set the message in the status bar...

    hai,
    how to set the message in the status bar...
    let us say "inserted data successfully, or opening page followed  by the link clicked on the screen....."
    kindly help me out

    sunil,
    do not use advise by Ashutosh with WebDynpro.
    Instead of placing message into browser status bar (and browser is not the only WD UI agent), use IWDMessageManager API to post messages of such kind:
    wdComponentAPI.getMessageManager().reportSucces("Record inserted"); 
    VS

  • How to Set the APPR status in Background for service orders

    Hi Friends,
    could anybody please ,let me know how to set the APPR satus for the seleted service orders( IW32) in background?
    Regards,
    Xavier.P.

    Hi,
    Thanks for the reply and you are correct, I am using BADI and I am calling this BAPI inside the method.
    Now I am trying to execute this BAPI from SE38 and I am getting the error message, "Error in processing ,Function was not executed". I am able to see this message in the return parameter of the BAPI (Error type - 'E'). And it is giving dump after the call to BAPI_TRANSACTION_COMMIT.
    I am using conversion routine 'CONVERSION_EXIT_ABPSN_INPUT' before passing the WBS element to the BAPI.
    Please help in this regard.
    Regards,
    V Kumar
    Edited by: V Kumar on Jun 26, 2009 1:42 PM

  • In Standard Report Of ALV How Can Set PF Status.

    In Standard Report Of ALV How Can Set PF Status.
    Thanking in anticipation.

    in the call function module, you pass the PF status parameter.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = pgm
       <i> <u>  i_callback_pf_status_set = 'SET_PF_STATUS'</u></i>
          it_fieldcat              = fieldcat
          is_variant               = disvariant
          is_layout                = layout
          is_print                 = print
          i_save                   = 'A'
          it_events                = eventcat
          it_sort                  = sortcat
          i_callback_user_command  = 'USER_COMMAND'
        TABLES
          t_outtab                 = a_output
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    ENDFORM.                    "LIST_DISPLAY
    FORM SET_PF_STATUS *
    FORM set_pf_status USING extab TYPE slis_t_extab.
      SET PF-STATUS 'ZZSTD'.
    ENDFORM.                    "set_pf_status
    Here double Click on ZZSTD. IT will take you to a different screen and you have to set it.
    Ster.

  • How to set the tasks as cancelled

    Guys ,
    I had a scenario , where i have written a setObjectStatus adapter which sets the status of RO as Revoked.
    So i have provisioned a resource to a user and did some updates on resource profile as well , the status of the RO is provisioned and the tasks
    like create user , abc updated etc ... as completed .
    Now i fire the setObjectStatus adapter and it sets the RO status as revoked successfully . The check boxes like enable, disable , revoke etc are disabled as a result of setting the RO status as revoked . But the task inside doesnot become canceled.
    Any ideas how to achive the cancellation of tasks as well ?
    Thanks
    'Suren

    Hi Surendra.
    What did you get when you run the tcUserOperationsIntf.getObjects(userKey)? When you run this method, you'll get all object instance for a specific user, so you have to read the Object Instance.Key attribute.
    Also, you can invoke the methods below of useroperationsintf:
    void revokeObject(long plUserKey, long plObjectInstanceForUserKey)
    Revokes the provisioning of an object for a user directly without going through a request.
    void revokeObjects(long plUserKey, long[] paObjectInstancesForUserKey)
    Revokes the provisioning of an object for a user directly without going through a request
    Renato.

Maybe you are looking for

  • Problem opening adobe photoshop elements 11

    I cannot pen photoshop elements 11 anymore. I geta runtime error message

  • Connecting iPOD to stereo receiver

    Sorry if this has been asked before but I couldn't find anything posted. I have an 80 gig Fifth Generation iPOD and was wondering if there was a way to connect it to my stereo receiver by use of RCA plugs or other wired means??? I know I could use a

  • Iphone disabled

    I am unable to access my iphone, it says iphone disabled, connect to itunes, i am unable to make the connection

  • Once more!!can anyone help me ?

    cold you help me with these codes, my jsp page brings me no result, a blank page. Can you tell where's the mistake? Thanks in advance!! this is my context: package teste; import java.util.ArrayList; import javax.servlet.*; public final class ContextP

  • Panasonic DMC-G10 and DMC-G2

    Can anybody at BB tell me if and when BB will get these latest Panasonic four thirds cameras in the stores? One or the other of these (probably the DMC-G10)  will check all of the requirements boxes for me insofar as digital cameras go.  Thanks