Application Development 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: 

SELECT-OPTIONS BOTH OBLIGATORY

Former Member
0 Kudos

HI ALL!!

I HACE A REPORT THAT CONTAINS SOME SELECT OPTIONS AND I'M USING THE OBLIGATORY OPTION BUT IT'S ONLY FOR LO LOW ONE, SO HOW CAN I DO IT TO MAKE IT FOR BOTH, LOW AND HIGH.

THANKS AND REGARDS

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think FM SELECT_OPTIONS_RESTRICT will help. It has good documentation.

Rob

7 REPLIES 7

Former Member
0 Kudos

I think FM SELECT_OPTIONS_RESTRICT will help. It has good documentation.

Rob

0 Kudos

I THINK IT CUOLD BE:

AT SELECTION SCREEN ON SODATE.

IF SODATE-HIGH IS INITIAL.

MESSAGE E(000).

ENDIF.

THANKS ANY WAY

0 Kudos

Rob's right, here is a sample.



report zrich_0002 .

* Type pools
type-pools: slis, sscr.

* Selection Screen
select-options: s_date for sy-datum obligatory.

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          = 'BT'.
  opt_list-options-bt    = '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         = 'BT'.
  selopt-op_addy         = 'BT'.
  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

0 Kudos

Yes, you can do that also.

Regards,

Rich Heilman

0 Kudos

If you just want to validate the you can do that in your AT SELECTION-SCREEN and don't use the option ON sodate as sodate is a select-option. ON should be with sodate-low or sodate-high.

If you don't want the users to use multiple values option (the green arrow next to the select-option) then you can use no-extension. You may have to do this because your logic may not work on the multiple value screen.

Using the function module gives you more flexibility on how to control the behaviour of this select-option.

Srinivas

Former Member
0 Kudos

select-options: s_pernr for pa0000-pernr obligatory.

at selection-screen.

if s_pernr-high is initial.

message e000. "Error message

endif.

Former Member
0 Kudos

Hi,

Chk the code below. I guess this solves the problem.

SELECT-OPTIONS s_matnr FOR mara-matnr OBLIGATORY.

WRITE g_target TO v_char NO-ZERO.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'S_MATNR-HIGH'.

SCREEN-REQUIRED = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'S_MATNR'.

SCREEN-REQUIRED = 'X'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards

Santosh