Application Development 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: 

Join

soumya_jose3
Active Contributor
0 Kudos
81

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.

3 REPLIES 3

Former Member
0 Kudos
45

you can fetch VBAK-KNUMV & VBAP-POSNR in some itab...

and for KONV give condition of FOR ALL ENTRIES...

Former Member
0 Kudos
45

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

Former Member
0 Kudos
45

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