cancel
Showing results for 
Search instead for 
Did you mean: 

How to add hours to a date field and a time field to get new date and time?

Former Member
0 Kudos

Hi,

I have five fields in a table, namely:

1. Start Date (Date type)

2. Start Time (Time type)

3. Planned Duration (Number type)

4. End Date (Date type)

5. End Time (Time type)

A user enters values in the "Start Date", "Start Time" and number of hours in the "Planned Duration" fields.

I have to add the number of hours entered in the "Planned Duration" field to the date value in the field "Start Date" to obtain the value for the field "End Date". That is:

Planned Duration + Start Date = End Date

Similary, I have to add the number of hours entered in the "Planned Duration" field to the time value in the field "Start Time" to obtain the value for the field "End Time". That is:

Planned Duration + Start Time = End Time

How do I achieve this?

Regards,

Nitin

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member193545
Active Participant
0 Kudos

Hi Niti

Please can you contact me by email concerning this, we will work out the solution togeather and then post it in the forum once it is done.

Thanks

Former Member
0 Kudos

HY

Any solution? beside parsing and create code, maybe some BAPI useful functions?

https://www.sdn.sap.com/irj/sdn/forums

Thanks to Sriram Ponna

data : time like sy-uzeit.

CALL FUNCTION 'CATT_ADD_TO_TIME'

EXPORTING

idate = sy-datum

itime = sy-uzeit

stdaz = '4.00'

IMPORTING

  • EDATE =

ETIME = time

.

Edited by: V Lucian on May 9, 2008 1:02 PM