2 level leave approval workflow.

Dear Expert,
I am trying to update the status for the leave request. I created a sampel program with the following code in SE38 and put in the following code. However, it seem that it does not work and the status did not get updated for that particular leave request
Anyone knows what is the problem?
DATA:
request TYPE REF TO if_pt_req_request,
event   TYPE tim_req_xfer_event VALUE cl_pt_req_const=>C_REQTRANS_APPROVE,
req_id  TYPE PTREQ_HEADER-REQUEST_ID value '48561480F033007EE1008000C0A8D282',
status  type TIM_REQ_STATUS.
CALL FUNCTION 'ENQUEUE_EPTREQ'
  EXPORTING
    mode_ptreq_header = 'E'
    request_id        = req_id
  EXCEPTIONS
    foreign_lock      = 1
    system_failure    = 2
    OTHERS            = 3.
CALL METHOD ca_pt_req_header=>agent->get_request
  EXPORTING
    im_request_id = req_id
  IMPORTING
    ex_request    = request.
CALL METHOD request->initiate_state_transition
  EXPORTING
    im_transfer_event    = event
   im_event      = event
   IM_RET_VALUE  = 0
  IMPORTING
    ex_new_status = status.
CALL FUNCTION 'DEQUEUE_EPTREQ'
  EXPORTING
    request_id = req_id.
Thanks
Regards,
Bryan

hi Brian Lee 
I thing if u debug the method ca_pt_header finally you would get has request id is locked or request id is not found. check this 1st .
<inappropriate content removed by moderator>
Regards
vijay
Edited by: Mike Pokraka on Jun 19, 2008 3:38 PM

