01-27-2010 9:03 AM
hi,
in my select statement giving sy-subrc = 4.
please tell me why? i am fetchind data from a view.
Types:begin of zv_mast_stko,
matnr type zv_mast_stko-matnr,
werks type zv_mast_stko-werks,
stlal type zv_mast_stko-stlal,
end of zv_mast_stko.
data:gt_mast type table of zv_mast_stko,
gs_mast LIKE LINE OF gt_mast.
INITIALIZATION.
gv_repid = sy-repid. "report id
r_lkenz-sign = 'I'.
r_lkenz-option = 'NE'.
r_lkenz-low = 'X'.
APPEND r_lkenz.
clear r_lkenz.
SELECT matnr
werks
STLAL
FROM zv_mast_stko
INTO TABLE gt_mast
WHERE matnr IN so_matnr
AND werks in so_werks
AND stlal EQ po_stlal
AND stlst EQ po_stlst
and lkenz IN r_lkenz.
01-27-2010 9:21 AM
Hi,
It means that the data was not selected.
Do you have any data matching your selection criteria?
For a parameter if nothing is passed then it will compare with blank.
So if the parameters po_stlal and po_stlst do not have any value on the selection screen then they would be compared with blank.
So check the same.
Regards,
Ankur Parab
01-27-2010 9:07 AM
Please check your Ztable whether in Select as well as in where condition same name exists.
Probelm occurs due to field mismatch.
Regards
Arbind
01-27-2010 9:09 AM
Hello,
Looking at you select query it seems as if you are using parameters from a selection screen. Now your select query is written in the initialization event, that means it is being triggered before the user inputs anything on the selection screen.
Before your select query write the statement start-of-selection, to ensure that your select statement is being triggered after the selection screen is input.
start -of-selection.
SELECT matnr
werks
STLAL
FROM zv_mast_stko
INTO TABLE gt_mast
WHERE matnr IN so_matnr
AND werks in so_werks
AND stlal EQ po_stlal
AND stlst EQ po_stlst
and lkenz IN r_lkenz.
Hope this helps.
Regards,
Sachin
01-27-2010 9:10 AM
Hello
sy-subrc = 4 - it mean that entries not found for given conditions.
01-27-2010 9:10 AM
hI,
Data is not found in the database table and returns subrc value = 4.
go to se11
enter the table name ZV_MAST_STKO and see if the data is available for your where condition values.
data willnot be available for your select with where condition/
regards,
Nz
01-27-2010 9:12 AM
Before select Query Use eventAt-Selection-Screen
One more thing do check the same input values in the table to see if any record exists or not.
Manas M.
01-27-2010 9:17 AM
Hi ,
Please try this code - -
r_lkenz-sign = 'E'. " Instead 'I' use 'E'
r_lkenz-option = 'EQ'. " Instead 'NE' use 'EQ'
r_lkenz-low = 'X'.
APPEND r_lkenz.
clear r_lkenz.
Regards
Pinaki
01-27-2010 9:20 AM
Hi,
it is because a result set is empty (no data was found in the database). You should use event START-OF-SELECTION or END-OF-SELECTION instead of INITIALIZATION.
Regards,
Adrian
01-27-2010 9:21 AM
Hi,
It means that the data was not selected.
Do you have any data matching your selection criteria?
For a parameter if nothing is passed then it will compare with blank.
So if the parameters po_stlal and po_stlst do not have any value on the selection screen then they would be compared with blank.
So check the same.
Regards,
Ankur Parab