Skip to Content
avatar image
Former Member

Deadline getting expired with adding 5+ Hours instead of calculated hours in SAP workflow

Hi,

We are using an expression as Ref.date and time to calculate the latest End and have a problem while calculating latest end date and time.

We compared all the customer settings in both  development and quality system and found everything is fine. Even we checked the WF-BATCH user also but found the same.

Please help me to fix this as this is a very high priority issue to me.

Note: When we executed the function module which is calculating the date and time for the latest end in standalone we are seeing the correct date and time what we are seeing in the development system, but at run time when workflow triggers the method and assign the values to the expressions for the latest end it is throwing some other date and time (difference of exactly 5 hours). Our system time zone is in UTC.

When our code calculates, it produces the right value. But in Quality system in workflow, the resulted value gets added with 5 hours and workitem triggers based on that. But, in Dev system, this 5 hours is not getting added and the workitem triggers at the right time.

Please let me know if anybody are not clear with the issue.

Thanks,

Prabu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 06, 2015 at 11:59 PM

    Hi Prabu, Which function module? END_TIME_DETERMINE?  Any chance there's a dodgy factory calendar gumming up the works? You might need to check the configuration of the factory calendar as well.

    Perhaps 2015 doesn't exist yet in that factory calendar?

    Other than that I'd be hunting for custom modifications that are bypassing the code... some squirly developers idea of how to test deadlines the dodgy way perhaps?

    Just a thought

    Jocelyn

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jocelyn,

      Yes, the same FM..for me the factory calendar works perfectly. The FM returns the right value. I can see the right date and time after my custom code in the workitem. After then, workflow adds that 5 hours with the time. Which happens only in Quality.

      In development system, the same logic works perfectly.

      Do you have any suggestion?.

      Thanks,

      Prabu

  • avatar image
    Former Member
    Jan 07, 2015 at 02:02 AM

    Could it have something to do with time zones? You mentioned the system time zone, but what about the user WF-BATCH (or some other users which might be executing the function when executed in workflow) time zone in the quality system? 

    Could you use some other function or even code it by yourself? (What if you just code some simple hard coded version (without using the function) and test with that? Does it work then? Just trying to narrow down the reason (is the problem in the function or is it something more general in the system).


    Just throwing out some ideas...


    Regards,

    Karri

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 04:01 AM

    If it's a blanket +5 hours it's much more likely to be a modification or override of some kind - +5 hours is way too specific. Anything standard is going to resolve to standard calendar time in UTC as a worst case scenario.

    Are you able to test END_TIME_DETERMINE e.g. through transaction SE37 in Quality? That might work out if the problem is in the code or higher up. If it's happening even in END_TIME_DETERMINE I'd suggest you debug and see if there's a modification enhancement (it might be an implicit one) causing the problem.

    Have you checked the workflow log and container in Quality to see if the +5 hours is happening on the original calculation or being overridden later - e.g. maybe it's getting clobbered by some "test" batch job.

    Checking the default timezone on WF-BATCH is a good idea though... if that's different in Quality than Development that could be a problem. Also check your own user id that you are using for the inbox and to look at the workflow logs... just in case there's a user formatting conversion happening at runtime to convert from system time to that user's timezone.

    And check that the system timezone is the same in both systems.

    All I can think of for now... let us know how you go.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello,

      if I understand correctly, when you run fm END_TIME_DETERMINE from SE37 in your Q system then it calculates the time correctly. But when workflow uses it, it adds 5 hours.

      How are you using END_TIME_DETERMINE in workflow? Is it being called in a method? Could you show the code?

      regards

      Rick Bakker

  • Jan 08, 2015 at 02:06 AM

    Any chance the workflow step that is running END_TIME_DETERMINE is running under a different user to WF-BATCH?

    Add comment
    10|10000 characters needed characters exceeded