Ansicht
Dokumentation

ABENDATE_TIME_ABEXA - DATE TIME ABEXA

ABENDATE_TIME_ABEXA - DATE TIME ABEXA

PERFORM Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Evaluating Date Fields and Time Fields

This example demonstrates calculations with date and time fields.

Source Code

Execute

Description

In the first part of the main method, the last day of the previous month is assigned to the date field ultimo. First, ultimo is filled with the current date. Then, the date is changed to the first day of the current month by specifying an offset. Finally, 1 is subtracted from ultimo so that the content of the field is changed to the last day of the previous month. Before the subtraction takes place, the system converts ultimo into the number of days since 01.01.0001 and converts the result back into a date.

In the second part, the number of hours between midnight and the current time are calculated. First, the difference between the time fields is calculated. The difference is then converted into the total number of seconds using the MOD operation. A positive difference remains unchanged. This step is only necessary for negative differences. Finally, the number of hours is calculated by dividing the number of seconds by 3600.






CPI1466 during Backup   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 1298 Date: 20240418 Time: 074443     sap01-206 ( 37 ms )