11-22-2007 9:35 AM
Hi Experts,
I need to generate a report where the user will select the month from the selection screen of the report with the F4 help, then for the month selected I need to find out the starting date of selected month & end date of selected month.
Are there any standard function modules available.
Thanks in Advacne,
Regards,
IFF
11-22-2007 9:43 AM
For first day of the month simply append 01 to month and year, it would be better than using a FM as it would be faster. Also the FM will be having the same logic within.
For last day of the month use FM
RP_LAST_DAY_OF_MONTHS and pass the first day.
Hope it helps
Lokesh
Message was edited by:
Lokesh Aggarwal
11-22-2007 9:57 AM
11-22-2007 1:48 PM
PARAMETERS : s_month LIKE isellist-month OBLIGATORY.
SELECT-OPTIONS : s_date FOR sy-datum NO-DISPLAY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month.
PERFORM get_dates.
FORM get_dates.
DATA : month LIKE isellist-month,
first_day LIKE sy-datum,
last_day LIKE sy-datum.
month = sy-datum+0(6). "default
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
actual_month = month
IMPORTING
selected_month = month.
IF sy-subrc <> 0.
"put some message
ENDIF.
CONCATENATE month '01' INTO first_day.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = first_day
IMPORTING
last_day_of_month = last_day.
IF sy-subrc <> 0.
"put some message
ENDIF.
s_date-low = first_day.
s_date-high = last_day.
s_date-sign = 'I'.
s_date-option = 'BT'.
APPEND s_date.
s_month = month.
ENDFORM. "get_dates
START-OF-SELECTION.
SELECT ..........WHERE date IN s_date. "select statement
11-22-2007 9:58 AM