cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

default logic when saving vs. as a package

Former Member
0 Likes
254

Hi,

I have a question about the default logic. In my case it includes a bit of code that copies data from one account to another. The source account is a LEQ account, the target account is an AST account.

the script uses this:

*REC(FACTOR=1,ACCTDETAIL=F_CLO_INTCO,ACCOUNT=ACCOUNT.PMATCH_ACCOUNT)

When the default is run automatically after I enter data and save it to the database I get a negative value on my target account. When I then run the default logic as a package, the value becomes a positive value.

Why is that so and how can I change it so I always have the same sign?

Thanks,

Arnold

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

Hi Arnold,

It's a well known issue with INC/LEQ signs logic difference between default.lgf and DM package. Please read:

"SIGN and ACCTYPE in EXPRESSION calculations"

You have to use different scripts!

Vadim

jrg_finster3
Active Participant
0 Likes

Known yes, but still a horrible bug for someone using BPC since 4.0

former_member186338
Active Contributor
0 Likes

I can't imagine what was the idea behind this strange logic. BPC 10 DM package script works absolutely reasonable - without sign changes of SIGNEDDATA values. But default.lgf

former_member186338
Active Contributor
0 Likes

By the way, it's possible to create script with conditional execution of some code blocks. For example in DM package we can set variable using REPLACEPARAM:

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,T%EQU%2010.01)

$T$ will be passed to the script equal to 2010.01

Then the script will be:

//For DM package $T$ has to be assigned some valid TIME member ex.: 2010.01

*SELECT(%DM%,[ID],TIME,[ID]=$T$)

*SELECT(%DL%,[ID],TIME,[ID]=%DM%2010.01)

//For DM package

*FOR %M%=%DM% // Not empty for DM, empty for default.lgf

*WHEN ACCOUNT

*IS PL110

*REC(EXPRESSION=%VALUE%*2,ACCOUNT=PL120)

*ENDWHEN

*NEXT

//For default.lgf

*FOR %N%=%DL% // Not empty for default.lgf, empty for DM

*WHEN ACCOUNT

*IS PL110

*REC(EXPRESSION=%VALUE%*3,ACCOUNT=PL120)

*ENDWHEN

*NEXT

Unfortunately this workaround will not help if default.lgf is called with chains that have the option to run default logic - the variable will not be passed...

Vadim

Answers (0)