Skip to Content
author's profile photo Former Member
Former Member

hi............

hi,

I have two radio buttons named as cha, ghi on the selection screen and i have one field credit on the selection screen which is select-option. so when user enters high value or multiple single values for low value , it has to show error.

pls let me know hw to write the code for that..

Akshitha.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2007 at 03:16 PM

    U can format the select-option using the fm <b>SELECT_OPTIONS_RESTRICT</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2007 at 03:20 PM

    To allow the user to process only single fields on the selection screen, you use the following syntax:

    SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS .....

    Also check the related link

    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba76d35c111d1829f0000e829fbfe/content.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 07, 2007 at 03:21 PM

    Right, instead of giving an error for what is not allowed, simply do not give them the option to do so. Here you can restrict that the user can only enter single values for a select-option.

    
    report zrich_0001.
    
    * Type pools
    type-pools: slis, sscr.
    
    * Selection Screen
    select-options: s_date for sy-datum no intervals.
    
    initialization.
      perform initilization.
    
    
    ************************************************************************
    *  INITILIZATION
    ************************************************************************
    form initilization.
    
    * Restrict the select options for S_DATE
    * to just a date range
      data: selopt   type sscr_ass,
            opt_list type sscr_opt_list,
            restrict type sscr_restrict.
    
      clear opt_list.
      opt_list-name          = 'EQ'.
      opt_list-options-eq    = 'X'.
      append opt_list to restrict-opt_list_tab.
    
      clear selopt.
      selopt-kind            = 'S'.
      selopt-name            = 'S_DATE'.
      selopt-sg_main         = 'I'.
      selopt-sg_addy         = ' '.
      selopt-op_main         = 'EQ'.
      selopt-op_addy         = 'EQ'.
      append selopt  to restrict-ass_tab.
    
      call function 'SELECT_OPTIONS_RESTRICT'
           exporting
                restriction            = restrict
           exceptions
                too_late               = 1
                repeated               = 2
                selopt_without_options = 5
                selopt_without_signs   = 6
                invalid_sign           = 7
                empty_option_list      = 9
                invalid_kind           = 10
                repeated_kind_a        = 11
                others                 = 12.
    
    
    endform.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.