F4 Help for Month in ABAP Selection Screen

We have a database field to hold year and month together in the format YYYYMM (example 201201). We are creating a report using this field on the selection screen, so we need to provide F4 help for this month field. The following code will provide the F4 help for month.

*&---------------------------------------------------------------------*
*&      Selection Screen
*&---------------------------------------------------------------------*
PARAMETERS: p_month TYPE isellist-month.

*&---------------------------------------------------------------------*
*&      At Selection Screen Event
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_month.

  CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
    EXPORTING
      actual_month               = sy-datum(6)
    IMPORTING
      selected_month             = p_month
    EXCEPTIONS
      factory_calendar_not_found = 1
      holiday_calendar_not_found = 2
      month_not_found            = 3
      OTHERS                     = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

When we press F4 help for the month field, the following popup will be displayed.

f4-help-month


1 Comment

Leave a Reply

Your email address will not be published.


*