04-05-2008 4:44 PM
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.
04-05-2008 4:54 PM
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.
04-05-2008 4:54 PM
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.