Example Input Month and Year on selection screen
Step 1 : Define Variable
DATA: iexw(6) TYPE c.
DATA: zret LIKE isellist-month.
DATA: l_code LIKE sy-subrc.
Step 2 : Define Selection Screen
SELECT-OPTIONS: zexw FOR iexw NO-EXTENSION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR zexw-low.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
actual_month = sy-datum(6)
language = sy-langu
start_column = 20
start_row = 14
IMPORTING
selected_month = zret
return_code = l_code
EXCEPTIONS
factory_calendar_not_found = 1
holiday_calendar_not_found = 2
month_not_found = 3
OTHERS = 4.
PERFORM zlow USING zret.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR zexw-high.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
actual_month = sy-datum(6)
language = sy-langu
start_column = 40
start_row = 14
IMPORTING
selected_month = zret
return_code = l_code
EXCEPTIONS
factory_calendar_not_found = 1
holiday_calendar_not_found = 2
month_not_found = 3
OTHERS = 4.
PERFORM zhigh USING zret.
*---------------------------------------------------------------------*
* FORM zlow *
*---------------------------------------------------------------------*
FORM zlow USING zret.
CHECK zret NE '000000'.
READ TABLE zexw INDEX 1.
zexw-sign = 'I'.
zexw-option = 'EQ'.
zexw-low = zret.
IF sy-subrc EQ 0.
IF zexw-high NE ''.
zexw-option = 'BT'.
ENDIF.
MODIFY zexw INDEX 1.
ELSE.
APPEND zexw.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM zhigh *
*---------------------------------------------------------------------*
FORM zhigh USING zret.
check zret ne '000000'.
READ TABLE zexw INDEX 1.
IF sy-subrc NE 0.
CLEAR zret.
EXIT.
ENDIF.
zexw-sign = 'I'.
zexw-option = 'BT'.
zexw-high = zret.
MODIFY zexw INDEX 1.
ENDFORM.
No comments:
Post a Comment