Application Development and Automation 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: 
Read only

DAYS TIME Function Module

Former Member
0 Likes
1,103

Hi Frnds,

I am having Start Date, Start time , End Date, End Time, the out put should be in Format- Days-HH:MM , I there any Function Module for this

Thanks,

Y.Ravi kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,028

Hi,

you can work with

write... USING EDIT MASK mask

Regards

Nicole

8 REPLIES 8
Read only

Former Member
0 Likes
1,029

Hi,

you can work with

write... USING EDIT MASK mask

Regards

Nicole

Read only

Former Member
0 Likes
1,028

Hi,

you can use this function module

in this field "i_time_uom " give the unit of measure

H -hours

d- days

s - seconds.

so the resultant can be calculated in any of the above mentioned units.

call function 'L_TO_TIME_DIFF'

exporting

i_start_date = i_qmel-strmn

i_start_time = i_qmel-strur

i_end_date = i_final-budat2

i_end_time = i_final-erzet2

i_time_uom = 'H'

importing

e_time_diff = ydatdiff

  • EXCEPTIONS

  • INPUT_DATA_EMPTY = 1

  • OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Regards

Read only

Former Member
0 Likes
1,028

Hi Ravi,

To satisfy your exact requirement

Use the below code:

DATA: v_days TYPE i,

v_diff TYPE tvro-fahztd.

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

beg_da = '20070901'

end_da = '20070907'

IMPORTING

no_cal_day = v_days.

CALL FUNCTION 'SD_CALC_DURATION_FROM_DATETIME'

EXPORTING

i_date1 = '20070901'

i_time1 = '102000'

i_date2 = '20070907'

i_time2 = '114000'

IMPORTING

e_tdiff = v_diff.

WRITE: v_days, '-', v_diff.

Read only

Former Member
0 Likes
1,028

hi

good

you can try this kind of logic

lv_date type sy-datum.

lv_formatdate(10) type c.

var1(4) type c,

var2(2) type c,

var3(2) type c.

lv_date = 20070627.

var1 = lv_date+(4).

var2 = lv_date+4(2)

var3 = lv_date+6(2).

contatenate var3 var2 var1 into lv_formatdate separated by '.'

thanks

mrutyun^

Read only

Former Member
0 Likes
1,028

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb334a358411d1829f0000e829fbfe/content.htm">refer this link</a>

regards,

srinivas

Read only

Former Member
0 Likes
1,028

Hai Ravi

Use the Function Module ISHMED_CALC_DATE_TIME_DIFF

Import parameters Value

I_BEGDT 01.01.2007

I_BEGTM 00:00:00

I_ENDDT 01.08.2007

I_ENDTM 00:00:00

Changing parameters Value

CR_ERRORHANDLER

Export parameters Value

E_DIFF_DAY 212

E_ENDDT_EARLY

E_RC 0

U can find the time diff also from this function module.

OR OR OR OR

you Use SD_DATETIME_DIFFERENCE

DATE1 01.01.2007

TIME1 12:00:00

DATE2 01.08.2007

TIME2 10:00:00

Export parameters Value

DATEDIFF 211

TIMEDIFF 22

EARLIEST 1

Reward Points If Use Full

Thanks & Regards.

Shiva

Read only

0 Likes
1,028

ISHMED_CALC_DATE_TIME_DI , this Fm not available can you check spelling

Read only

0 Likes
1,028

hi Ravi

In ECC 6.0 ISHMED_CALC_DATE_TIME_DIFF it is present Please Check,

Its Correct And The output which i Have given Is From that Function Module ITself.

THanks & Regards

Shiva