Similar Messages

  • N-Level Contract Approval (workflow problem)

    Hello friends,
                        We are using SRM 5.0 , ECS scenario.. My problem is related to N-level contract approval. I had activated workflow WS 14000148 for N-level approval.. In development system it is working fine but in production system I am facing following errors after first release of contract.
          Executed Auction             Error Message
    Exception occurred        Error when starting work item
                                      000000008004
    PROCESS_NODE      Error when processing
                                     node '0000000007'
              (ParForEach index 000000)
    CREATE          Error when creating a
                                    component of type 'Step'
    CREATE_WIM_HANDLE   Error when creating a work
                                           item
    CREATE_VIA_WFM           Error within method
                         CL_SWF_RUN_WIM_FACTORY-
                        >CREATE_VIA_WFM
    GET_WITYPE        Unable to determine work item
                                 type for step at node                        0000000007
    GET_TASK_HANDLE         Error when loading task
                                        WS14000085
    FIND_BY_WFDWIZ         Workflow definition of
                                        task 'WS14000085'
                                        cannot be Activated
             Sub-workflow WS14000085 available in main workflow WS 14000075 which is deactivated. But problem is when I am trying to see workflow  WS14000085 through SWDD in production, no workflow is there but same workflow I can see in Development system.  Any expert have any idea why same workflow I can see in development but I am not able to see in Production system.
    Thanks in advance.
    Abhijeet Panse

    Hi,
    It looks workflow template is missing.
    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

  • Error in Leave Approval Workflow

    Hello Experts,
    I'm Using Standard Workflow WS0040077 for Leave Approval . I Activated the Event Linkage in SWEL .Did General Task in Agent Assignment . But when i run transaction PA30 . i get this error in SAP Inbox.
    Following error occurred:
    00 341
    RFC_NO_AUTHORITY
    Message text:
    Runtime error RFC_NO_AUTHORITY has occurred
    SAP System: EDV
    Client: 100
    Event container appended as attachment.
    Event linkage not changed.
    Event stored temporarily.
    Events can be redelivered via event queue
    administration (transaction SWEQADM).
    so what should i do to solve this problem.

    Hi,
      Have you checked the workflow config in SWU3? It sounds like there may be a problem with the LOCAL RFC destination used by workflow. Click the 'Start Verification Workflow' button in SWU3 as a health check.
    Also, are you testing this in the right client?
    cheers
    Paul Bakker

  • Multiple Levels of Approval Workflow in SPD

    Hi-
    I'm building a workflow that has multiple levels of approval behind it.  I know how to set up the multiple levels of approval, but sometimes this workflow needs to have 2 approvals and sometimes it needs to have 3 approvals.  I'm hoping to pull
    the info in from a SP List, but am not sure to do with the different number of approvals needed.  Does anyone have any suggestions?
    Thanks a lot!

    Yes you can create a column in SP List containing the Approver names. This should be a People/Group field or Single line of text can also work.
    In your SPD workflow you can track the status of the previous Approver and based on this you may allow the workflow to move to next or stop it. Assuming that you will create a Status column having two values - "Approve" and "Reject".
    If Approver selects "Approve" then workflow proceeds for next approval or else the workflow stops or if Approver chooses "Reject" then you may create a new task for the previous Approver and send him an email - Just a suggestion if you
    have back and forth approval system.
    If it is a simple sequential approval then can go for out-of-the-box Approval Workflow available. If there is some level of conditions then SPD workflow is an option.

  • Leave approval workflow

    people, i have a query ragarding leave approvl workflow. as per standard employee has raised request in ESS, sap will send it to 02, what will happen if position of 002 (reports to) is vacant ?  does it automatically and immediately goes to 012 (chief)? what is the chief position is vacant.? does it goes to the O-O and then chief of that org unit?
    can the approver forward it to other person in the org strucure by selecting his pernr in MSS.
    need help

    Hi Manoj,
    Check if you are using structure authorizations. If this is the case the substitution will not be able to process the workitem. Otherwise it still could be an authorization problem. Compare the HR authorizations, i suspect the problem will be in there.
    Regards,
    Martin

  • How to get Agents in Leave Approval workflow

    Hello Experts,
    I'm using Standard Workflow for Leave Approval i.e WS 00400077. Since it is Standard Workflow it should get the AGENT automatically. But when i execute ny Workflow and when i check in SWEL Workflow is Working Properly but It is showing
    " NO AGENT " is there. so i'm not getting Workitem in Inbox.
    So what should i do.
    Help me to solve this problem.
    Regards,
    Vardhan.

    Hello,
    "when i check in SWEL Workflow is Working Properly but It is showing  " NO AGENT ""
    Look in SWI1 instead and see if an agent has been assigned. In some cases "No Agent" can just mean it hasn't be executed yet.
    regards
    Rick Bakker
    hanabi technology

  • Multiple Leave Approval problem in workflow  WS21500001 -webdynpro

    hi,
    We are using standard webdyppro leave approval workflow WS21500001, but inhere does not provide multiple approval level.  Our requirement is we need two approval levels for this. So I copy the stranded workflow and create the second approval leave.  In here Iu2019m unable to send second approval document into the mailbox, I was write rule to get the second approver, its working fine but once the 1st approval  finished mail doesnu2019t go to the second approver inbox. Can you help me to do this?
    Regard,
    nawa

    Hello,
    Do you mean mail or workitem? I think you mean workitem.
    Use tx SWI1 to look at the workflow log and you'll see what the workflow is doing and why it's skipping the second approval step.
    regards
    Rick Bakker
    hanbi technology

  • AD-hoc approver n step item level shopping cart workflow

    Hi
    We are on latest version of SRM and using n step item level SC approval workflow.
    The scenario goes like this:
    -     Requester creates shopping cart and workflow goes for two step approval.
    -     In the approval preview the requester is able to see both levels of approvers, which is correct.
    -     Requester now selects second level approver and replaces him with a ad-hoc approver. WE DO NOT WANT THIS.  Requester should NOT be able to replace an approver determined by approval badi. However should be able to extend approval step with ad-hoc approver say third level approver a ad-hoc approver. Also he should be able to change AD-HOC approvers ONLY.
    Thanks
    Joe

    Jo,
      You may be able to achieve it in the BADI BBP_WFL_SECUR_BADI .
    You can use the Business Add-In (BAdI) BBP_WFL_SECUR_BADI to determine whether
    A shopping cart can be changed during the approval process
    The approval workflow restarts when changes are made to the document
    A reviewer/approver can be added or changedThese are the call scenarios (see import parameter SCENARIO).
    Regards,
    Suren

  • HR Leave Approval issues

    hi everyone,
    I have modified the standard HR Leave approval Workflow WS002000077. In that workflow user decision, Unlock step type, loop steps are available. I am getting user decision workitem in inbox. When i click approve option, i has to go to unlock step type. But it is not going for unlock step.
    The same scenario is working good without loop, i can able to unlock it.
    So, in this scenario with loop, I am getting following errors;
    1. variables of the work item cannot be generated.
    2. Error in the evaluation of expression '&EMPLOYEET<???>.NAME&' for item '10'
    3. Error when determining attribute 'NAME' of object instance '[BO.EMPLOYEET.]'
    4. Agent determination for step '0000000038' failed
    5. Source (expression '&EMPLOYEET.ADMINISTRATOR.ADMINISTRATOR&') of binding assignment is not available
    6. Source (expression '&EMPLOYEET.ADMINISTRATOR.ADMINISTRATORGROUP&') of binding assignment is not avaible
    7. Error in the evaluation of expression '&EMPLOYEET<???>.ADMINISTRATOR.ADMINISTRATORGROUP&' for ite
    8. Error in the evaluation of expression '&EMPLOYEET<???>.ADMINISTRATOR.ADMINISTRATOR&' for item '10
    here item '10' refers to loop step. I am using custom rule. It is working fine without loop condition.
    Thanks in advance!!

    hi,
      That one previous workflow and it solved. But now the same one with loop for Re-submission of Leave Request after change.
      Actually the values from Employeet is not flowing in the Unlock step for agent determination. Because of that the agent determination is not possible for me. But it works well without loop scenario. Employeet is not instantiated.
    Here i am using loop condition for re-submission of leave request.
    Thanks,
    Balaji.V
    Edited by: Balajisap on Sep 19, 2011 3:56 PM
    Edited by: Balajisap on Sep 19, 2011 6:22 PM

  • Approval workflow timelines ..

    Folks ,
    I am new to OIM 11g and SOA workflow .
    Can anyone help me estimate the time required to develop a simple 2 level request approval workflow for a RO.
    Thanks

    if you ask me for static two level approval .. the dev time for me would be 1 day I will say! :-) but this depends upon who is doing it ... but simple static 2 level approval is quite simple in soa.
    -Bikash

  • Three level sc approval wf

    Hi all,
    I am currently working on three level sc approval workflow...
    the 1st level approval is based on product category,2nd level is based on costcentre and the 3rd level is based on the shopping cart value...i am currently working on the BADI...what value should i give for the approval index for each level..i am not clear abt the actual approval index..can anyone help me..
    Thanks&Regards,
    Hari.

    hi ,
    there is default implementation already provided by SAP along with the system --> please have a look.
    if you have three approvers
    1) first approver will have index 1 , second will have 2 , third will have 3.
    you have to code your BADI in such a way ---> that approval table will have correct number of approvers depending on the input of the shopping cart.
    approval_table is very critical in badi ---> this defines the approvers involved in approval chain
    Edited by: khan voyalpad usman on Jan 11, 2008 1:13 AM

  • Multi Level Leave workflow in ESS MSS

    Hi Guys,
    This is the first time I am working with ESS MSS and I have to implement 2 level workflow for leave, I have gone through lot of threads and concluded that i have to enhance class CL_PT_REQ_WF_ATTRIBS
    with new method where I have to change the status back to SENT after first level of approval and create new background task and attach it to custom workflow which is copy of standard.
    Now my problem is I have enhanced the class CL_PT_REQ_WF_ATTRIBS with new method change status but when I am creating the task I canu2019t see that method in drop down list of methods.
    Any idea why it not showing.
    We are on ECC6. EH4
    Atul
    Edited by: Atul Dhariwal on Mar 8, 2011 4:56 AM

    Hi Atul
      You are doing wrong way. You need to use BADI to enhance that for that goto SE18 search with PT_GEN* and get the BADI name and goto se19 and create a implementation for that there you in the desiered method you can code. But remember you cannot add you own need method the BADI. What ever SAP is providing that one only you can use to add additional code not addding new method.
    Regards
    Vijay

  • Auto Approval Workflow for leave request Management.

    Hi Guru's,
    I am working on leave request Workflow i.e WS12300111.
    Now i have to implement the auto approval of workitem if the approver doesnt take any action in 3days.
    1. i have implemented deadline monitoring i.e in Latest end tab
    refer date/time :- Expression Date : %DATUM% Time : %UZEIT%    3 days Action : Modeled  Display test
    Outcome : Reminder Mail
    In outcome tab i have activated Processing obsolete.
    i have created an activity if the deadline is reached so that it should auto approve the workitem.
    in that activity i have created a copy of class CL_PT_REQ_WF_ATTRIBS created 1 method auto_approve. and used function module PT_ARQ_REQUEST_EXECUTE so that it will change the status from SENT to APPROVE.
    But when i apply leave in portal , workflow starts but it doesnt reach to branch auto approve after the deadline is reached.
    Please suggest is the deadline monitoring implemented correctly or not .
    whether the auto approve method used is correct or not
    or there is another solution to this
    I have checked the SWU3 setting and it is green.
    Please Advise
    Thanks in Advance
    chitis

    Hi Rick ,
    Thanks for the Reply.
    But is there something wrong in deadline monitoring i have maintained for the task.
    could you please share the procedure for implementing deadline monitoring specific to auto approval of the workitem.
    thanks in advance
    chitis

  • PO Approval Workflow on item-level?

    I have a requirement to implement an approval workflow when the price or cost center/internal order is changed on the purchase order.
    The problem is that as I see it, standard SAP only allows approval on header level for Purchase Orders.
    Is there a way to handle approval on item-level if for example the PO has 2 rows, we change the cost center on both these rows to different ones???
    Based on this cost center, the approval should then go to the cost center responsible and then his boss and so on based on the org-structure.

    Hi,
      Consider a example , you have a PO and this PO has three items IT1, IT2, IT3. Based on the cost center, you want to send the respective item for approval to the respcetive KOSTL manager .
    Desgin your workflow in this way.
    1. Design a background activity step in  and a BOR method where it returns you all the items  of the PO and store these items in a multiline container element in the workflow container.
    2. Now next to the above step include a [BLOCK step|http://help.sap.com/saphelp_nw70/helpdata/en/cc/18a8f409a93749b10e8dd9f9d81797/frameset.htm] in the workflow and choose par for each option and pass the items stored multiline container element. The use of the block step is it dynamically creates a parallel branches based on the number of rows in the multiline container element you mapped to the block step.
    3. Now Inside the block step create another bor method and include a bacground activity step. Now in this BOR mehtod what ever the item you import try to determine the manager of the KOSTL(Cost Center.) and who ever is determined pass that user(s) name(s) back to the workflow container.
    4. Next to this step include a decision step and choose the recipient type as expression and pass the container element in which  the KOSTL managers are stored, in this way you can send based on the item cost center to its respective manager.
    Regards
    Pavan

  • Re-starting Item Level Shopping Cart Approval Workflow

    Hi All -
    We are implementing WS 14500015 - the Item-based n-level approval workflow for shopping carts - for certain scenarios.  In other scenarios we are using the overall approval workflow.
    I need to re-start the item-level approval workflow for certain scenarios (change in price, change in quantity, etc) - not when any and all changes are made to a line item.
    I was hoping to use the badi BBP_WFL_SECUR_BADI - which works great for the overall n-level shopping cart approval workflow.  However, I can't seem to hit it appropriately for the item level approval workflow!
    Does anyone know if this BADI or any other can be utilized for determining when to re-start the item-level shopping cart n-level approval workflow?
    Thanks so much!
    Abby

    hi,
    Have you implemented the badi BBP_WFL_SECUR_BADI ? for restarting the workflow?
    Let me know?
    Also it is possible to debug and see why the restart does not happen.
    Also let me know wether the restart happens in other cases?

Maybe you are looking for

  • Authorization Object for Clear G/L account (trx F-03)

    Hi, my client wants need to restrict some G/L accounts for certain company codes when clearing G/L accounts. In other words, I need to check that some users are cannot clear (trx F-03) some G/L accounts for some company codes. I have reviewed the aut

  • Table 2 Cel A1 Referencing Table 1 Cel A1

    Hi, I must be missing something... I have 2 tables set up on the same sheet in Numbers 09. I set A1 in Table 2 to equal A1 in Table 1. Now if I add a row above Row A in Table 1, my A1 in Table 2 = Table 1 A2. I've tried playing with the Relative and

  • Flash Builder 4.0 Standalone VS Plugin for Flex and Java Development

    Hello, I have recently installed Flash Builder 4.0 for a personal project. The server side of the project was going to be developed in ASP.NET but at the last minute I decided to change it to Java. However now I am wondering if it would be better to

  • Paypal button appears lower down in Firefox

    Hello, I've just discovered this on one of my pages. Only seems to be happening in Firefox. http://www.ideasintime.co.uk/ovalcolourstest2.html The colour option paypal drop down is appearing off the bottom of the black box. If you view it in other br

  • 3.0.1 problems

    This is a bit confusing. bought an iPhone recently, and was prompted to download the newest update for firmware, after doing so, i got a picture telling me to connect to itunes, i looked it up on the apple support pages, and have tried EVERYTHING app