‎2007 Jan 05 10:39 PM
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.
‎2007 Jan 05 10:43 PM
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
‎2007 Jan 05 10:46 PM
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
‎2007 Jan 05 10:55 PM
i just left all the input fields blank . It has to retrieve all the records.
‎2007 Jan 05 11:06 PM
i just left all the input fields blank . It has to retrieve all the records.
‎2007 Jan 05 11:09 PM
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
‎2007 Jan 05 11:17 PM
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
‎2007 Jan 05 11:32 PM
Hi,
How is your problem solved??Please let us know..
Thanks,
Naren