Skip to Content
0
Former Member
Sep 29, 2009 at 02:16 PM

Fox formula problem

18 Views

Hi experts,

i'm relatively new to BI Integrated planning and have looked around the forums if i could find anything that helps me out.

So far i did not succeed.

in web application designer we have a dataset which is restricted by a few variables which are on the filter for the aggregation level and for the query.

I am trying to create a function which does the following things

- walk through my dataset and find the max value for a particular characteristic (sequence number).

- adds 1 to the the found max value so far.

- then creates (copies) a new record with only the sequence number different from the existing records.

In the characteristics to be changed i only used the sequence nummber characteristic (ZCSTSQNR in the code below).

i tried a lot of things but it doesn't work so far.

My first problem is how to walk through the dataset

i tried FOREACH but the values ii get are not the ones i have in my dataset.

Can anybody explain this?

Can it be caused by binding variables or so?

Also my copy statement isn't working properly.

It seems to work. AT least the message statement shows me the values i expect but i don't get any new records.

Underneath the code i made so far:

DATA PKP TYPE 0COSTCENTER.

DATA PKS TYPE 0COSTELMNT.

DATA RESULT TYPE ZCSTSQNR.

DATA ORIG TYPE ZCSTSQNR.

DATA TELLER TYPE ZCSTSQNR.

DATA KEYFIGURE TYPE KEYFIGURE_NAME.

DATA AMNT TYPE F.

*trying to walk the dataset

FOREACH ORIG.

PKP = OBJV( ).

PKS = OBJV( ).

MESSAGE I000(RSPLS) WITH PKP 'PKS: ' PKS ORIG.

IF ORIG > TELLER.

TELLER = ORIG.

ENDIF.

ENDFOR.

*show what is found so far

MESSAGE I000(RSPLS) WITH ORIG.

RESULT = TELLER.

CALL FUNCTION ZPLF_GEN_SEQ_NBR

CHANGING E_NBR = RESULT.

MESSAGE I000(RSPLS) WITH 'ML' RESULT.

  • Copy actions

FOREACH KEYFIGURE.

{ KEYFIGURE, RESULT } = 0.

AMNT = { KEYFIGURE, RESULT }.

MESSAGE I000(RSPLS) WITH KEYFIGURE RESULT AMNT.

ENDFOR.

Marco