Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ADD_TIME_TO_DATE function does not take into account change of year

Former Member
0 Kudos
3,000

Hi,

I've realised that add_time_to_date doesn't take into account whether we are at the beginning of the year. For example, if I pass the following parameter to the function:

CALL FUNCTION 'ADD_TIME_TO_DATE' "

  EXPORTING

    i_idate = '20130101'

    i_time =                    '-1'

    i_iprkz =                   '2'

  IMPORTING

    o_idate =                   " sy-datum

I get the value 01.00.2013. 

Can anybody help me or give another function which works in this case?

Thanks in advance.

Regards.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
286

Try with FIMA_DATE_CREATE which seems to better manage negative offsets.

Regards,

Raymond

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos
287

Try with FIMA_DATE_CREATE which seems to better manage negative offsets.

Regards,

Raymond

Former Member
0 Kudos
286

hi there is another function module C14B_ADD_TIME try with this u will get...

amy_king
Active Contributor
0 Kudos
286

Hi David,

I'm on NW 702 SP11 and the function works as expected with these inputs so there may be a correction for the behavior in a support pack or OSS note.

Unfortunately, since the function is unreleased SAP is unlikely to provide assistance, but you may be able to find an existing note, for example the following (pretty old) note may be applicable to your system.

Note 132659 - Calculation of shelf life expiration date

Cheers,

Amy