cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation routine

waqar_ahmed
Contributor
0 Kudos

Hi Experts,

I am adding days in date in transformation routine, its showing invalid output in some cases. Code is like

ZDate = ZDate + ZDays

If date is like 17-09-2013 and if I add 10 days the result is 27-09-2013 but if I add 180 days to it than it shows invalid date output. Any date where year is changing it gives an invalid output.

any thoughts?

regards.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ray,

I think your code needs to be adjusted so that if the case is like 180 days the Zdate calculation should go beyond the current year.

Definition of Zdata might need to be checked in code.

Br,

Arpit

anshu_lilhori
Active Contributor
0 Kudos

Hi,

I got the function moduel for your requirement

DATE_CREATE

DATUM_EIN--Pass your date field in this parameter

ANZAHL_KALTAGE--pass your days in this parameter.

DATUM_AUS--Will give you the date after adding the days.

This also considers the leap year and all.

Hope this helps.

Regards,

AL

former_member182470
Active Contributor
0 Kudos

HI,

If you add 180 days to 17-09-2013 then technically it becomes 197-09-2013, which is definitely invalid format.

I feel your code has to be modified in such a way the date jumps to the 180th date of next year from 17-09-2013. So you have to take care of Calday and calyear and Dec/Jan logic.

Please take an ABAPer help.

Regards,

Suman

anshu_lilhori
Active Contributor
0 Kudos

Hi,

How you have defined zdate..

Define it as of type 0calday so that it automatically does all the conversions.

Data:Zdate type /BI0/OICALDAY.

Give a try and also share the code with us.

Regards,

AL