on 2010 Jul 15 1:54 AM
Guys,
I am trying to fix a FOX code. Below is the issue -
There are 2 key figures - YearToDate(YTD) and LifeToDate(LTD).
The formula is
{Current FISCYRPRD, LTD} = {Last FISCYRPRD of Previous Year , LTD} + {Current FISCYRPRD, YTD}
- The Fiscal Year / Period is open and this function has to run for all the Fiscal Year / Period.
________________________________________________________
ISSUE:-
EXPECTED -
FISCYRPRD / YTD / LTD
2009012 / 100 / 100
2010001 / 0 / 100
2010002 / 10 / 110
ACTUAL OUTPUT -
FISCYRPRD / YTD / LTD
2009012 / 100 / 100
2010001 / 0 / 0
2010002 / 10 / 110
________________________________________________________
The code is simple -
FOREACH FISCYRPRD.
{Current FISCYRPRD, LTD} = {Last FISCYRPRD of Previous Year , LTD} + {Current FISCYRPRD, YTD}
ENDFOR.
When there is 0 for YTD the value does not get posted for LTD. This is because of the FOREACH loop. But I cannot force a condition in a DO loop because this function is to run for all FISCYRPRD.
Any help in this would be highly appreciated!
Thanks!
Hi,
How you are populating last fiscal year period of previous year,Is it hard code in parameters .Code you are using may not be reading a block of last year values...If you can share sample code we may be able to help.
As at times foreach also looks for fiscal year along with period for complete loop over.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a ABAP code that derives the previous year FSCYRPRD
FOREACH FISCYRPRD.
ABAP code calculating "Last FISCYRPRD of Previous Year " from FISCYRPRD.
{Current FISCYRPRD, LTD} = {Last FISCYRPRD of Previous Year , LTD} + {Current FISCYRPRD, YTD}
ENDFOR.
This is the algorithm of the total FOX code, there is no other derivation. And this has to run for all periods (open). There is no Year in the Package. I cannot change the way Planning Package is derived because there are atleast 20 functions running on this live system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When there is 0 for YTD the value does not get posted for LTD. This is because of the FOREACH loop. But I cannot force a condition in a DO loop because this function is to run for all FISCYRPRD.
As Indu said, the error may be because the way you are reading last fiscal Year period value; It mayn't be because of 0 value of YTD..
If you want to perform a Do loop , you can do that.
Create a variable on fiscal year period and use tmvl function to get max loop values.
then you can use your do.. enddo loop for looping.
Thanks
Pratyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.