‎2007 Feb 26 6:20 AM
hi all,
this select statement unable to get any data. any select syntax issue? no compilation error.
thanks
SELECT DISTINCT maraspart ztabwerks mbewbklas ztablgtyp
ztabdldat ztablgpla
INTO CORRESPONDING FIELDS OF TABLE ltab
FROM ztab
INNER JOIN mbew ON mbewmatnr = ztabmatnr AND
mbewbwkey = ztabwerks
INNER JOIN mara ON maramatnr = ztabmatnr
WHERE ztab~werks IN so_werks AND
ztab~dldat IN so_dldat AND
ztab~lgtyp IN so_lgtyp AND
ztab~lgnum IN so_lgnum AND
ztab~lgpla IN so_lgpla AND
mbew~bklas IN so_bklas AND
mbew~bwtar = p_bwtar.
‎2007 Feb 26 6:25 AM
Might be its not meeting the seletion criteria...
first have a look into the data in Datasbase tables through se16 for that perticular criteria....
If u r getting the data for that seletion criteria... can have llok into this select statement again.
Regards,
Sujatha.
‎2007 Feb 26 6:32 AM
Use n the order mara, mbew and then ZTAB
SELECT DISTINCT mara~spart mbew~bklas ztab~werks ztab~lgtyp
ztab~dldat ztab~lgpla
INTO CORRESPONDING FIELDS OF TABLE ltab
FROM mara
INNER JOIN mbew ON mara~matnr = mbew~matnr
INNER JOIN ztab ON ztab~matnr = mara~matnr
WHERE ztab~werks IN so_werks AND
ztab~dldat IN so_dldat AND
ztab~lgtyp IN so_lgtyp AND
ztab~lgnum IN so_lgnum AND
ztab~lgpla IN so_lgpla AND
mbew~bklas IN so_bklas AND
mbew~bwtar = p_bwtar.
Make sure taht u have used all teh key fields in WHERE condioton for checking.
CHeck whetehr the tabel has entries. take vales from mara and teh pass it to mbew and then to ztab and check the tabel entries.
‎2007 Feb 26 6:35 AM
i think select query is correct just check whether data are present there or not for your select query and where condition you have specified and give the data in p_bwtar because it is parameter you must have to specify value here.
regards
shiba dutta
‎2007 Feb 26 7:43 AM
‎2007 Feb 26 7:55 AM
Hi
First check in the tables whether data is avialble or not with the specified criteria.
Check for sy-subrc value after select statement.
Regards,
kumar