‎2008 Jul 31 9:52 PM
hey,
i have a select option, s_kunnr. User enters a value for s_kunnr-high, but it is not taken into account in the select statement !!
my code is
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'.
if NOT WA_KUNNR-LOW is initial.
wa_KUNNR-option = 'BT'.
else.
wa_KUNNR-option = 'EQ'.
endif.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
what is the issue ??
thks
‎2008 Jul 31 10:21 PM
Instead of the logic you have written, you can write much simpler logic.
LOOP AT s_kunnr INTO s_kunnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_KUNNR-LOW
IMPORTING
OUTPUT = s_KUNNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_KUNNR-high
IMPORTING
OUTPUT = s_KUNNR-high.
MODIFY s_kunnr FROM s_kunnr.
ENDLOOP.
and you are done... AS per your logic it's correct but the only mistake is you are appending a new row in s_KUNNR and you are not passing the value in s_kunnr-sign. so that's why it is not fetching anything.. try passing 'BT' into s_kunnr-sign and that will also work.
Rewards point if it is useful.
Thanks,
Navneet
‎2008 Jul 31 9:55 PM
wa_kunnr-low = somekunnr. " i hope it is there
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'.
if NOT WA_KUNNR-LOW is initial.
wa_KUNNR-option = 'BT'.
else.
wa_KUNNR-option = 'EQ'.
endif.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
‎2008 Jul 31 10:02 PM
No Vijay. is there not a possibility that user does not enter any value for s_kunnr-low but directly enters for s_kunnr-high ?? should not SAP then take it as EQ according to my logic ??
‎2008 Jul 31 10:08 PM
if that is the case you have to provide that as LOW and option = 'EQ'.
if kunnr-low is initial.
kunnr-low = kunnr-high.
kunnr-option = 'EQ'.
endif.
but you still want ' ' to kunnr what ever you enter then you can go ahead with that..
‎2008 Jul 31 9:57 PM
Try this,
Append S_KUNNR directly instead of using WA.
E.g.:
S_KUNNR-SIGN = 'i"
S_KUNNR-OPTION = 'BT'
S_KUNNR-LOW =
S_KUNNR-HIHG =
Thanks,
SKJ
‎2008 Jul 31 10:03 PM
u should build your logic in a way that u first populate low and then high part of the selection option. Without populating low if u populate high value then it will give u error. So I think u should first populate low and then high and based on it decides value for option field like:
if NOT WA_KUNNR-high is initial.
wa_KUNNR-option = 'BT'.
else.
wa_KUNNR-option = 'EQ'.
endif.
Pl. check ur code again..
‎2008 Jul 31 10:09 PM
On ranges:
- BT - Uses Low and High
- EQ - Uses Low
This would mean from looking at your code that in the case where EQ is used it is actaully looking for a record where Kunnr is blank instead of the value that you put in High.
Just got to switch a couple of things around
~Ian
‎2008 Jul 31 10:11 PM
if NOT WA_KUNNR-LOW is initial.
wa_KUNNR-option = 'BT'.
else.
wa_KUNNR-option = 'EQ'.
wa_kunnr-low = wa_kunnr-high. <-=== add this your low is space,but you are using EQ
endif.
append wa_KUNNR to s_KUNNR.
clear wa_KUNNR.
ENDIF.
‎2008 Jul 31 10:21 PM
Instead of the logic you have written, you can write much simpler logic.
LOOP AT s_kunnr INTO s_kunnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_KUNNR-LOW
IMPORTING
OUTPUT = s_KUNNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_KUNNR-high
IMPORTING
OUTPUT = s_KUNNR-high.
MODIFY s_kunnr FROM s_kunnr.
ENDLOOP.
and you are done... AS per your logic it's correct but the only mistake is you are appending a new row in s_KUNNR and you are not passing the value in s_kunnr-sign. so that's why it is not fetching anything.. try passing 'BT' into s_kunnr-sign and that will also work.
Rewards point if it is useful.
Thanks,
Navneet