Skip to Content
avatar image
Former Member

to disply month on selection screen

Hi all,

i'm modifying one report which contains date field on selection screen i need to replace date field by month field( jan, feb..) , how to do this.

Is there any function modules available

Regards

Suprith

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 15, 2008 at 03:46 AM

    check the Function module MONTH_NAMES_GET

    may be you can create a generic type in selection, attach a f4 help to it , using the at selection-screen on value request. in that event call the function and get the months table, use the table and show in f4 using the function F4IFTAB

    check it once.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2008 at 03:52 AM

    You can try something as below:

    TYPE-POOLS: vrm.
    
    PARAMETERS: p_month TYPE ltx AS LISTBOX VISIBLE LENGTH 10.
    
    DATA: i_val TYPE vrm_values,
          wa_val TYPE vrm_value,
          i_t247 TYPE STANDARD TABLE OF t247,
          wa_t247 TYPE t247.
    
    INITIALIZATION.
    
      CALL FUNCTION 'MONTH_NAMES_GET'
       EXPORTING
         language                    = sy-langu
        TABLES
          month_names                 = i_t247
       EXCEPTIONS
         month_names_not_found       = 1
         OTHERS                      = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    
      LOOP AT i_t247 INTO wa_t247.
        wa_val-key = wa_t247-mnr.
        wa_val-text = wa_t247-ltx.
        APPEND wa_val TO i_val.
      ENDLOOP.
    
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'P_MONTH'
          values          = i_val
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

    Regards

    Eswar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2008 at 09:07 AM

    Hi just try this code.

    <code>

    DATA : t_month type table of t247.

    parameters p_month(15) type c.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_month.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = 'MONTH'

    DYNPPROG = SY-CPROG

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'P_MONTH'

    VALUE_ORG = 'S'

    tables

    value_tab = t_month.

    INITIALIZATION.

    CALL FUNCTION 'MONTH_NAMES_GET'

    TABLES

    MONTH_NAMES = t_month

    EXCEPTIONS

    MONTH_NAMES_NOT_FOUND = 1

    OTHERS = 2.

    <code>

    Add comment
    10|10000 characters needed characters exceeded