Skip to Content

Restricting selection-options

I want to restrict the selection option of a field.

There will be no intervals to enter.

Only EQ will be available.

Will allow multiple values but no intervals.

when I enter somthing* and than proceed it displays a popup showing which criteria to select and there is only EQ value.

In other circumstances it works as I want. But I do not want the popup.

Please help.

I write the code below.

TABLES:

vbak.

SELECT-OPTIONS:

zvbeln FOR vbak-vbeln

NO INTERVALS

MATCHCODE OBJECT zpyp_posid

OBLIGATORY

.

INITIALIZATION.

PERFORM init_1001.

&----


*& Form init_1001

&----


  • text

----


FORM init_1001 .

TYPE-POOLS:

sscr.

DATA:

restriction TYPE sscr_restrict,

wa_opt_list TYPE sscr_opt_list,

ls_ass TYPE sscr_ass.

MOVE 'EQ' TO wa_opt_list-name.

MOVE 'X' TO wa_opt_list-options-eq.

APPEND wa_opt_list TO restriction-opt_list_tab.

MOVE: 'S' TO ls_ass-kind,

'I' TO ls_ass-sg_main,

' ' TO ls_ass-sg_addy,

'EQ' TO ls_ass-op_main,

'EQ' TO ls_ass-op_addy,

'ZVBELN' TO ls_ass-name.

APPEND ls_ass TO restriction-ass_tab.

CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

EXPORTING

  • PROGRAM =

restriction = restriction

  • DB = ' '

EXCEPTIONS

too_late = 1

repeated = 2

selopt_without_options = 3

selopt_without_signs = 4

invalid_sign = 5

empty_option_list = 6

invalid_kind = 7

repeated_kind_a = 8

OTHERS = 9

.

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Posted on Jan 17, 2005 at 02:34 PM

    Fuat,

    i modify your code:

    1)

    SELECT-OPTIONS:

    zvbeln FOR vbak-vbeln

    *NO INTERVALS "del

    MATCHCODE OBJECT zpyp_posid

    OBLIGATORY

    2)

    MOVE: 'S' TO ls_ass-kind,

    'I' TO ls_ass-sg_main,

    *' ' TO ls_ass-sg_addy, "del

    'EQ' TO ls_ass-op_main,

    *'EQ' TO ls_ass-op_addy,"del

    'ZVBELN' TO ls_ass-name.

    APPEND ls_ass TO restriction-ass_tab.

    .. and the 1st popup vanished

    Andreas

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jan 17, 2005 at 01:09 PM

    If so is the case, then why provide select-options ?

    Use 2 parameters, instead.

    Regards,

    Subramanian V.

    Add comment
    10|10000 characters needed characters exceeded

    • When I hit enter it does not happen.

      It only happens

      when I run the program enter a value with * and push F8.

      If I first enter value push enter and then F8 it does not happen.

      Message was edited by: Fuat Ulugay

  • Posted on Jan 18, 2005 at 07:58 AM

    Hi Fuat ,

    i don't understand ?!

    in my example report comes <b>no addtitional popup</b>:

    here's the complete test-report:

    REPORT z6.

    TABLES:

    vbak, bkpf.

    SELECT-OPTIONS:

    zvbeln FOR vbak-vbeln OBLIGATORY DEFAULT '5300000000'.

    INITIALIZATION.

    PERFORM init_1001.

    START-OF-SELECTION.

    SELECT belnr FROM bkpf INTO bkpf-belnr

    WHERE bukrs = '0001'

    AND belnr IN zvbeln

    AND gjahr = sy-datum(4).

    WRITE: / bkpf-belnr.

    ENDSELECT.

    IF sy-subrc <> 0.

    WRITE: / 'no entry found!'.

    ENDIF.

    &----


    *& Form init_1001

    &----


    FORM init_1001 .

    TYPE-POOLS:

    sscr.

    DATA:

    restriction TYPE sscr_restrict,

    wa_opt_list TYPE sscr_opt_list,

    ls_ass TYPE sscr_ass.

    MOVE 'EQ' TO wa_opt_list-name.

    MOVE 'X' TO wa_opt_list-options-eq.

    APPEND wa_opt_list TO restriction-opt_list_tab.

    MOVE: 'S' TO ls_ass-kind,

    'I' TO ls_ass-sg_main,

    'EQ' TO ls_ass-op_main,

    'ZVBELN' TO ls_ass-name.

    APPEND ls_ass TO restriction-ass_tab.

    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'

    EXPORTING

    restriction = restriction.

    ENDFORM.

    regards Andreas

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 18, 2005 at 09:40 AM

    Hi Fuat,

    there comes no pop up - I've del the default value !

    (Rel. 4.6C , SAPKB46C30)

    -> but i'll guess , we talk at cross-purposes

    regards Andreas

    Add comment
    10|10000 characters needed characters exceeded