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: 

Month Pop Up From Report Selection Screen Parameter

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

Hi,

How to give the f4 help for the month.

Regards,

IFF

0 Kudos


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

Former Member
0 Kudos

..

Message was edited by:

Perez C