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 statement

Former Member
0 Likes
571

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.

5 REPLIES 5
Read only

Former Member
0 Likes
550

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.

Read only

Former Member
0 Likes
550

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.

Read only

Former Member
0 Likes
550

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

Read only

Former Member
0 Likes
550

hi,

Well dont use into corresponding field of table

into table.

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
550

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