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: 

How to join VBAK, VBAP with MARC materials flaged for deletion

Former Member
0 Kudos

Hi,

Iam have to extract only sales orders with materials which are not flagged for deletion.

In MARC table, I have to use LVORM field to restrict materials which are not flagged for deletion. Can anybosy explain in this regard and combine with VBAP and VBAK tables.

Thanks.

1 ACCEPTED SOLUTION

vinod_vemuru2
Active Contributor
0 Kudos

Hi Raju,

Check below code,

SELECT f1 f2... INTO TABLE i_mara

FROM mara

WHERE ur conditions from selection screen if any

AND lvorm EQ space.

CHECK NOT i_mara[] IS INITIAL.

SORT i_mara BY matnr.

SELECT avbeln a.... bposnr b...

INTO TABLE i_salesdata

FROM vbak AS a INNER JOIN vbap AS b

ON avbeln EQ bvbeln

FOR ALL ENTRIES IN i_mara

WHERE ur conditions from selection screen if any

AND b~matnr EQ i_mara-matnr.

CHECK NOT i_salesdata IS INITIAL.

SORT i_salesdata BY vben.

Hope u got the sulution for ur problem.

Thanks,

Vinod.

1 REPLY 1

vinod_vemuru2
Active Contributor
0 Kudos

Hi Raju,

Check below code,

SELECT f1 f2... INTO TABLE i_mara

FROM mara

WHERE ur conditions from selection screen if any

AND lvorm EQ space.

CHECK NOT i_mara[] IS INITIAL.

SORT i_mara BY matnr.

SELECT avbeln a.... bposnr b...

INTO TABLE i_salesdata

FROM vbak AS a INNER JOIN vbap AS b

ON avbeln EQ bvbeln

FOR ALL ENTRIES IN i_mara

WHERE ur conditions from selection screen if any

AND b~matnr EQ i_mara-matnr.

CHECK NOT i_salesdata IS INITIAL.

SORT i_salesdata BY vben.

Hope u got the sulution for ur problem.

Thanks,

Vinod.