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 Query LQUA Table

former_member659396
Participant
0 Likes
1,223

Hi Experts

Can Any one tell me ,

Is there anything wrong in this select query, As per my knoledge everything is Fine, But Still i am getting SY-SUBRC = 4 for this Query,

Its a Warehouse Management table LQUA i have Used.

TABLES:mara,lqua.

*Internal Table And Work Area Declearation

DATA: it_lqua1 TYPE TABLE OF lqua WITH HEADER LINE.

DATA: wa_tmp_lqua TYPE lqua.

CONSTANTS: c_x TYPE char1 VALUE 'X',

c_t TYPE char1 VALUE 'Q'.

----


*Selection Screen

----


SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS:P_HLDR TYPE lqua-Z_HLDREF1.

SELECT-OPTIONS:s_matnr FOR mara-matnr,

s_date FOR sy-datum DEFAULT sy-datum,

s_mfgt FOR sy-uzeit DEFAULT sy-uzeit,

s_CHARG FOR lqua-CHARG.

SELECTION-SCREEN END OF BLOCK blk1.

START-OF-SELECTION.

Select * from LQUA

into table IT_LQUA1

where MATNR in S_MATNR

and BDATU in S_DATE

and Z_MFGTIM in S_MFGT

AND CHARG IN S_CHARG.

After Debuging Above Query I am Getting SY-SUBRC = 4.

Same data is availabe In LQUA Table For Selection Criteria..

Please help me if anyone has worked on WM LQUA Table

4 REPLIES 4
Read only

Former Member
0 Likes
961

Hi

as per your code you are mentioning S_DATE and S_MFGT which is system date and username.

i beleive you do not have data for this user name and this date in your table LQUA. that why you are getting sy-subrc = 4

because all this is in the where condition with AND operator. So all the conditions should be matched otherwise you will not find any data.

so check your table once again for the given values, like your system date and the current user name.

Thanks

Lalit Gupta

Read only

0 Likes
961

Hi lalit ,

Thanks for the reply, but I am changing SY-UZIT and SY-DATUM On screen as per the table, And Problem is by Field CHARG,

Because of that i am getting SY-SUBRC = 4.

Read only

0 Likes
961

Hello

Try to pass charg into select-options with leading zeros.

Read only

former_member659396
Participant
0 Likes
961

thank you