04-15-2014 8:40 AM
Hi,
Getting error while joing 3 internal tables
START-OF-SELECTION.
SELECT belnr
vbeln
fkdat
netwr
bukrs from vbrk
INTO TABLE it_vbrk
* where bukrs in p_bukrs
where vbeln in s_vbeln
and gjahr in s_gjahr
and fkdat in s_fkdat.
IF it_vbrk[] is INITIAL.
SELECT vbeln
volum
* vloeh
matnr
arktx from vbrp
INTO TABLE it_vbrp
FOR ALL ENTRIES IN it_vbrk
where vbeln = it_vbrk-vbeln.
SELECT belnr
bschl
hkont from bseg
FOR ALL ENTRIES IN it_vbrk
WHERE belnr = it_vbrk-belnr.
ENDIF.
04-15-2014 9:11 AM
Regards,
Raymond
04-15-2014 8:47 AM
Try correcting the logic, so that it returns the expected result.
Thomas
04-15-2014 8:52 AM
Hello Meenakshi,
I guess the code should be IF it_vbrk[] IS NOT INITIAL(Just before the 2nd SELECT statement).
And also you forgot to get the data into an internal table in the 3rd SELECT statement.
Regards,
Anubhab
04-15-2014 8:54 AM
Hi,
1.first check your field sequence, the fields in the DB table and in
select query should be same.
2. check the where clause, try to use the indexes and also maintain sequences.
3. when using for all entries check ,whether ur driver table is empty or not.
eg: if it_vbrk is not initial.
delete adjacent duplicates from it_vbrk.
now use for all entries.
endif.
regards,
04-15-2014 8:59 AM
Anubhab is correct.. you should either use IF NOT it_vbrk[] IS INITIAL or IF it_vbrk[] IS NOT INITIAL.
You are trying to fetch data for empty it_vbrk
04-15-2014 9:11 AM
Regards,
Raymond
04-15-2014 12:47 PM