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

check value in script logic - NW Version 10.1

Former Member
0 Likes
218

Hi Experts

Need your help.

I'm trying to check value using following expression but failed.

I need to check value for one account, and :

- if value is < 0 , store it 's partner's data on INPUT2 member

- if value is >= 0 , just do nothing

my expression :


*SELECT (%ALL_PARTNERS%,"[ID]",PARTNER,"CALC='' AND ENTITY <> '' ")

*XDIM_MEMBERSET ACCOUNT = R6600B

*XDIM_MEMBERSET PARTNER = %ALL_PARTNERS%

*FOR %P% = %ALL_PARTNERS%

     *REC(EXPRESSION=%VALUE%<0) ? AUDITRAIL=INPUT2,PARTNER=%P% : "" )

*NEXT

In what case, do I need to make this steps :

1. Transaction SPRO
2. Goto 'Planning and Consolidation' -> 'Configuration Parameters' -> 'Set Global Parameters'
3. Change the value 'K2_CALC_ENGINE' to 'ABAP'. Create it if does not exist.
If you want to switch engine back to Java Script change the value from 'ABAP' to 'JS'

Tks for your help,

Olivia

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

"do I need to make this steps" - no!

But your code is strange! Why do you need for/next loop?

Where is When/endwhen???

Condition expression is invalid!

The correct script will be like:

*SELECT (%ALL_PARTNERS%,"[ID]",PARTNER,"CALC='' AND ENTITY <> '' ")

*XDIM_MEMBERSET ACCOUNT = R6600B

*XDIM_MEMBERSET PARTNER = %ALL_PARTNERS%

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION=(%VALUE%<0) ? %VALUE% : [AUDITRAIL].[INPUT2],AUDITRAIL=INPUT2)

*ENDWHEN

If %VALUE%<0 then write %VALUE% to AUDITRAIL=INPUT2

Else write [AUDITRAIL].[INPUT2] to AUDITRAIL=INPUT2 - do nothing!

Vadim

former_member186338
Active Contributor
0 Likes

Also this line is strange:

*SELECT (%ALL_PARTNERS%,"[ID]",PARTNER,"CALC='' AND ENTITY <> '' "

CALC=N or CALC=Y but not empty!

P.S. May be:

*SELECT (%ALL_PARTNERS%,"[ID]",PARTNER,"CALC=N AND ENTITY<>''")

Former Member
0 Likes

yes, i ve seen it

Tks a lot,

former_member186338
Active Contributor
0 Likes

Is it working? Test in UJKT!

Answers (0)