`

Calculate the days, months and years between 2 dates.

    博客分类:
  • ABAP
 
阅读更多
FORM compute_2date_diff.
  DATA: lv_date1 LIKE sy-datum,
        lv_date2 LIKE sy-datum,
        lv_month TYPE pea_scrmm,
        lv_days  TYPE pea_scrdd.
*lv_date1 must be greater than lv_date2
  lv_date1 = '20120201'.
  lv_date2 = '20120101'.
  CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
      date1                         = lv_date1
      date2                         = lv_date2
     OUTPUT_FORMAT                 = '05'
   IMPORTING
*     YEARS                         =
     months                        = lv_month
     days                          = lv_days
   EXCEPTIONS
     invalid_dates_specified       = 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.

ENDFORM.                    "compute_2date_diff
分享到:
评论

相关推荐

    poj 1004 Financial Management

    Help Larry by writing a program to take his closing balance from each of the past twelve months and calculate his average account balance. Input The input will be twelve lines. Each line will ...

    C-language-to-calculate-the-number-of-days-between-dates

    本项目标题为“C-language-to-calculate-the-number-of-days-between-dates”,旨在教授如何使用C语言实现这一功能。在进行这样的计算时,我们通常会考虑日期的年份、月份和日,以及可能涉及的闰年规则。 首先,...

    Guide to Scientific Computing in C++

    Example: A Function to Calculate the Scalar Product of Two Vectors . . . . . . . . . . . . . . . . . . . . . . . Reference Variables . . . . . . . . . . . . . . . . . . . . . . . Default Values for ...

    Calculate-the-day-of-the-year.zip_The Year

    本项目“Calculate-the-day-of-the-year.zip_The Year”提供了这样的学习资源,通过一个名为“Calculate the day of the year.txt”的文本文件,帮助我们理解如何实现这一功能。 首先,我们需要知道的是年份、月份...

    ros by example for indigo volume 2

    3.8.11 Passing user data between states and state machines............................................44 3.8.12 Subtasks and hierarchical state machines...................................................

    计算机网络第六版答案

    Acknowledgments: Over the years, several students and colleagues have helped us prepare this solutions manual. Special thanks goes to HongGang Zhang, Rakesh Kumar, Prithula Dhungel, and Vijay ...

    Beginning Neo4j(Apress,2016)

    Using this book, you'll get everything up and running, and then learn how to use Neo4j to build up recommendations, relationships, and calculate the shortest route between two locations. With example ...

    Enviro - Sky and Weather.7z

    You can set the start and end days of each season. Enviro also supports temperature simulation, based on season, time of day and current weather. Clouds: Enviro new raymarching cloud system is ...

    View Factor

    The purpose of creating this model is to calculate view factors between complex geometries. The view factor matrices of an enclosed space and of a geometry with openings on its surfaces are presented...

    systester.rar

    System Stability Tester began as a system stressing and benchmarking tool for overclockers, by the Greek pctechnology and overclockers community, the first months of 2005. Since its first release 0.1 ...

    Phased_Array_Impedance_Calculation.rar_antennas matlab_between

    Calculate the impedance between two antennas.

    Beginning.Neo4j.1484212

    Using this book, you'll get everything up and running, and then learn how to use Neo4j to build up recommendations, relationships, and calculate the shortest route between two locations. With example ...

    calculate2.zip

    这个名为"calculate2.zip"的压缩包文件可能包含了实现这样一个计算器应用的所有源代码和资源文件。接下来,我们将深入探讨如何在Android Studio中构建一个基本的计算器应用。 首先,我们需要了解Android Studio的...

    calculate(java).rar_Calculate.ja_calculate java_calculate.java

    【标题】"calculate(java).rar_Calculate.ja_calculate java_calculate.java" 指的是一款基于Java语言开发的计算器程序。这个程序可能包含了用于构建图形用户界面(GUI)以及处理基本数学运算的源代码。"Calculate....

    c++实验三、四.pdf

    The classes also have functions to calculate the area of the shape, display the basic information of the shape, and modify the basic information of the shape. Circle Class The Circle class has ...

    数据结构PPT优秀资料.ppt

    * 计算表达式值:PPT shows how to calculate the value of an arithmetic expression using different traversal methods (prefix, infix, and postfix). 图遍历 在图遍历中,PPT introduces the concept of ...

    二级减速器课程设计说明书reducer design specification.doc

    According to the selected fullload speed of the motor nm and the drive shaft speed of the motor nw,we can calculate the total transmission ratio of the transmission device ia: (2)Allocate ...

Global site tag (gtag.js) - Google Analytics