Skip to Content
0
Former Member
Mar 25, 2010 at 02:57 AM

Populate SELECT-OPTIONS default value using CALL FUNCTION

2782 Views

Hi Experts,

I would like to populate SELECT-OPTIONS s_currm default with value in w_currm, however, it doesn't seem to work. Can you please advise what the correct syntax is.

Note that CALL FUNCTION 'GET_CURRENT_YEAR' is working correctly and populating w_currm (as I can use it in a SQL SELECT statement), however, it does not seem to work for SELECT-OPTIONS s_currm.

Thank you for your time.

Code snippet is as a follows:

REPORT  Z_DOWNLOAD_BSIS_TEST.

*Data Declaration
DATA: w_currm TYPE BSIS-MONAT.

*Define current fiscal month
CALL FUNCTION 'GET_CURRENT_YEAR'
  EXPORTING
    BUKRS         = 'X999'     " Company Code
    DATE          = SY-DATUM   " Date to find fiscal year for
  IMPORTING
    CURRM         = w_currm.   " Current Fiscal Month

SELECT-OPTIONS s_currm FOR w_currm
               DEFAULT w_currm. " The default value is NOT being populated (appears blank)