use one of the function modules
L_MC_TIME_DIFFERENCE
'SALP_SM_CALC_TIME_DIFFERENCE'
'/SDF/CMO_TIME_DIFF_GET'
L_MC_TIME_DIFFERENCE
'SALP_SM_CALC_TIME_DIFFERENCE'
'/SDF/CMO_TIME_DIFF_GET'
Here you can find examples and sample programs related to ABAP Report Programs, ALV Grid/List Programs, BDC, HR ABAP, Function Modules, BAPIs, BADIs, Smartforms, SapScripts, etc.