2007 Oct 18 6:32 AM
Hi,
I have fetched the records of Tables vbak, vbap vbrk, vbrp , vbpa, vbkd into an internal table by joining these tables.
Now i have to fetch the records from table KONV (primary keys are KNUMV, KPOSN, STUNR and ZAEHK ) based on the condition:
KONV-KNUMV = VBAK-KNUMV
KONV-KPOSN = VBAP-POSNR
Since KONV is a cluster table I can't use joins.
Is there any way I can fetch the corresponding records from the table KONV based on the above condition.
Thanks & Regards,
Soumya.
2007 Oct 18 6:36 AM
you can fetch VBAK-KNUMV & VBAP-POSNR in some itab...
and for KONV give condition of FOR ALL ENTRIES...
2007 Oct 18 6:38 AM
Hi,
You can use FOR ALL ENTRIES..
Ex..
SELECT * FROM VBAP
INTO TABLE T_VBAP
WHERE VBELN = 'TESSD'.
IF NOT T_VBAP[] IS INITIAL.
SELECT * FROM KONV
INTO TABLE T_KONV
FOR ALL ENTRIES IN T_VBAP
WHERE KNUMV = T_VBAP-KNUMV
AND KPOSN = T_VBAP-POSNR.
ENDIF.
Thanks
Naren
2007 Oct 18 6:39 AM
Use all entries like this :
ITAB contains records from VBAK and VBAP.
select kschl kbetr kwert from konv into i_konv for all entries of itab where
knumv eq itab-knumv and
kposn eq itab-posnr.
loop at itab.
read table i_konv with key knumv = itab-knumv
kposn = itab-posnr.
if sy-subrc = 0.
itab-kschl = i_konv-kschl.
itab-kwert = i_konv-kwert.
modify itab.
endif.
endloop.
reward if useful.
Amit Singla