Skip to Content
0
Former Member
Dec 03, 2011 at 07:14 AM

Issue with Select options in select statement - ABAP Question

1010 Views

Hi

I am facing an issue with select options. Select statement is returning sy-subrc as 4.

I wrote the program as below:

SELECT-OPTIONS:

s_kunnr FOR bsad-kunnr,

s_lifnr FOR bsak-lifnr,

s_gjahr FOR bsad-gjahr,

s_bukrs FOR bsad-bukrs,

s_saknr FOR bsad-saknr,

s_budat FOR bsak-budat.

In start of selection I have written the select statement as

SELECT * FROM bsak INTO TABLE lt_bsak

WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.

In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.

If am removing the "lifnr = s_lifnr " condition in select then select is returning values.

I am not getting where I made the mistake. Please suggest.

Thank you

Hanu