Application Development and Automation 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: 
Read only

BDC HELP

rahul2000
Contributor
0 Likes
1,004

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
981

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.

9 REPLIES 9
Read only

Former Member
0 Likes
980

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)

Read only

0 Likes
980

Dear

rajesh,

it throws an error saying You may not delete or overwrite table "IT_DATA" within a LOOP oveitself. -

any other option>?

Read only

0 Likes
980

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)

Read only

Former Member
0 Likes
980

Hi Rahul,

Whats happening to the other fields (werks...).

Did u check the internal table it_data ?

Warm Regards,

Will.

Read only

0 Likes
980

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

Read only

Former Member
0 Likes
982

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.

Read only

0 Likes
980

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?

Read only

0 Likes
980

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.

Read only

0 Likes
980

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?