Work item text variable evaluation is character-like?

Kjetil Kilhavn kjetil.kilhavn at bluec.no
Wed Jul 11 09:17:27 EDT 2012


Thank you for your input, Mike and Florin.

I went the easy route and created another attribute, which simply holds one of 
three characters (+, -, or space) to indicate the direction of the amount 
change. But at least now I (and everyone here) knows that size comparison of 
values in task descriptions is not entirely safe.

I am using currency fields, so the problem with two decimals for all currencies 
will be relevant (for the display). At the moment it is not a problem though, 
and I am not sure if I will bother creating additional fields for the (three) 
amounts for that purpose at the moment unless the testers find an error. I 
could of course hint at the testers to test such a currency...

Got to have some work in reserver for the future as well ;-)


Onsdag 11. juli 2012 11.22.06 skrev Florin Wach:
> Hi Kjetil,
> 
> yes, I've made the experience that it's all pure character based, without
> output conversion, just a few default conversions for currency.
> 
> When using currencies, I suggest to have a separate attribute
> (character-based) that uses WRITE..TO...CURRENCY <currency_key>, as some
> currencies have different usage of the 2 pending digits. The workflow
> runtime will recognize a currency field, but will always use the default 2
> digits (so it will not work with INR and JPY).
> 
> If you need to compare, you should use a NUMC field, that uses leading
> zeroes, so that the string comparison works.
> 
> Please let us know, it that was helpful.
> 
> Kind regards,
>    Florin
> 
> -------- Original-Nachricht --------
> 
> > Datum: Wed, 11 Jul 2012 09:44:48 +0100 (BST)
> > Von: "Mike Pokraka" <wug at workflowconnections.com>
> > An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> > Betreff: Re: Work item text variable evaluation is character-like?
> > 
> > Hi Kjetil,
> > 
> > Interesting. I dont' have the time to test this myself, but it may be
> > relevant that the WI text generation and code execution is all in the
> > SapScript engine which has zip to do with workflow and is considerably
> > more ancient.
> > 
> > Have you tried playing around with different data types? Maybe an
> > intermediate 'local' container element of a similarly ancient data type
> > such as P might work? Or just the fact of placing an intermediate element
> > there will do the trick.
> > 
> > Cheers,
> > Mike
> > 
> > On Fri, July 6, 2012 3:53 pm, Kjetil Kilhavn wrote:
> > > I've encountered a problem for which the only explanation I can come up
> > > with
> > > is that all variables evaluated in work item texts are evaluated as
> > > character-
> > > like data.
> > > 
> > > The specific problem is that of telling the user (nicely) what the
> > 
> > change
> > 
> > > in
> > > purchase order value is since the previous release.
> > > 
> > > I've identified correctly the previously released value. It is 8 000
> > 
> > NOK.
> > 
> > > I've identified correctly the current net order value. It is 64 250 NOK.
> > > I've identified correctly the absolute amount change: 56 250 NOK.
> > > 
> > > In the work item description I use the following section of code to
> > > display in
> > > a nice way how the net order value has changed:
> > > IF &_WI_OBJECT_ID.ZLASTRELEASEAMOUNT& <> &_WI_OBJECT_ID.TOTALORDERVALUE&
> > > The value has
> > > IF &_WI_OBJECT_ID.ZLASTRELEASEAMOUNT& < &_WI_OBJECT_ID.TOTALORDERVALUE&
> > > increased by
> > > ELSE
> > > been reduced by
> > > ENDIF
> > > &_WI_OBJECT_ID.ZRELEASEAMOUNTDIFF& &_WI_OBJECT_ID.CURRENCY& since the
> > > previous release, and there can be other significant changes as well.
> > > ELSE
> > > The net order value has not changed since the previous release, but
> > > there can be other significant changes.
> > > ENDIF
> > > 
> > > This comes out as:
> > > - - - Start of work item description - - -
> > > Purchase order <PO NUMBER> with order value 64.250,00 NOK will be
> > 
> > ordered
> > 
> > > from
> > > <VENDOR> if it is released.
> > > 
> > > The purchase order has previously been released with order value
> > 
> > 8.000,00
> > 
> > > NOK
> > > by <ACTUAL RELEASE AGENT> on 07.10.2011.
> > > 
> > > The value has been reduced by 56.250,00 NOK since the previous release,
> > > and
> > > there can be other significant changes as well.
> > > 
> > > […]
> > > - - - End of work item description - - -
> > > 
> > > The only way this can make sense to me is if the comparison is evaluated
> > > as
> > > IF '800000' < '6425000'.
> > > Evaluating the above character-like (8 > 6) would lead to the observed
> > > result.
> > > Can anyone confirm or deny than my assumption is correct?
> > > --
> > > Kjetil Kilhavn (+47 40220607) - Blue Consulting AS (http://www.bluec.no)
> > > 
> > > _______________________________________________
> > > SAP-WUG mailing list
> > > SAP-WUG at mit.edu
> > > http://mailman.mit.edu/mailman/listinfo/sap-wug
> > 
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
-- 
Kjetil Kilhavn (+47 40220607) - Blue Consulting AS (http://www.bluec.no)



More information about the SAP-WUG mailing list