WF deadline - last end issue

Iu2019m having a trouble with a deadline work item.
Customer requisition:
If the approver reserves the work item for 7 days without execute it, it will have to go back to every original approvers.
I have implemented this logic in that way:
Work itemu2019s latest end: &_WORKITEM.ACTUALSTARTDATE& + 7 days.
In the deadline outcome there is a condition to continue with the loop and go back to the work item.
There we have 2 different problems:
1)  When the work item is created, the expression &_WORKITEM.ACTUALSTARTDATE& is empty, so the system defines the latest end as: creation date + 7 days, which is not correct. The correct latest end will be: reservation date + 7 days.
2)  When the work item reach the latest end and it is recreated, the new work item's latest end is identically to the first work item latest end: first work itemu2019s creation date + 7 days.. for this reason, the new  work items are always missed the deadline and the workflow is stack into a loop :S The second work item will have to update the latest end date.
Please, somebody know why these 2 problems are happening and how can I fix them? Maybe somebody know any other way to implement customeru2019s requirement.
Iu2019ll really appreciate any help on this issue.
Thank you very much!

Try this:
METHOD if_swf_ifs_workitem_exit~event_raised.
  TYPE-POOLS: swlc.
  CONSTANTS: c_selected TYPE sww_wistat VALUE 'SELECTED',
             c_wdreserveddate TYPE swc_elem VALUE 'WDReservedDate',
             c_wdreservedtime TYPE swc_elem VALUE 'WDReservedTime'.
*Get context of work item.
  DATA: wa_header      TYPE swr_wihdr,
        wi_container   TYPE  REF TO      if_swf_ifs_parameter_container,
        wa_wi_return   TYPE swwwiret,
        v_date         TYPE swwwiret-wi_asd,
        v_time         TYPE swwwiret-wi_ast,
        v_wf_id        TYPE sww_wiid,
        wa_wf_container TYPE swr_cont,
        i_wf_container TYPE STANDARD TABLE OF swr_cont,
        v_sy_subrc TYPE sy-subrc,
        v_workitem  TYPE swlc_workitem.
  me->wi_context = im_workitem_context.
  IF im_event_name EQ swrco_event_state_changed.  "when the wi status change.
    CALL METHOD wi_context->get_header
      RECEIVING
        re_workitem_header = wa_header.
    IF wa_header-wi_stat EQ c_selected.
     CALL FUNCTION 'SWW_WI_RETURN_READ'
       EXPORTING
         wi_id       = wa_header-wi_id
       IMPORTING
         wi_return   = wa_wi_return
       EXCEPTIONS
         read_failed = 1
         OTHERS      = 2.
     IF sy-subrc EQ 0.
      v_date = sy-datum.
      v_time = sy-uzeit + 3900.
     ENDIF.
*- read workitem
      CALL FUNCTION 'SWL_WI_READ'
        EXPORTING
          wi_id    = wa_header-wi_id
        CHANGING
          workitem = v_workitem.
update it
      v_workitem-deadlines-wi_led = v_date.
      v_workitem-deadlines-wi_let = v_time.
      v_workitem-deadlines-wi_ded = v_date.
      v_workitem-deadlines-wi_det = v_time.
      v_workitem-update_deadlines = 'X'.
      CALL FUNCTION 'SWL_WI_DEADLINES_UPDATE'
        EXPORTING
          wi_id     = wa_header-wi_id
          do_commit = 'X'
        CHANGING
          workitem  = v_workitem
        EXCEPTIONS
          OTHERS    = 1.
      IF sy-subrc EQ 0.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.

