SAP L_TO_TIME_DIFF Function Module for NOTRANSL: Berechnen der Dauer aus Start- und Endezeitpunkt eines TAs
L_TO_TIME_DIFF is a standard l to time diff SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Berechnen der Dauer aus Start- und Endezeitpunkt eines TAs processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for l to time diff FM, simply by entering the name L_TO_TIME_DIFF into the relevant SAP transaction such as SE37 or SE38.
Function Group: L03D
Program Name: SAPLL03D
Main Program:
Appliation area: L
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function L_TO_TIME_DIFF pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'L_TO_TIME_DIFF'"NOTRANSL: Berechnen der Dauer aus Start- und Endezeitpunkt eines TAs.
EXPORTING
I_START_DATE = "Start Date of the Transfer Order
I_START_TIME = "Start time of the transfer order
I_END_DATE = "Transfer Order End Date
I_END_TIME = "Transfer Order End Time
I_TIME_UOM = "Time unit for performance data
IMPORTING
E_TIME_DIFF = "Actual Time of the WM Transfer Order
EXCEPTIONS
INPUT_DATA_EMPTY = 1
IMPORTING Parameters details for L_TO_TIME_DIFF
I_START_DATE - Start Date of the Transfer Order
Data type: LTAK-STDATOptional: No
Call by Reference: No ( called with pass by value option)
I_START_TIME - Start time of the transfer order
Data type: LTAK-STUZTOptional: No
Call by Reference: No ( called with pass by value option)
I_END_DATE - Transfer Order End Date
Data type: LTAK-ENDATOptional: No
Call by Reference: No ( called with pass by value option)
I_END_TIME - Transfer Order End Time
Data type: LTAK-ENUZTOptional: No
Call by Reference: No ( called with pass by value option)
I_TIME_UOM - Time unit for performance data
Data type: LTAK-ZEIEIOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for L_TO_TIME_DIFF
E_TIME_DIFF - Actual Time of the WM Transfer Order
Data type: LTAK-ISTWMOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INPUT_DATA_EMPTY - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for L_TO_TIME_DIFF Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_e_time_diff | TYPE LTAK-ISTWM, " | |||
| lv_i_start_date | TYPE LTAK-STDAT, " | |||
| lv_input_data_empty | TYPE LTAK, " | |||
| lv_i_start_time | TYPE LTAK-STUZT, " | |||
| lv_i_end_date | TYPE LTAK-ENDAT, " | |||
| lv_i_end_time | TYPE LTAK-ENUZT, " | |||
| lv_i_time_uom | TYPE LTAK-ZEIEI. " |
|   CALL FUNCTION 'L_TO_TIME_DIFF' "NOTRANSL: Berechnen der Dauer aus Start- und Endezeitpunkt eines TAs |
| EXPORTING | ||
| I_START_DATE | = lv_i_start_date | |
| I_START_TIME | = lv_i_start_time | |
| I_END_DATE | = lv_i_end_date | |
| I_END_TIME | = lv_i_end_time | |
| I_TIME_UOM | = lv_i_time_uom | |
| IMPORTING | ||
| E_TIME_DIFF | = lv_e_time_diff | |
| EXCEPTIONS | ||
| INPUT_DATA_EMPTY = 1 | ||
| . " L_TO_TIME_DIFF | ||
ABAP code using 7.40 inline data declarations to call FM L_TO_TIME_DIFF
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single ISTWM FROM LTAK INTO @DATA(ld_e_time_diff). | ||||
| "SELECT single STDAT FROM LTAK INTO @DATA(ld_i_start_date). | ||||
| "SELECT single STUZT FROM LTAK INTO @DATA(ld_i_start_time). | ||||
| "SELECT single ENDAT FROM LTAK INTO @DATA(ld_i_end_date). | ||||
| "SELECT single ENUZT FROM LTAK INTO @DATA(ld_i_end_time). | ||||
| "SELECT single ZEIEI FROM LTAK INTO @DATA(ld_i_time_uom). | ||||
Search for further information about these or an SAP related objects