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
838

select avbeln aerdat aerzet abstnk akunnr bposnr b~matnr

bkwmeng bkbmeng b~werks into corresponding fields of table itab1 from

vbak as a inner join vbap as b on avbeln = bvbeln where a~erdat in

erdat and abstnk in bstnk and akunnr in kunnr and b~matnr in matnr and

b~werks in werks . Can anyone tell whatz the error in this . Its not retrieving any data . I appreciate your response.

7 REPLIES 7
Read only

Former Member
0 Likes
787

The syntax looks good provided you have declared erdat, bstnk, kunnr, matnr and werks as select-options. If you are not getting data then there are no records in the table that satisfys the joining condition you have given.

- Guru

Reward points for helpful answers

Read only

Former Member
0 Likes
787

Hi,

The SQL looks good..Go to SE16..give table VBAK..Enter the creation date (ERDAT), BSTNK, KUNNR with the same values as you entered in the selection screen (I guess)..Then check if there is any entry for that combination..

If you find..take one sales document and go to the table VBAP..And check if the matnr and werks is the same as the one which you gave in the selection-screen.

Thanks,

Naren

Read only

0 Likes
787

i just left all the input fields blank . It has to retrieve all the records.

Read only

0 Likes
787

i just left all the input fields blank . It has to retrieve all the records.

Read only

Former Member
0 Likes
787

Hi,

I believe you are not getting any syntax error in the select statement..

Also check if you are running in the client which has data..Meaning..In the development client ..there will not be any data..

Thanks,

Naren

Read only

Former Member
0 Likes
787

Unfortunately it doesnt mean that. I'll explain what it is doing.

1. it is selecting all records from table VBAK which has a corresponding record in table VBAP based on the condition VBAK-VBELN = VBAP-VBELN.

If you find values in these table based on teh condition I mentioned then you need to see what are the default values stored in the select options erdat.......werks. I think these are having a value of '0' to '0'. This may be the problem. To eleminate this error declare the select-option referring to these fields only.

- Guru

Reward points for helpful answers

Read only

Former Member
0 Likes
787

Hi,

How is your problem solved??Please let us know..

Thanks,

Naren