10-26-2007 8:53 AM
<b>I want to create BDC for MM03 select views - Cost Estimate 2 for Planned price 3 and for FERT and plant G003 products only.</b>So my code is as follows:
In Planned price field i want net value from VAPMA (but latest Document date only) for that matnr and plant.
MY input is MATNR (in range).
*checking for FERT.
select * from mara into corresponding fields of table it_mara
where matnr in matnr
and mtart = 'FERT'.
If sy-subrc ne 0.
message e000(zp) with 'Enter Finished Product'.
endif.
*checking for Plant G003.
select * from marc into corresponding fields of table it_marc
for all entries in it_mara
where matnr = it_mara-matnr
and werks = 'G003'.
select * from vapma client specified into corresponding fields of table it_vapma
for all entries in it_marc
where mandt = sy-mandt
and matnr = it_marc-matnr
and werks = 'G003'.
*To get latest Document date for that matnr and plant
sort it_vapma descending by AUDAT.
delete adjacent duplicates from it_vapma comparing matnr.
select * from vbap client specified into corresponding fields of table it_vbap
for all entries in it_vapma
where mandt = sy-mandt
and VBELN = it_vapma-vbeln
and POSNR = it_vapma-POSNR
and PSTYV = 'TAN'.
<b>MY PROBLEM IS THAT IT WILL TAKE LOT OF TIME TO RUN THIS BDC IS THERE ANY FUNCTION MODULE OR ANY OTHER WAY TO DO THIS.</b>
Pls reply .......
(Rewards Points)......
Regards.
10-26-2007 9:03 AM
Hi,
Have you tried BAPI_MATERIAL_SAVEDATA.
Regards,
Atish