cancel
Showing results for 
Search instead for 
Did you mean: 

Foreach

Former Member
0 Kudos

Hello Friends,

Must fox always use looping ?

I mean, can fox coding be just {KF,A} = {KF,B} without any looping ?

What is the difference between this statement and

Foreach A.

{KF,A} = {KF,B}.

Endfor.

Please advise.

thanks in advance!

Pointez

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

FOREACH can only be done for characteristics which are marked 'to be changed'. In case you want to execute the FOX for all value of a characteristic, but not change it, you would not mark it 'to be changed' and the function will work on all values present for that characteristic.

Former Member
0 Kudos

Hi Mayank,

Do you mean that in the above example :

FPER=Fiscal Period.

FOREACH FPER.

(FPER,VerA,Amount)=(FPER,VerB,Amount)*1.2.

ENDFOR.

the chanracterisitc VERSION is checked in as To be changed?

Rgds

Syam

Former Member
0 Kudos

yes without that you cannot do a Foreach loop on it.

Former Member
0 Kudos

Hi Pointez,

FOREACH is not essential but depends on your requirement. If you need to repeat the same action for multiple value of characteristic(s) then you can use FOREACH loop.

For exmaple: -

FPER=Fiscal Period.

FOREACH FPER.

(FPER,VerA,Amount)=(FPER,VerB,Amount)*1.2.

ENDOFR.

In this case the data from one version will get copied over to another version and this will be done for all the fiscal periods as per the planning package.

Hope it clarifies.

Cheers