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: 

Restricting selection-options

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

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

Use 2 parameters, instead.

Regards,

Subramanian V.

0 Kudos

The input number may differ from 1 to many.

For each input I cannot use a different parameter. As you can see the number of input is variable.

The selection made will be used for multiple copy of database lines. So selection of a range may be dangerous. I also check that the range does not contain any *.

regards

0 Kudos

This is not happening for me. Are you sure that your "cursor" is not on the multiple selection icon when you hit enter?

Regards,

Rich Heilman

0 Kudos

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

andreas_mann3
Active Contributor
0 Kudos

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

0 Kudos

Hi,

I modified my code as you have suggested.

I write somthing* in zvbeln-low field than press F8 the same popup appeared.

regards

Message was edited by: Fuat Ulugay

0 Kudos

Ok, try this.

In your code..........add this line which i have "Bolded". This is telling it to except patterns as well.

move 'EQ' to wa_opt_list-name.

move 'X' to wa_opt_list-options-eq.

<b>move 'X' to wa_opt_list-options-CP.</b>

append wa_opt_list to restriction-opt_list_tab.

Regards,

Rich Heilman

0 Kudos

Thanks Rich Heilman

andreas_mann3
Active Contributor
0 Kudos

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

0 Kudos

Hi Andreas Mann ,

You use here a default value. In my case there is no default value.

Try your code without any default value and you will see the popup. Thanks.

andreas_mann3
Active Contributor
0 Kudos

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