09-15-2008 3:56 PM
When calling the function module COMPLEX_SELECTIONS_DIALOG and clearing out all of the ranges, it does not clear the ranges table parameter nor does it return an exception. Below is the code
form get_range_info
tables p_filter_range
using value(p_title)
value(p_search_help_name).
call function 'COMPLEX_SELECTIONS_DIALOG'
exporting
title = p_title
* TEXT =
* SIGNED = 'X'
* LOWER_CASE = ' '
* NO_INTERVAL_CHECK = ' '
* JUST_DISPLAY = ' '
* JUST_INCL = ' '
* EXCLUDED_OPTIONS =
* DESCRIPTION =
* HELP_FIELD =
search_help = p_search_help_name
* TAB_AND_FIELD =
tables
range = p_filter_range
exceptions
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
others = 5
.
if sy-subrc = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
The p_filter_range may contain data when passed to the subroutine. If it does and the ranges are cleared in the function module, the function module passes back the original range data in p_filter_range and does not raise an exception. Have I missed something in calling the function module or is this an error with the function module?
Thanks,
Brian Basch
09-16-2008 3:58 AM
Hi,
The function module 'COMPLEX_SELECTIONS_DIALOG' is used to get mutiple and various types of ranges from the user. That is about SIGN and OPTION field values. Hope that you know this.
Calling this function module with values in RANGE parameter will be the default values.
I checked it and it is not clearing the internal table. My code is as follows:
start-of-selection.
GW_SRVNR-OPTION = 'BT'.
GW_SRVNR-SIGN = 'E'.
GW_SRVNR-LOW = '11'.
GW_SRVNR-HIGH = '21'.
APPEND GW_SRVNR TO ITAB_RANGE_SRVNR.
PERFORM COMP_CHECK TABLES ITAB_RANGE_SRVNR.
LOOP AT ITAB_RANGE_SRVNR INTO GW_SRVNR.
WRITE: /5 GW_SRVNR-SIGN,
GW_SRVNR-OPTION,
GW_SRVNR-LOW,
GW_SRVNR-HIGH.
ENDLOOP.
FORM COMP_CHECK TABLES P_RANGE.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = ' '
TEXT =
SIGNED = 'X'
LOWER_CASE = ' '
NO_INTERVAL_CHECK = ' '
JUST_DISPLAY = ' '
JUST_INCL = ' '
EXCLUDED_OPTIONS =
DESCRIPTION =
HELP_FIELD =
SEARCH_HELP = 'HEHS_SRV_NUMBER'
TAB_AND_FIELD =
TABLES
RANGE = ITAB_RANGE_SRVNR
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " COMP_CHECK
It writes the default values and also the new values i entered.
Regards,
R.Nagarajan.
09-17-2008 10:33 PM
Problem solved. The parameter table of the subroutine, since undefined, appears to have a header. This was causing problems with other portions of my code. Clearing the header before leaving the subroutine solved the problem.