2008 Oct 27 5:42 AM
hello all...
i have a select query...
select belnr awkey xblnr from bkpf into table i_bkpf1
for all entries in i_mseg
where awkey = i_mseg-awkey.
if sy-subrc = 0.
select VBELN belnr BUZID BSCHL hkont dmbtr SHKZG from bseg
into corresponding fields of table i_bseg1
for all entries in i_bkpf1
where belnr = i_bkpf1-belnr and bschl = '99'.
endif.
The 1st select query has only one record for belnr = '2607021464'.
The 2nd select query fetches only 30 records for the above belnr, well as if i check this in se16...there are 38 records....
can any one tell me were am i going wrong ???
hello all...
i have a select query...
select belnr awkey xblnr from bkpf into table i_bkpf1
for all entries in i_mseg
where awkey = i_mseg-awkey.
if sy-subrc = 0.
select VBELN belnr BUZID BSCHL hkont dmbtr SHKZG from bseg
into corresponding fields of table i_bseg1
for all entries in i_bkpf1
where belnr = i_bkpf1-belnr and bschl = '99'.
endif.
The 1st select query has only one record for belnr = '2607021464'.
The 2nd select query fetches only 30 records for the above belnr, well as if i check this in se16...there are 38 records....
can any one tell me were am i going wrong ???
2008 Oct 27 5:53 AM
Hello
Do not use construction for all entries.
In first query it select one record for one entry in i_mseg.
2008 Oct 27 6:01 AM
Hi,
In the second query avoid using for all entries in i_bkpf1.
use this statement only.
select VBELN belnr BUZID BSCHL hkont dmbtr SHKZG from bseg
into corresponding fields of table i_bseg1
where belnr = i_bkpf1-belnr and bschl = '99'.
I hope this way you will be able to fetch all the 38 records.
Thanx.
2008 Oct 27 8:23 AM
you need to mention all the key fileds in the select query.
select
bukrs
belnr
gjahr
buzei
vbeln
BUZID
BSCHL
hkont
dmbtr
SHKZG
from bseg
into corresponding fields of table i_bseg1
for all entries in i_bkpf1
where belnr = i_bkpf1-belnr and bschl = '99'.
2008 Oct 27 9:31 AM
Hi Poonam,
Hope the following Code will help you regarding your problem.
SELECT VBELN BELNR BUZID BSCHL HKONT DMBTR SHKZG
FROM bseg
into corresponding fields of table i_bseg1
where BELNR = i_bkpf1-belnr and bschl = '99'.
Thanks.
Nitesh
2008 Oct 27 9:54 AM
Hello,
You are filter the data on posting key (and bschl = '99'.). Try removing that from the where condition.
select VBELN belnr BUZID BSCHL hkont dmbtr SHKZG from bseg
into corresponding fields of table i_bseg1
for all entries in i_bkpf1
where belnr = i_bkpf1-belnr. " remove this and bschl = '99'.
regards,
Advait
Edited by: Advait Gode on Oct 27, 2008 10:55 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |