Application Development and Automation 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: 
Read only

SELECT-OPTIONS with values

Former Member
0 Likes
1,008

Good morning

I would add value when the program start without variant

I wrote:

SELECT-OPTIONS: s_object FOR cdhdr-objectclas NO INTERVALS

DEFAULT 'MATERIAL' TO 'COND_A' SIGN = 'I' OPTION = 'EQ'

.

but I got a mistake.

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
936

Fill up the values in the event INITIALIZATION


initialization.
s_matnr-low = 'ABC'.
s_matnr-sign = 'I'.
s_matnr-option = 'EQ'.
append s_matnr.

a®

Read only

Former Member
0 Likes
936

Try this:

SELECT-OPTIONS: s_object FOR cdhdr-objectclas

DEFAULT 'MATERIAL' TO 'COND_A' SIGN = 'I' OPTION = 'EQ' NO INTERVALS .

or

SELECT-OPTIONS: s_object FOR cdhdr-objectclas

DEFAULT 'MATERIAL' TO 'COND_A' OPTION = 'EQ' SIGN = 'I' .

Regards,

Ravi

Read only

0 Likes
936

Do it in the event INITIALIZATION.

From ABAPDOCU:

INITIALIZATION: This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen.

Read only

0 Likes
936

Alvaro,

Check this code


report zaRs
  no standard page heading line-size 255.

tables : mara.

select-options : s_matnr for mara-matnr.

initialization.
s_matnr-low = 'ABC'.
s_matnr-sign = 'I'.
s_matnr-option = 'EQ'.
append s_matnr.

a®

Read only

Former Member
0 Likes
936

hi,

you can check the value of SY-SLSET if it is intial then u can add the manually.

somthing like this :

if   SY-SLSET is initial . 
 s_matnr-low = 'ABC'.
s_matnr-sign = 'I'.
s_matnr-option = 'EQ'.
append s_matnr.
endif.

Best regards ,

karim

Read only

Former Member
0 Likes
936

Alvaro I did how you wrote:

INITIALIZATION.

s_udate-sign = 'I'.

s_udate-option = 'BT'.

s_udate-low = sy-datum - 7.

s_udate-high = sy-datum.

APPEND s_udate.

*

s_object-sign = 'I'.

s_object-option = 'EQ'.

s_object-low = 'MATERIAL'.

APPEND s_object.

s_object-sign = 'I'.

s_object-option = 'EQ'.

s_object-low = 'COND_A'.

APPEND s_object.

Thanks everybody for your support

Read only

Former Member
0 Likes
936

Hi try this,

tables: cdhdr.

SELECT-OPTIONS: s_object FOR cdhdr-objectclas NO INTERVALS

DEFAULT 'MATERIAL' TO 'COND_A' SIGN I OPTION BT.

The problem here is with ur syntax.

syntax:

..... DEFAULT val1 [TO val2] [OPTION opt] [SIGN sgn]

While using value options, If the addition TO is not specified, you must specify one of the expressions eq, ne, ge, gt, le, lt, cp, or np directly for opt. If the addition TO is specified, you must either specify bt or nb.

And one more problem is with ur low and high values.Please check once.

Thanks & Regards

Bhanu prakash.