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

Function Module

Former Member
0 Likes
801

Hi,

I need a Function Module which takes date in the format 20.01.2006. If I add 2days to this i shud get the output as 22.06.2002.

Your help is highly appreciable

Thanks in advance.

Thanks,

Radhika.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
730

Hi Radhika,

The function "RP_CALC_DATE_IN_INTERVAL" can be used to add a maximum of 99 days to a date

Can check out FM BKK_ADD_WORKINGDAY

check use the FM RP_CALC_DATE_IN_INTERVAL

Check the function modules under Function group 'HRSEN00CRULE_CALE_DAYS '

Regards,

Naveen

6 REPLIES 6
Read only

Former Member
0 Likes
730

Hi,

I need a Function Module which takes date in the format 20.01.2006. If I add 2days to this i shud get the output as 22.01.2006.

Your help is highly appreciable

Thanks in advance.

Read only

Former Member
0 Likes
731

Hi Radhika,

The function "RP_CALC_DATE_IN_INTERVAL" can be used to add a maximum of 99 days to a date

Can check out FM BKK_ADD_WORKINGDAY

check use the FM RP_CALC_DATE_IN_INTERVAL

Check the function modules under Function group 'HRSEN00CRULE_CALE_DAYS '

Regards,

Naveen

Read only

0 Likes
730

Also try<b> Fm J_1H_CAL_DATE_IN_INTERVAL</b>

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

Read only

0 Likes
730

The formatting depends on your user settings, but here is a sample program. You must convert it to internal format and then you can add two days to it.



report zrich_0001.

data: 1_datum(10) type c value '01/20/2006'.
data: 2_datum(10) type c.
data: tmp_datum type sy-datum.


call function 'CONVERT_DATE_TO_INTERNAL'
     exporting
          date_external = 1_datum
     importing
          date_internal = tmp_datum.

tmp_datum = tmp_datum + 2.


call function 'CONVERT_DATE_TO_EXTERNAL'
     exporting
          date_internal = tmp_datum
     importing
          date_external = 2_datum.


write:/ 2_datum.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
730

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

  • DAYS = '0'

MONTHS = '1'

START_DATE = gd_begda

IMPORTING

RESULT_DATE = gd_begda.

use the above function module, and change the values in days and months according to ur requirment.

or use the below function module.

HR_SEN_CRULE_0100_DATE Increase/decrease DATE by a specific number of Days/Months/Years

Read only

Former Member
0 Likes
730

use

HR_SEN_CALE_DAYS_DATE