Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error generating the test frame in SE37

brkcnplt
Explorer
0 Likes
1,693

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.

1 ACCEPTED SOLUTION
Read only

former_member1716
Active Contributor
1,516

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.

AGE CALCULATE

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.

3 REPLIES 3
Read only

former_member1716
Active Contributor
1,517

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.

AGE CALCULATE

Regards!

Read only

0 Likes
1,516

Thank you Sir ! I did understand the logic

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,516

The question has been answered a lot in the forum. Just search.