cancel
Showing results for 
Search instead for 
Did you mean: 

Access to time char with TMVL in FOX is not working with offset other than0

Former Member
0 Kudos

Hi,

In the FOX Planning function, TMVL is not working as desired if we give any other offset other than 0.

Could you pls guide.

            • Sample Code *************

DATA PFROM TYPE ZPERSTRT.

DATA PTO TYPE ZPEREND.

PFROM = OBJV().

PTO = OBJV().

MESSAGE I000(ZSEM) WITH 'PFROM1' PFROM.

MESSAGE I000(ZSEM) WITH 'PTO1' PTO.

PTO = TMVL(PFROM, 3).

MESSAGE I000(ZSEM) WITH 'PFROM2' PFROM.

MESSAGE I000(ZSEM) WITH 'PTO2' PTO.

            • Sample Code *************

            • Output *************

S:ZSEM:000 PFROM1 2007001

S:ZSEM:000 PTO1 2007012

Error in function TMVL for value 0000000 and offset 3

S:ZSEM:000 PFROM2 2007001

S:ZSEM:000 PTO2 0000000

            • Output *************

Does Fiscal Year Variant plays any role here. If so how do we control this increment or decrement of the Fiscal Year Period.

Regards,

Durga

Message was edited by:

Durga BW

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What will be the reference for PERSTR and PEREND? I would assume either fiscal year/period or calendar month/year.

The offset should work but one more question before i look at it again.

What will be the value of PTO when the offset is set to 0?

i.e PTO = TMVL(PFROM,0).

Former Member
0 Kudos

Is it just for message purpose?

Also if you want the functon to run for a definite period then tmvl could be used for incrementing or decrementing.

Inorder to do that you would use offset along with TMVL.

If you could explain clearly what you would want to achieve i may have a solution.

Message was edited by:

ragav

Former Member
0 Kudos

Hi,

You can see in the error message that its not the offset which is 0 but the value of PFROM is the problem. How are you having a value of period as 000000 in your data?

Former Member
0 Kudos

Hi,

Mayank- This functionality is from the same post (Difference between periods) which I have raised. As you can see in this post that first I am reading the record contents and storing ZPERSTRT and ZPEREND from the record into the variables PFROM and PTO respectively.

I have just put Messages to see what exactly is getting captured in PFROM and PTO variables. As you can see we got 2007001for PFROM and 2007012 from PTO.

Then I tried to increment period end by putting offset as 3.

PTO = TMVL(PFROM, 3).

But you can see in the Message that after executing this operation we got 2007001for PFROM and 0000000 from PTO. Whereas I am expecting 2007004 for PTO as I have used offset as 3.

Ragav - As discussed above I am trying to increment the PFROM value and assigning it to PTO.

Somehow the increment is not working if I give offset any number other than 0.

Pls guide.

Regards,

Durga

Former Member
0 Kudos

Durga BW,

Is ZPERSTRT and ZPEREND custom Z time objects or is it referencing one of the zero time object such as 0FISCPER? Or are they variables?

I persume you are working with BPS or it is IP?

I have had issues in the past that TMVL does not work on custom time characteristics and only 0 time characteristics. That might be the issue you are encountering too.

Hope this helps,

Mary

Former Member
0 Kudos

Hi,

Ragav - ZPERSTRT and ZPEREND are time characteristics which are refering to Fiscal Year /Period. Also if I put offset as 0 then the value of PFROM is getting copied to PTO. But if I try to use either -ve or +ve offsets then TMVL operation is not carried out properly and it is assigning 0000000 to PTO.

Mary Huang - ZPERSTRT and ZPEREND are z objects created by taking reference as 0FISCPER. So you mean that TMVL will not work for these characteristics. But I have tried with 0FISCPER as well. But it is not working as desired.

Pls guide.

Regards,

Durga

Message was edited by:

Durga BW

Former Member
0 Kudos

Durga,

If ZPERSTRT and ZPEREND reference 0FISCPER, it should be fine for use with TMVL. If you have Z time characteristics defined as NUMC (7) for example, there will be some issues.

I think the FOX is running into issues since they are using 2 different data objects even though both are referencing 0FISCPER.

Takes me too long to log into the system to verify so not sure if this would work but give these a try.

Option A)

DATA PFROM TYPE ZPERSTRT.

DATA PFROMAD3 TYPE ZPEREND.

DATA PTO TYPE ZPEREND.

PFROM = OBJV().

PTO = OBJV().

MESSAGE I000(ZSEM) WITH 'PFROM1' PFROM 'PTO1' PTO.

PFROMAD3 = PFROM.

PFROMAD3 = TMVL(PFROMAD3, 3).

MESSAGE I000(ZSEM) WITH 'PFROM2' PFROM 'PTO2' PTO.

Option B)

DATA PFROM TYPE ZPERSTRT.

DATA PTO TYPE ZPEREND.

FOREACH PFROM.

MESSAGE I000(ZSEM) WITH 'PFROM1' PFROM.

PTO = PFROM.

PTO = TMVL(PTO, 3).

MESSAGE I000(ZSEM) WITH 'PFROM2' PFROM 'PTO' PTO.

ENDFOR.

hope this helps,

Mary

Former Member
0 Kudos

Hi,

Mary - The options which you have given for incrementing the time characteristics is also not working.

I am not able to understand why the basic functionality is not working properly when I give offset anything other than 0.

Or is there any other way that we can increment fiscal year period.

Regards,

Durga

Former Member
0 Kudos

Try option A with

DATA PFROMAD3 TYPE 0FISCPER.

Former Member
0 Kudos

Did you try with declaring as type fiscper? I have used lot of sucj functions in my work but have used with either type fiscper or calmonth.

Except TMVL there is no other way of incrementing or decrementing periods.