2020 Mar 29 2:34 PM
Hello I'm newbie in ABAP.
I'm currently write a function to calculate the age.
Here is my parameters and types :
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(GV_DOB) TYPE DATUM
*" EXPORTING
*" REFERENCE(GV_AGE) TYPE I .
And here is my source code.
data: lv_age type i.
lv_age = sy-datum+0(4) - gv_dob+0(4).
gv_age = lv_age.
But when I execute, the error message which is seen at title occur.
Can anyone explain this case.
2020 Mar 29 2:48 PM
Hello brkcnplt,
You already have a standard function module HRCM_TIME_PERIOD_CALCULATE which helps you in calculating the age. Follow the below link to get know the details of the FM. You can in fact get into the FM and understand the logic used.
Regards!
Hello I'm newbie in ABAP.
I'm currently write a function to calculate the age.
Here is my parameters and types :
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(GV_DOB) TYPE DATUM
*" EXPORTING
*" REFERENCE(GV_AGE) TYPE I .
And here is my source code.
data: lv_age type i.
lv_age = sy-datum+0(4) - gv_dob+0(4).
gv_age = lv_age.
But when I execute, the error message which is seen at title occur.
Can anyone explain this case.
2020 Mar 29 2:48 PM
Hello brkcnplt,
You already have a standard function module HRCM_TIME_PERIOD_CALCULATE which helps you in calculating the age. Follow the below link to get know the details of the FM. You can in fact get into the FM and understand the logic used.
Regards!
2020 Mar 29 4:02 PM
2020 Mar 29 4:19 PM
The question has been answered a lot in the forum. Just search.