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 SCREEN - Intervals

Shky
Product and Topic Expert
Product and Topic Expert
0 Likes
1,869

Hi,

I have a selection screen field. I want to perform custom checks on that field.

For example I have a field as below:

Grade: _________ to ______

I enter F and A in the above fields for LOW and HIGH respectively.

As per my application A is greater than F. But as per the selection screen, it compares the ASCII values and always gives the error "Lower limit is higher than upper limit" as F is greater than A. Hence I want to use a customized check for this.

I used my own fields and did a customized check, but if I add intervals it still allows ranges in the selection pop up.

Can you please help?

Regards,

Shalini.

8 REPLIES 8
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

well that's strange .. what is the problem is you pass A to F .. i think your o/p will stillbe the same ?

why you want to do so much of coding when you cna use the normal behavior of sap.

Read only

Shky
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

Hi,

Thanks for the response

I understand it is the same. But the user input may keep varying. so we convert A and F to the internal values and do a check.

Also in the DB, the search would be done with (where value > A and value <F ) which would be empty. All entries in DB have grades <A and >F.

Is it possible that the results would swap automatically when low is greater than high.

This is not the only case. Grade could be A-F, 0-100, 0-10, etc.

Thanks,

Shalini.

Edited by: Shalini Krishnamoorthy on Jul 23, 2010 4:15 PM

Read only

0 Likes
1,262

hmmm.... create your own screen (custom screen) and create select options on this screen using a subscreen. hope this will help,

Read only

Shky
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

Hi Sandeep,

I am doing all these in my own selection screen only.

Regards,

Shalini

Read only

former_member585060
Active Contributor
0 Likes
1,262

Hi,

Try with the below function module in AT Selection-Screen events

RS_SELOPT_NO_INTERVAL_CHECK,

and code your validations after that.

Regards

Bala Krishna

Read only

Shky
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

Hi Bala Krishna,

I have added the function module in form pgrade:

AT SELECTION-SCREEN ON pgrade_h.

PERFORM pgrade.

However if I enter the ranges, it still gives me error.

Thanks,

Shalini

Read only

0 Likes
1,262

Hi Shalini

The grade field that you have built on the selection screen must be linked with any ddic table.I mean that garde field must be existing in DDic table in which u r working.If it is existing then in the domain of that field in the value check tab you can specify the lower and upper limit.

Hope its solves ur problem.

Thanks!!

Read only

0 Likes
1,262

Hi,

Code that in AT SELECTION-SCREEN OUTPUT event.

SELECT-OPTIONS : s_var FOR lv_var.

AT SELECTION-SCREEN OUTPUT.

  PERFORM no_sel_option_check.

START-OF-SELECTION.


FORM no_sel_option_check .
  DATA: lt_s_option TYPE TABLE OF rsldbselop,
  lwa_s_option TYPE rsldbselop.

  lwa_s_option-name = 'S_VAR'.
  APPEND lwa_s_option TO lt_s_option.

  CALL FUNCTION 'RS_SELOPT_NO_INTERVAL_CHECK'
    EXPORTING
      program        = sy-repid
    TABLES
      selop          = lt_s_option
    EXCEPTIONS
      no_programname = 1
      OTHERS         = 2.
  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. " NO_SEL_OPTION_CHECK

Regards

Bala Krishna