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: 

range of dates

Former Member
0 Kudos

Hi,

I have added date field in selection-screen using select-options.There are 2 radiobuttons in the selection-screen monthly and weekly.If I enter the date range and click on weekly radiobutton,then the o/p is getting displayed upto 6 weeks irrespective of the dates entered in the date field and if I select the monthly radiobutton the o/p is getting displayed only upto 3 months irrespective of the dates entered in the range.Is there any method where in which in the o/p i can see the data for all the dates that are entered in the selection screen for both monthly and weekly?

Regards,

Hema

1 REPLY 1

Former Member
0 Kudos

"in your case better disable select-options and use follwing code..

PARAMETERS: weeks  RADIOBUTTON GROUP rad1.
PARAMETERS : months RADIOBUTTON GROUP rad1.

SELECT-OPTIONS : s_date FOR sy-datum NO-DISPLAY.

START-OF-SELECTION.

  IF weeks = 'X'.
    s_date-sign = 'I'.
    s_date-option = 'BT'.
    s_date-low = sy-datum.
    s_date-high = sy-datum + 42. "six weeks date
    APPEND s_date.
  ELSE.
    s_date-sign = 'I'.
    s_date-option = 'BT'.
    s_date-low = sy-datum.
    CALL FUNCTION 'SG_PS_ADD_MONTH_TO_DATE'
      EXPORTING
        months  = '3'
        olddate = sy-datum
      IMPORTING
        newdate = s_date-high.
    APPEND s_date.
  ENDIF.