‎2008 Jul 28 10:02 PM
hi,
In my selection screen I set the value for kunnr-low as 100 and kunnr-high as 200. i just have one record in my custom table but that has kunnr set as 1300. so when these values are entered, no data must be retrieved, but that record with kunnr 1300 is being retrieved..here is my code..
APPEND i_dyn_fields.
MOVE: 'S_KUNNR-LOW' TO i_dyn_fields-fieldname.
APPEND i_dyn_fields.
MOVE: 'S_KUNNR-HIGH' TO i_dyn_fields-fieldname.
APPEND i_dyn_fields.
CALL FUNCTION 'DYNP_VALUES_READ'
...
..
read table i_dyn_fields index 3.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-low = i_dyn_fields-FIELDVALUE.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'EQ'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
read table i_dyn_fields index 4.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-HIGH = i_dyn_fields-FIELDVALUE.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'BT'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
something is wrong in the wa_kunnr-option !! i tried setting it to BT for kunnr-low, then no values where retrieved, but then it will fail when a single value is entered !!
how to deal with this ??
thanks
‎2008 Jul 28 10:07 PM
You must make sure that the customer numbers are in the internal format, which means it needs to have leading zeros. You can use the function module CONVERSION_EXIT_ALPHA_INPUT to convert from external format, to internal format.
read table i_dyn_fields index 3.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-low = i_dyn_fields-FIELDVALUE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_KUNNR-low
IMPORTING
OUTPUT = wa_KUNNR-low.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'EQ'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
read table i_dyn_fields index 4.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-HIGH = i_dyn_fields-FIELDVALUE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_KUNNR-HIGH
IMPORTING
OUTPUT = wa_KUNNR-HIGH.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'BT'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
Regards,
Rich Heilman
‎2008 Jul 28 10:07 PM
You must make sure that the customer numbers are in the internal format, which means it needs to have leading zeros. You can use the function module CONVERSION_EXIT_ALPHA_INPUT to convert from external format, to internal format.
read table i_dyn_fields index 3.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-low = i_dyn_fields-FIELDVALUE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_KUNNR-low
IMPORTING
OUTPUT = wa_KUNNR-low.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'EQ'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
read table i_dyn_fields index 4.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-HIGH = i_dyn_fields-FIELDVALUE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_KUNNR-HIGH
IMPORTING
OUTPUT = wa_KUNNR-HIGH.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'BT'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
Regards,
Rich Heilman
‎2008 Jul 28 10:25 PM
Yes Rich, You are right..Ur solutions works. Sorry Vijay, I tried urs, but had the same issue.
‎2008 Jul 28 10:11 PM
read table i_dyn_fields index 3.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-low = i_dyn_fields-FIELDVALUE.
wa_KUNNR-sign = 'I'.
wa_KUNNR-option = 'EQ'.
ENDIF.
read table i_dyn_fields index 4.
if not wa_kunnr-low is initial.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-HIGH = i_dyn_fields-FIELDVALUE.
wa_KUNNR-option = 'BT'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
else.
if not i_dyn_fields-FIELDVALUE is initial.
wa_KUNNR-LOW = i_dyn_fields-FIELDVALUE.
wa_KUNNR-option = 'EQ'.
wa_KUNNR-sign = 'I'.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
endif.