cancel
Showing results for 
Search instead for 
Did you mean: 

Formula for looping over zero value

Former Member
0 Kudos

Hello,

In BPS, I have a layout with 7 key figures in the lead columns, and the 12 posting periods across the data columns. If I have a numeric value variable entered in the web page, I want to place that value in 1 of the key figure for all 12 periods. But since the whole table contains zeros it doesn't work. It will only work for a column where there is a non zero value in 1 of the key figures. Any assistance?

Thanks,

Linda

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Instead of using a For loop, you need to specify a DO loop with a starting value and number of periods and use TMVL function to move the fiscal period variable value along...

Hope this helps,

Mary

Former Member
0 Kudos

Hello,

here the code for you, I have created a special key figure "WGP_TEMP" to add the value "1" into this keyfigure because you can not save keyfigures with value 0.

DATA YEARPERIOD TYPE 0FISCPER.

DATA PERIOD TYPE I.

YEARPERIOD = VARV(UDYP1).

PERIOD = 1.

DO.

{WGP_TEMP, YEARPERIOD} = 1.

PERIOD = PERIOD + 1.

YEARPERIOD = TMVL(YEARPERIOD, 1).

IF PERIOD > 12.

EXIT.

ENDIF.

ENDDO.

Answers (0)