Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Logic script: reading value when empty or 0

Hi,

-we are on CPMBPC release: 810 SP-level: 0004

The requirement is to read data from 'January to November' depending on where value is and write on 'December'.

So, script reads data in JAN and if there is value then writes on DEC but if value=0 or empty then move to FEB and so on..........until it finds value.

How is it possible to read when value is empty or 0?

thanks

Ahmad

replied

If Current year, then:

In the advanced DM script add the following (add as many years as you want):

PROMPT(COMBOBOX,%Y%,"Select BU to run earning calculations",0,,{2014,2015,2016,2017,2018})

INFO(%EQU%,=)

INFO(%TAB%,;)

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

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

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

...

As a result, the variable $Y$ will be passed to the script logic containing user selected year.

Then in the script logic:

*SELECT(%Y2014%,[ID],TIME,"[ID]=2012.01,2013.01,2014.01")

*SELECT(%Y2015%,[ID],TIME,"[ID]=2013.01,2014.01,2015.01")

*SELECT(%Y2016%,[ID],TIME,"[ID]=2014.01,2015.01,2016.01")

*SELECT(%Y2017%,[ID],TIME,"[ID]=2015.01,2016.01,2017.01")

*SELECT(%Y2018%,[ID],TIME,"[ID]=2016.01,2017.01,2018.01")

//add more as required

*SELECT(%YY%,[YEAR],TIME,"[ID]=%Y$Y$%")

*FOR %Y%=%YY%

*FOR %M%=%Y%.11,%Y%.10,%Y%.09,%Y%.08,%Y%.07,%Y%.06,%Y%.05,%Y%.04,%Y%.03,%Y%.02,%Y%.01

*XDIM_MEMBERSET TIME=%M%

*WHEN TIME

*IS *

*REC(EXPRESSION= %VALUE%==0 ? [TIME].[%Y%.12] : %VALUE%, TIME=%Y%.12)

*ENDWHEN

*NEXT

*NEXT

Vadim

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question