Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection option values

Former Member
0 Likes
917

hi,

in my selection screen , i input values as follows

s_kunnr-low = 8000 s_kunnr-high = 1000

am i not supposed to get an error as it happens in other standard SAP screens ?? or is it something i need to handle ??

thks

1 ACCEPTED SOLUTION
Read only

ian_maxwell2
Active Participant
0 Likes
891

In a selection screen, for example:

tables:

KNA1.

select-options:

s_Kunnr for KNA1-Kunnr.

It will do an automatic check for you to ensure that the low is less then the high and will trigger an error automatically.

If you are in your program yourself populating a range object with values then no check will be done, it will except anything.

Can you post the code that you are using, so that we can see if there is anything out of the ordinary that you're doing.

~Ian

8 REPLIES 8
Read only

Former Member
0 Likes
891

Hi,

I think we cannot give as you said, because lower limit must be smaller or equal to higher limit.

Read only

Former Member
0 Likes
891

Hi,

what error your getting.

Is it lower limit is greater than upper limit.

Regards

Adil

Read only

Former Member
0 Likes
891

You have to Design the LOW and High value and Keep a text in Between , And you make them imitate like standard select option. except the one which you don't want.

But that doesn't make sense.

Low is always low and High is always High.

You may get wrong results..if you by pass the standard behaviour. Lot of Coding required.

Read only

ian_maxwell2
Active Participant
0 Likes
892

In a selection screen, for example:

tables:

KNA1.

select-options:

s_Kunnr for KNA1-Kunnr.

It will do an automatic check for you to ensure that the low is less then the high and will trigger an error automatically.

If you are in your program yourself populating a range object with values then no check will be done, it will except anything.

Can you post the code that you are using, so that we can see if there is anything out of the ordinary that you're doing.

~Ian

Read only

0 Likes
891

actually i am populating the KUNNR values into my custom table and in a selection screen i need the values from my custom table's kunnr !!! so i do a select from that as follows:

select-options: S_KUNNR for ZXXX-KUNNR NO-EXTENSION,

DATA: L_KUNNR TYPE KNA1-KUNNR.

SELECT DISTINCT KUNNR INTO L_KUNNR FROM ZXXX.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = L_KUNNR

IMPORTING

OUTPUT = L_KUNNR.

WA_ITAB-KUNNR = L_KUNNR.

APPEND WA_ITAB-KUNNR TO I_TAB.

ENDSELECT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'KUNNR'

dynpprog = sy-repid

dynpnr = SY-DYNNR

dynprofield = 'S_KUNNR-LOW'

value_org = 'S'

TABLES

value_tab = i_tab.

Read only

0 Likes
891

Ok Interesting. So the code that you are implimenting, which event is it being triggered on is it using the selection screen event "AT SELECTION-SCREEN - selscreen_event"?

If I remember correctly it only does the validation of the low and high once you actaully execute the report, not during the search-help population. Even when you just use the standard select option for KNA1-Kunnr it actaully will allow you to put a low value that is higher then the high value but once you execute the report (F8) it does the check and throws an error.

~Ian

Read only

0 Likes
891

event is

at selection-screen on value-request for s_kunnr-low.

so when user presses F4 !!

also, how i handle after user inputs the value is as follows:

let me know if i can still capture that error !!

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'

EXPORTING

dyname = sy-repid

dynumb = '0101'

TABLES

dynpfields = i_dyn_fields

EXCEPTIONS

read table i_dyn_fields index 1.

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 2.

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.

Read only

0 Likes
891

There is probrably a way that you could do it at that point, but honestly I think that you're going to have to jump through a bunch of hoops to get it to work becuase of various scenarios such the user decideing to either populate the high or the low value first. I would just wait until they execute the report and let the standard take care of it.

I haven't tried it but I think that the code that you've provided might not be able to get the value becuase I belive that the functions will only get the values once the report has been submited. It's worth a try but I wouldn't bet on it working that way

~Ian