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

Former Member
0 Kudos

Hi friends,

Can any one tell me how to check the entries in the input screen for the <b>select option</b> in the selection screen.

Thanx n Regards,

Venu

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos

hi,

hi,

chk this code.

SELECT-OPTIONS : s_kunnr for kna1-kunnr.

At selection-screen .

if s_kunnr-low = your condition.

show message.

endif.

like that

if s_kunnr-high = your condition.

show message.

endif.

rgds

anver

if hlped pls mark points

<b>kindly close the same other thread.</b>

regards,

anver

6 REPLIES 6

anversha_s
Active Contributor
0 Kudos

hi,

hi,

chk this code.

SELECT-OPTIONS : s_kunnr for kna1-kunnr.

At selection-screen .

if s_kunnr-low = your condition.

show message.

endif.

like that

if s_kunnr-high = your condition.

show message.

endif.

rgds

anver

if hlped pls mark points

<b>kindly close the same other thread.</b>

regards,

anver

0 Kudos

Hi anversha,

I will close the thread.

My question is can we check the entries in the dbtable whether it exists or not.

Thanx in advance,

Venu.

0 Kudos

hi,

try with ranges.

Ranges: r_field for <table>.

if not field1 is initial.

r_field-sign = 'I'.

r_field-option = 'EQ'.

r_field-option-low = field1.

append r_field.

endif.

if not field2 is initial.

r_field-sign = 'I'.

r_field-option = 'EQ'.

r_field-option-low = field2.

append r_field.

endif.

if field1 is initial and field2 is initial.

r_field-sign = 'I'.

r_field-option = 'EQ'.

append r_field.

endif.

select * from <table> where field1 in r_field.

rgds

anver

0 Kudos

Venu,

U can surely do as Vasanth mentioned in his post other way is to...The below option is better since it might be possible that the record does not exists for low and high value but there may be records between the specified values.

SELECT count(*) into lcnt

FROM dbtable

WHERE field in s_option.

If lcnt > 0.

records exist.

else.

no records

endif.

Message was edited by: Anurag Bankley

Former Member
0 Kudos

Hi Venu,

select options are in an internal table.

select-options s_matnr for mara-matnr.

...

data: line like sy-tyix.

...

describe table s_matnr lines line.

in line are the entries.

Regards, Dieter

Sorry, i have misunterstand.

You can check it by looping for s_matnr

debug it and you see the entries.

Sorry regards, Dieter

Message was edited by: Dieter Gröhn

Former Member
0 Kudos

Hello Venu,

For checking the entries in Select-options.

Try like this.

AT SELECTION-SCREEN On S_VBELN-LOW.

if not S_VBELN-LOW is initial.

SELECT SINGLE * from VBAP where VEBELn = S_VBELN-LOW.

if sy-subrc ne 0.

error message.

endif.

endif.

AT SELECTION-SCREEN On S_VBELN-HIGH.

if not S_VBELN-HIGH is initial.

SELECT SINGLE * from VBAP where VEBELn = S_VBELN-HIGH.

if sy-subrc ne 0.

error message.

endif.

endif.

if useful reward.

Vasanth