Application Development 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: 

Regarding subtraction of 10 days from the current date

Former Member
0 Kudos

Need to know how I can get 10 days subtracted from the current date before the report is excuted. This needs to appear in the selection screen before the report is excuted.

The select option contains two fields the first field is the date which is 10 days subtracted from the current date and the next field is the current date.

Please suggest.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

SELECT-OPTIONS : s_date FOR sy-datum.

INITIALIZATION.

s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = sy-datum - 10.
s_date-high = sy-datum.
APPEND s_date.

5 REPLIES 5

former_member188829
Active Contributor
0 Kudos

Hi,

Use FM:RP_CALC_DATE_IN_INTERVAL

Former Member
0 Kudos

Hi Dolly

In the initialization event of your program, if say P_DATE_FROM is your from date parameter add this code

P_DATE_FROM = Sy-DATUM - 10.

Regards

Ranganath

Former Member
0 Kudos

Hi,

select-options:

s_date for date.

initialization.

s_date-low = sy-datum - 10.

s_date-high = sy-datum.

append s_date.

Plzz reward points if it helps.

former_member156446
Active Contributor
0 Kudos

Hi Dolly

I had a same req before check that code:


*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
*----------------------------------------------------------------------*
IF pa_older = 'X'.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = pa_end  "<<<<< date or in ur case sy-datum
days = '10'
months = '00'
signum = '-'
years = '00'
IMPORTING
calc_date = pa_end1.  " <<< subtracted date 
ENDIF.

Former Member
0 Kudos

SELECT-OPTIONS : s_date FOR sy-datum.

INITIALIZATION.

s_date-sign = 'I'.
s_date-option = 'BT'.
s_date-low = sy-datum - 10.
s_date-high = sy-datum.
APPEND s_date.