cancel
Showing results for 
Search instead for 
Did you mean: 

days between tow dates in layout

Former Member
0 Kudos

hi,

I have two date characteristics in a lead column ( date from and date to), I have a key figure ( KF1) that needs be a formula ( date to - date from ) in order to obtain the days between them.

This formula is a visualbasic code with sapafterdataput macro.

When I put the data in the dates format dd/mm/yyyy, with this format my formula ( date to - date from ) works fine. But when I save the field changes and it is not recognized like date and my formula fault showing #VALUE.

I need some solution, with fox formula I don't found how can I obtain days between two dates.

I would appreciate your help.

regards,

victoria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you create a FOX Formula wherein you create a local variable of type integer and assign the value to the variable by directly subtracting the two dates, wont you have what you want?

Example:

Function Type Formula;

Characteristics to be changed : Dateto, Datefrom.

DATA ZDAYS TYPE I.

DATA ZDT TYPE DATETO.

DATA ZDF TYPE DATEFROM.

ZDT = OBJV().

ZDF = OBJV().

ZDAYS = ZDT-ZDF.

{KF,ZDT,ZDF} = ZDAYS.

Regards

Sriram

Former Member
0 Kudos

Thank,

I thought with a FM there is a solution too. DAYS_BETWEEN_TWO_DATES adapted.

Regards

Victoria

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In the Query definition, choose the Row - Budget Item. In the properties, go to Tab - Extended. Here, under Filter Selection for Query execution, select "Values in Master Data Table". Save. Now you should be able to get all materials during the drop-down!

Regards

Sriram

Former Member
0 Kudos

oops - sorry - I posted the reply in the wrong thread! please ignore this message here!

Regards

Sriram