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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

  • 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 a 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 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.