Skip to Content
0

Invalid *SELECT: "Error running default logic () Unknown Dimension Name in Keyword: ___"

Jun 07, 2017 at 06:09 PM

116

avatar image

Hello experts,

This question is related with another one:

Reading signeddata in script logic BPC NW 10.1

That question was solved through ternary operator in *REC, but it appeared a new problem with *SELECT. I detail:

I am working in BPC 10.1 for NW. These are the BPC and BW components:

The K2 calculation engine used is ABAP (i guess because the error says: "Unknown Dimension Name in Keyword: <MEMBER_ACCOUNT>")

My model is called CASHFLOW and has the following dimensions: CATEGORY (C), ACCOUNT (A), ACCR_DATE (T), ENTITY (E), FLOW (S), AUDITTRAIL (D), RPTCURRENCY (R), INTERCO (I) and DUE_DATE (U2).

The account members involved in this process are like these examples:

The purpose of the script is to run as DEFAULT.LGF. The code is in CUENTAS_AST_LEQ script, but this one is included in DEFAULT.LGF by *INCLUDE keyword.

The calculation logic would be: during a transactional data upload from BW (actual data), if a certain AST account has a negative signeddata (credit balance), then save that signeddata in another LEQ account (the same AST account with suffix "P"), removing the original account (AST). Thanks to Vadim Kalinin, I have applied a ternary operator to manage this.

The problem comes up when I try to use *SELECT keyword in order to set dinamically the account members but I cannot get it. I am trying to select the account set with the property CF_COMPRAS. Those accounts have the value "P" in that property (see screenshot above).

This is my actual script:

//*SELECT(%ACC%, ID, ACCOUNT, CF_COMPRAS = P)
*SELECT(%ACC%, "[ID]", ACCOUNT, "[CF_COMPRAS] = 'P'")

*XDIM_MEMBERSET ACCOUNT = %ACC%
*XDIM_MEMBERSET AUDITTRAIL = CF_REAL,CF_CARTERA,CF_PLAN
*XDIM_MEMBERSET FLOW = CF_100
*XDIM_MEMBERSET RPTCURRENCY = LC

*WHEN ACCOUNT
*IS *
*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * -1 : %VALUE% * 0, ACCOUNT = %ACC%P)
*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * 0 : %VALUE% * 1)
*ENDWHEN
*COMMIT

The data sent by user will be something like that (one record example):

ENTITY=6000

ACCR_DATE=2016.12

DUE_DATE=2016.12

CATEGORY= CF_2016.12

AUDITTRAIL=CF_CARTERA

ACCOUNT=55100001

FLOW=CF_100

INTERCO=I_NONE

RPTCURRENCY=LC

SIGNEDDATA= -1000

I can validate the script without problems, but when I send this record (through input schedule to test it), I get the following error:

Any idea?

I would appreciate your help.

Kind regards,

Manu

components.png (48.4 kB)
error.png (12.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Jun 07, 2017 at 06:58 PM
1

Solution:

In CF_COMPRAS property instead of "P" put the required destination account:

For 55230000 fill CF_COMPRAS with 55230000P

etc.

Code:

*SELECT(%ACC%, "[ID]", ACCOUNT, "[CF_COMPRAS]<>''") //not empty CF_COMPRAS property
//Don't use *XDIM_MEMBERSET in default.lgf
*WHEN AUDITTRAIL
*IS CF_REAL,CF_CARTERA,CF_PLAN
*WHEN FLOW
*IS CF_100
*WHEN RPTCURRENCY
*IS LC
*WHEN ACCOUNT
*IS %ACC%
*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * -1 : %VALUE% * 0, ACCOUNT = ACCOUNT.CF_COMPRAS) //get destination account from property!
*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * 0 : %VALUE% * 1)
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN

Please read also: https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/

And don't use useless *COMMIT

Show 6 Share
10 |10000 characters needed characters left characters exceeded

P.S. If this script is "included in DEFAULT.LGF by *INCLUDE keyword" then you have to show full default.lgf script!

First test my code INSTEAD of default.lgf! To avoid issues with incorrect scoping!

0

P.P.S. And the idea of the script is slightly strange for the user - after entering negative value in the cell for account 55230000 and saving this cell will be replaced by zero...

0

Perfect! It works perfectly. Even including another exclusion:

*SELECT(%ACC%, "[ID]", ACCOUNT, "[CF_COMPRAS] <> '' AND [CF_COMPRAS] <> 'Y'")

I am reusing CF_COMPRAS property to differents goals.

What would we do without you, mate? :) Seriously I am so grateful for your help.

Best regards,

Manu

PS: I will take account of that!

PSS: The logic is that accounts without "P" are asset accounts in asset node (hierarchy). These accounts should not have credit balance (-), only debit balance (+), for this reason I "reclassify" to a liability account (with "P") which is in liability node of the hierarchy.

0
Manuel Rodríguez Gallardo

"for this reason I "reclassify" to a liability account"

I am talking about strange effect of reclassification on-the-fly, after user saved data. May be it's better to have some out of hierarchy account for user input like 55230000I and reclassify it to 55230000 or to 55230000P depending on sign without clearing "input" account 55230000I

0

The user really will not enter data by input schedule. This reclassification will ocurr only during transactional data upload from BW infoprovider. I tested the script through input schedule to speed the tests.

Thanks!

0
Manuel Rodríguez Gallardo

OK, clear!

0
Vadim Kalinin Jun 07, 2017 at 06:48 PM
1

I can see a clear error in the script

*SELECT(%ACC%, "[ID]", ACCOUNT, "[CF_COMPRAS] = 'P'")

will result in %ACC%=55230000,55230001,55230002

and the line:

*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * -1 : %VALUE% * 0, ACCOUNT = %ACC%P)

will result in:

*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% * -1 : %VALUE% * 0, ACCOUNT = 55230000,55230001,55230002P)

Absolutely incorrect!

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Oh yes! I started to test with *FOR but the account members selection was hardcoded. Then I used *SELECT and I mixed concepts.

Thank you so much, Vadim.

Manu

0
Manuel Rodríguez Gallardo

Theoretically it's possible to create script with FOR/NEXT but it will be extremely slow... better to use property!

0

Yes, I completely agree!

0