Skip to Content
0

FX Trans usign XDIM_FILTER

Apr 10, 2017 at 02:31 PM

106

avatar image

Hi BPC Friend

I would need to write a script that according a property of dimension entity the currency conversion program convert only in GBP so I thought to use the function

*XDIM_FILTER as shown below but it doesn't work

thanks

Michele

*XDIM_FILTER ENTITY= [ENTITY].PROPERTIES("CONVERT_USD")="N"

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATEGORY_SET%
CURRENCY = GBP
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%ENTITY_SET%]
*ENDRUN_PROGRAM

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Vadim Kalinin Apr 10, 2017 at 02:50 PM
0

*XDIM_FILTER ENTITY has no effect on CURR_CONVERSION execution!

Write the following:

*SELECT(%E%,[ID],ENTITY,ID=%ENTITY_SET% AND CONVERT_USD=N)

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATEGORY_SET%
CURRENCY = GBP
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%E%]
*ENDRUN_PROGRAM

But other things are not clear:

Do you want to run conversion in DM package?

What the user will select in the prompt for ENTITY?

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

PERFECT, IT WORKS!!

For example the user select the entity 2300, 2400,2500

I want for the entity 2300 only GBP, for the entity 2400 GBP & USD and for the entity 2500 nothing

Using the following script

*SELECT(%CURRENCYVARIANT%,"ID","RPTCURRENCY","[REPORTING]='Y'")

*SELECT(%CONVERTGBPUSD%,[ID],ENTITY,ID=%ENTITY_SET% AND CONVERT_USD=Y)

*FOR %CATS%=%CATEGORY_SET%

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATS%
//CATEGORY = ACTUAL
//CURRENCY = %RPTCURRENCY_SET%
CURRENCY = %CURRENCYVARIANT%
//GROUP = %GROUPS_SET%
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%CONVERTGBPUSD%]
*ENDRUN_PROGRAM

*NEXT

*SELECT(%ONLYGBP%,[ID],ENTITY,ID=%ENTITY_SET% AND CONVERT_USD=N)

*FOR %CATS%=%CATEGORY_SET%

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATS%
//CATEGORY = ACTUAL
//CURRENCY = %RPTCURRENCY_SET%
CURRENCY = GBP
//GROUP = %GROUPS_SET%
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%ONLYGBP%]
*ENDRUN_PROGRAM

*NEXT

I got the following

what do you think?

thanks

Michele

wfnk9.png (15.5 kB)
69ryi.png (8.6 kB)
7pg93.png (9.3 kB)
0

Yes, my script is exactly for this case!

0

thanks

I don't know why it doesn't work anymore

I run the package for entity 2600 and I got the following

nfplp.png (11.3 kB)
0

And 2600 is not N?

0

it was blank

now I have type in Y

I will let you know, thanks for now

0

Doesn't matter blank or Y

The code have to skip CURRENCY conversion if %E% is empty.

To implement it you have to write:

*XDIM_SKIPNULLCHECK CURRENT

with corresponding XDIM_MEMBERSET ENTITY=...

0

Something like:

*SELECT(%CURRENCYVARIANT%,"ID","RPTCURRENCY","[REPORTING]='Y'")
*SELECT(%CONVERTGBPUSD%,[ID],ENTITY,ID=%ENTITY_SET% AND CONVERT_USD=Y)

*XDIM_SKIPNULLCHECK CURRENT
*XDIM_MEMBERSET ENTITY=%CONVERTGBPUSD%

*FOR %CATS%=%CATEGORY_SET%

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATS%
//CATEGORY = ACTUAL
//CURRENCY = %RPTCURRENCY_SET%
CURRENCY = %CURRENCYVARIANT%
//GROUP = %GROUPS_SET%
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%CONVERTGBPUSD%]
*ENDRUN_PROGRAM

*NEXT
*COMMIT

*SELECT(%ONLYGBP%,[ID],ENTITY,ID=%ENTITY_SET% AND CONVERT_USD=N)

*XDIM_SKIPNULLCHECK CURRENT
*XDIM_MEMBERSET ENTITY=%ONLYGBP%

*FOR %CATS%=%CATEGORY_SET%

*RUN_PROGRAM CURR_CONVERSION
CATEGORY = %CATS%
//CATEGORY = ACTUAL
//CURRENCY = %RPTCURRENCY_SET%
CURRENCY = GBP
//GROUP = %GROUPS_SET%
TID_RA = %TIME_SET%
RATEENTITY = GLOBAL
OTHER = [ENTITY=%ONLYGBP%]
*ENDRUN_PROGRAM

*NEXT
*COMMIT

Please read note:

https://launchpad.support.sap.com/#/notes/2146749/E

0

perfect, it works

thanks a lot

0