‎2007 Dec 29 10:38 AM
Dear all,
i am doing the following BDC.Even though i am looping,the same material comes repetedly.
if there are 3 materials,only the first material comes.
i am not understanding this...what can i do?
LOOP AT IT_DATA.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
*perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
IT_DATA-MATNR.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
*perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(08)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
*perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
IT_DATA-WERKS.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'MAKT-MAKTX'
'Hydraulic sleeve hose set'.
*perform bdc_field using 'BDC_CURSOR'
'MARC-EKGRP'.
*perform bdc_field using 'MARA-MEINS'
'EA'.
perform bdc_field using 'MARC-EKGRP'
'BD1'.
*perform bdc_field using 'MARA-MATKL'
'ASSET'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'MAKT-MAKTX'
'Hydraulic sleeve hose set'.
*perform bdc_field using 'MARA-MEINS'
'EA'.
perform bdc_field using 'MARC-EKGRP'
IT_DATA-EKGRP.
*perform bdc_field using 'BDC_CURSOR'
'MARC-DISPO'.
*perform bdc_field using 'MARC-DISMM'
'PD'.
perform bdc_field using 'MARC-DISPO'
IT_DATA-DISPO.
*perform bdc_field using 'MARC-DISLS'
'EX'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
*perform bdc_field using 'MAKT-MAKTX'
'Hydraulic sleeve hose set'.
*perform bdc_field using 'MARC-BESKZ'
'X'.
perform bdc_field using 'MARC-DZEIT'
IT_DATA-DZEIT.
perform bdc_field using 'MARC-PLIFZ'
IT_DATA-PLIFZ.
*perform bdc_field using 'MARC-FHORI'
'000'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
*perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
*perform bdc_field using 'MAKT-MAKTX'
'Hydraulic sleeve hose set'.
*perform bdc_field using 'MARC-PERKZ'
'M'.
perform bdc_field using 'MARC-STRGR'
IT_DATA-STRGR.
*perform bdc_field using 'MARC-MTVFP'
'01'.
perform bdc_transaction using 'MM02'.
clear it_data.
ENDLOOP.
‎2007 Dec 29 10:58 AM
hi Rahul,
try this,
Hope it ll serve ur pupouse.
after immediate loop starting. write the code " Refresh BDCDATA.
like
( LOOP AT IT_DATA.
refresh bdcdata. "------> just copy paste this line in the program.
.
;
.
endloop.)
Regards
Naveen.
‎2007 Dec 29 10:47 AM
perform bdc_transaction using 'MM02'.
REFRESH it_data.
clear it_data.
ENDLOOP.
try to REFRESH the internal table after the CALL TRANSACTION... statement. (Assuming that it_data is an internal table with header line)
‎2007 Dec 29 10:56 AM
Dear
rajesh,
it throws an error saying You may not delete or overwrite table "IT_DATA" within a LOOP oveitself. -
any other option>?
‎2007 Dec 29 11:02 AM
Hi Rahul,
my mistake, I meant to ask you to refresh bdcdata table as suggested by Naveen.
CALL TRANSACTION 'MM02' USING bdcdta OPTIONS...
REFRESH bdcdata.
(Assuming that you are using CALL TRANSACTION... approach)
‎2007 Dec 29 10:52 AM
Hi Rahul,
Whats happening to the other fields (werks...).
Did u check the internal table it_data ?
Warm Regards,
Will.
‎2007 Dec 29 10:55 AM
Dear Will,
even though in a loop,the same material comes again and again.
it_data is fine.
in form form bdc_field using FNAM FVAL.i can see the values,but still the first material comes.
werks is common for all materials.
plz help
‎2007 Dec 29 10:58 AM
hi Rahul,
try this,
Hope it ll serve ur pupouse.
after immediate loop starting. write the code " Refresh BDCDATA.
like
( LOOP AT IT_DATA.
refresh bdcdata. "------> just copy paste this line in the program.
.
;
.
endloop.)
Regards
Naveen.
‎2007 Dec 29 11:07 AM
Dear Naveen,
its working fine now,but there is one more problem
when i try to update plifz and dzeit it gives information message saying
field marc-plifz input value is longer than screen field and hence it does not update.
what can i do?
‎2007 Dec 29 11:21 AM
how did you declare the field plifz in the internal table? declare the field plifz in the internal table by referring the field marc-plifz.
‎2007 Dec 29 11:31 AM
i have done it in the same way.
One more problem is that the views in MM02 are in different order for every material.
i want views purchasing,mrp1 mrp2 and mrp3.
how to make them default for every material?