Similar Messages

  • Last Goods Issue Date & Last Goods Receipt Date

    Hi ,
    I would like to know in which table (and fields) I can find the "<b>Last Goods Issue Date</b> " & "<b>Last Goods Receipt Date</b>" based on Material Code, Plant and Storage location.I have to prepare a existing stock report for slow moving material.
    Thanks.

    Hi,
       Check table LIKP deliver header and LIPS deliver Item
    Regards,
    Prashant

  • Last goods receipt, last goods issue and last purchase order

    Hi Experts!!
    is there any table/info structure where I have the last goods receipt material document number, last goods issue material document number and last purchase order number? I want to extract this information to Business Warehouse.
    Best regards

    Are you looking for a report similar to MB51?
    If you put little more detail, i might be able to help. I don't know much about info structures but i can tell you the SAP tables.
    All Movement Details are in the below tables.
    MKPF- Material Document Header,
    MSEG - Material Document Detail -( you can put your material, plant for selection)
    Last PO  - you can get it from Info-record (EINE- EBELN, EINE-EBELP).
    Thanks,
    Shekhar Ramineni

  • Report of last goods issue & consumption

    Hi Experts,
    I need to prepare a report which lists the material, with the information of last Goods Issue, Consumption & Goods Movement.
    Please suggest some report other than MCBE..

    Hi
    MCBV or MC.5 can be used.
    Reward points if u r satisfied.
    Best Regards

  • Change the Deadline -latest end from step before or other WF

    Hi,
    I have the following situation.
    We create a wait event step with a lasted end calculated previously.
    The problem is that the values for calculate changes after the wait step is created, so we need to change the lasted end too.
    How this lastest end be modified from other step or Workflow?
    Thanks in advance.

    Hi Francisco,
    What is the exact problem
    You have a Wait step with the Latest end - set with reference to the "Work Item" and the Time set as "x" hours or days.
    Now when the workflow reaches the Wait step, u want to change the "x" hours into "y" hours .
    Is this requirement.?
    May b u can try the following
    U can calculate the Latest Time for the Wait step , in a background activity , before the Wait step and then use the calculated value as "Expression" (i.e. calculate "x" from the expression) for Time in Latest end.
    Hope this helps.
    Raj

  • How to Identify Last  Command Issued by user??

    Hi Everybody,
    I need to create a form in which the current state of the form depends upon the last command issued by the user.
    Suppose if user clicks 'delete record' or 'insert record' or 'enter-query' or something else.
    So, how to identify the last event executed by the user.
    Any suggestions...
    Thx in advance,
    Raj

    You can write something into a Form parameter in the POST-INSERT/UPDATE/Query triggers.
    Then you can check the value of this parameter when needed.

  • What is the table name for getting Last Receipt  & issue date of material?

    Hi Friends,
    What is the table name for getting Last Receipt  & issue date of material?
    *Case 1:*
    Here, I am running report in May 2008. But, if there is no goods receipt for the respective material since last 13th March 2007.
    Then in this case Last goods receipt date should be 13th March 2007.
    Please guide me.
    Regards
    Siva

    I checked MSEG table. But, I didn't find any field for date.
    Can you tell me field name.
    Regards
    Siva

  • Funds Management Year-end Issue

    For Funds Management Module year end activity, it mainly involves commitment and budget carry forward.
    For a particular Fund / Fund Centre, we transferred the commitment and the budget from 2011 to 2012. However it was not distributed accordingly in 2012. From the screenshot below, you can see that the budget (Sender) had multiple levels (Fund Centres).
    1.MIMOS
      2.1000
        3.MM05
          4.MM0501
            5.MM050107
    However, the receiver was only at the highest level which is MIMOS. Now under the budget reports, it is showing insufficient funds @ the Fund Centre level.
    Please guide me on how do I redistribute Funds to the lower levels Fund Centres.
    Please refer to the screenshot at: http://nazrinrizal.blogspot.com/2012/01/funds-management-fm-year-end-issue.html
    Help would be very much appreciated. Thanks!

    You could try out transaction FM9P for year 2012 in your test system to reconstruct the distributed values.
    To me it seems that the actual budget for 2011 has only been entered for the top-level MIMOS and distributed from there (I assume you are using Former Budgeting), and thus the carryforward only considers the "actual" fund center + fund combination for which the budget was entered.
    If budget would have been entered to the lowest-level fund center, you would have to run FM9Q to sum it up for the above fund center hierarchy levels.

  • Error in Dynamic deadline Latest end

    Hi Experts,
                      I am facing an issue while usind latest end deadline. I have to set deadlines based on manager level, I used the Leatest End deadline with expression. In a background methood I am calculating the date and time based on manager level. and passing this date and time to workflow. In the next step I am using these date and times in the latestend expression.
    Here I am getting an error " Error in determining the deadline." in GET_TIMESTAMP_VIA_EXPRESSION.
    I am using the reference fields are begda and sy-uzeit.
    Please suggest me how to overcome this issue.
    Regards.
    Ranganadh.

    Hi Pavan,
                  Thank you for the reply. I have changed the reference parameters as u suggested. but still  I am getting the same error.
    below I am giveng you the errors that displayed in workflow log. Please checkit out and let me know where I am going wrong.
    In the step history of the workflow log:
    Executed on                                                                                Error Message
    Result Processing                                                                              No Errors
    Result Processing                                                                              Error during result processing of workitem 404671
    Process_Node                                                                                Error when processing node ''0000000013"
      Create                                                                                Error when creating a component of type 'Step'
        Create_WIM_handle                                                                      Error when creating a workitem
          Create_Via_WFM                                                                        Deadline determination failed
             get_timestamp_via_expression                                               Date LE is nota valid (Plausibility check not found)
    In the method I have written the code like this
    If HR_LEVEL = 1.
       act_date = sy-datum + 30.
       act_time = '240000'.
    endif.
    swc_set_element container 'ACT_DATE' act_date.
    swc_set_element contaienr 'ACT_TIME' act_time.
    act_date and act_time are of date and time type references. and passing these values to WF.
    and in the leatest end I am using these variables.
    Please suggest me.
    Regards.
    Ranganadh.

  • WF Deadline Latest End Change

    Hi Experts,
    We have WF with multiple approval and then at the end again it will go to Initiator where we have deadline (LATESTEND).
    By mistake I gave Refer.date/time as Workflow creation (but it should be Work Item creation).
    Is there any way I can change this to Work item creation for the wf  which are already initiated ?
    More than 20 WF started and multiple user approved.so don’t want to restart the WF ‘s again
    Thanks,
    KP

    Hi
    Basic Question : What actually happens when the Latest End reaches for the last step (for the WI With Initiator).
    I am sure it is not going to nuke the workflow initiator.....
    For 20 odd workflows, I do not see a requirement to develop something and make it go till production.
    Best is to take out the names of the Initiators and let them know in advance to ignore the escalations for the related documents (if your setup allows you inform the users).
    Yeah, mistake has been made..... and is corrected too for new instances.......
    But if you cannot reach out to them, best is what Rick suggested to create a custom prog to run every 3 minutes, pickup work items created in the past three minutes for that particular task (TSxxxxxxxx) from SWWIHEAD and then change their deadlines...you can even automate the changing of deadline from the same program using FM SWW_WI_DEADLINES_CHANGE (could not locate any with SAP_WAPI*).
    Regards,
    Modak

  • Report Builder - Last page issue and Report Footer issue

    I am using ColdFusion 9 Report Builder, am new to this product and encountering 2 issues.
    Issue 1 - I have a field that I would like to print on the last page of my report.  How can I determine the last page?  I initially tried using a calculated field set to the 'highest' calc.Page_Number.  Then I could compare the current page to the last page in the 'Print When' property.  But calc.Page_Number can not be used in a definition of a calculated field.
    Issue 2 - Depending on the amount of report detail, sometimes my report footer prints alone, without a page header and page footer.  The report includes this page in the total number of pages.  For example, if it is a 2 page report, the page header on page 1 will display Page 1 of 2.  Then the only data on Page 2 is the Report Footer.  No page header or page footer prints. 
    Any assistance on these issues would be most appreciated.  To date, using the Report Builder has not been easy.

    To issue 1: The report contains a report band called report footer. thsi is always at the last page. The report footer band initially is collapsed, so you have to expand it by dragging the last band divider.
    To issue 2: I guess this is a page break calculating error when detail data reaches really near the page footer area.
    Try some experiments with different setting of the following properties/issues:
    - in elements, e.g. calculating fields in the bands between report detail and page footer: In Properties / Print Control / Printing Options: Activate the option "Remove line when blank". This will remove the whole report band area if this field is blank. May save some empty space.
    - try to remove unused empty space between detail rows.
    - try to resize and reposition all detail fields so that they snap to the grid.
    Best regards

  • BEX Front end issues in sap netweaver 2004s

    We have problems with accessing SAP NETWEAVER 2004S BEX tools(BI7.0).
    We have the following softwares installed:
    SAP_BW SAP NETWEAVER BI7.0 SP 10(SAPKW70010)
    SAPGUI6.40 PATCH LEVEL 22
    Microsoft office 2003
    .NET version 1.1
    Microsoft VJ# 1.1 Distributable package
    We are having the following issues in each components:
    1.BEX ANALYZER:Unable to open the reports.Getting the error message that
    "Critical error occured.Program needs to be closed.Refer the trace file"
    2.Report Designer:component Bex Report Designer avilable verion 59, Version 132 required.Before you can continue you have to run the front-end setup"
    3.BEX WAD:Unable to save any web templates.Getting the following error message.
    "E002 Error While Executing Service RSWAD_WEBPUB_CALL_SERVICE:V for object 1()"
    In BI front end check tool for PC not showing any red files.But it showing Blue color for some of the microsoft dll's.
    Please help us with your inputs..
    thanks in advance
    Soujanya

    Hi Soujanya,
    This is known issue in BEx tools in this latest release.
    We got the same problem and still facing.
    We are using BEx 3.5X to access all reports.
    Install BEx 3.5 too. Then you get two sub menus to access BEX tools.
    Make sure that you open reports in 3.5 BEx Analyser.
    I think all reports, which you tried to open in BEx(BI 7.0) are corrupted. try to copy to your datatargets/install (if they are BI Content Reports).
    Good Luck,
    Anand.
    Pls give points if this is useful

  • Using Thunderbird/Firefox - since last upgrade, issues with HTML emails and opening PDF

    Since last upgrade, it seems that I'm having 2 (maybe 3) problems:
    1)  emails have white/grey horizontal lines in the bottom half of the email's text or graphics
    2)  can't open pdf files - when I could without issue before upgrade
    3)  Adobe Reader - I've downloaded updates, but they won't install.  (says not compatible with my computer, but running Mac OSX 10.6.8  (I even downloaded Opera brower to see if that would work, but there still seem to be Adobe issues)
    Any thoughts?

    mknabster wrote:
    Now i'm thinking it has to be those 10K fonts I put on there into the Font app.
    I think you are correct, that was not a good idea.
    Hopefully they all wound up in Home/Library/Fonts.  You can safely delete everything in there, as OS X does not put anything in that folder.  Fonts part of the OS are
    http://www.prepressure.com/fonts/basics/snow-leopard-fonts/list

  • The purchase could not be completed never ending issue

    Apple needs to do something at a higher level to solve this problem.
    I get the 'purchase could not be completed' error message when attempting to purchase apps on my iPad and my Mac.
    Yes, I have tried logging out and back in, and I have ensured that the Apple ID is the same.
    Apple refers people to Customer Support, but all they manage to do is do an account reset, which lifts the hold for 5-7 days, only to have it show up again.
    FIVE times in four weeks I have had to contact Customer Support.  The last time I called, I was told "there was a hold on your account, the supervisor doesn't know why, but it's lifted now."  Yet again my purchases are blocked.
    Would someone at Apple please pass this issue up to the right people?  There are lots of customers experiencing this issue, and it doesn't seem like Customer Support can offer anything in the way of a permanent fix.

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple. If you want to leave feedback about it to Apple : http://www.apple.com/feedback/itunesapp.html

  • Please add go to "last" / "end" page

    I would be nice to have an option to simply type cmd/ctrl+J and type "end" or "last" and go to the end of the document
    without using mouse.

    For that matter, simply "End" will take you to the last spread.
    Peter's keybinding takes you to the last page.
    Usually the two are close enough that it doesn't matter much, and End is easier to type...

Maybe you are looking for

  • Answer these questions on Basic ABAP?

    hi all,    answer the following, 1)BAPI does not include   a)import   b)user dialogue   c)export   d)exception 2)when will the TOP_OF_PAGE event will be triggered?   a) when report starts   b)when first write statement is executed   c)when TOP_OF_PAG

  • Is there a way of tracing a lost account on Itunes?

    I have had to set up another account on Itunes and cannot find my original purchases or downloads. Is there a way of finding them and adding them to my new account as there were approx 4000 tunes held on the account?

  • Does Motion 5 support the Keylight plug-in by Foundry?

    I'm trying to decide whether to upgrade my old and now unseable copy of AE or just make the jump over to Motion. I need to do some rather reasonably high-end chroma key and like the idea of being able to bring the footage into Motion and doing it the

  • Is this a bug or a typo of XML Parser for PL/SQL or something else?

    Hello, Below is a piece of codes I copied from the sample that comes with the XML parser for PL/SQL. I found that this sample could not be compiled since: 1- the method printElements takes in a parameter 'doc' of type 'xmldom.DOMDocument' 2- then thi

  • Please , open this file for me

    i have been trying to open this file , but vainly , please open it for me , or guide me to a way to do so ? https://drive.google.com/file/d/0By6htDkhXWBiaEllNi1HV21pNFk/view?usp=sharing thanks