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

uploading multiple material using BDC

Former Member
0 Likes
620

Hi Experts,

I have created BDC for transaction MB11.

Now in internal table for onr plant, if i have multile material, then in BDC , it creates one material document for each material. But req. is to creat one document for all material.

My code is as follow:

LOOP AT it_output INTO wa_output.

w_qty = wa_output-qty.

w_count = w_count + 1.

CONCATENATE 'MSEG-MATNR' '(' w_count ')' INTO w_var1.

CONCATENATE 'MSEG-ERFMG' '(' w_count ')' INTO w_var2.

CONCATENATE 'MSEG-CHARG' '(' w_count ')' INTO w_var3.

PERFORM bdc_field USING 'MKPF-BLDAT'

w_date_final."'18.03.2009'.

PERFORM bdc_field USING 'MKPF-BUDAT'

w_date_final."'18.03.2009'.

PERFORM bdc_field USING 'RM07M-BWARTWA'

'551'.

PERFORM bdc_field USING 'RM07M-WERKS'

wa_output-werks. "'1000'.

PERFORM bdc_field USING 'RM07M-LGORT'

wa_output-lgort." 'BSRB'.

PERFORM bdc_field USING w_var1 "'MSEG-MATNR(01)'

wa_output-matnr." 'PH-7001'.

PERFORM bdc_field USING w_var2 "'MSEG-ERFMG(01)'

w_qty. " '2'.

PERFORM bdc_field USING w_var3 "'MSEG-CHARG(01)'

wa_output-charg."'0000000391'.

PERFORM bdc_transaction USING 'MB11'.

ENDLOOP.

How to get this ??

Thanks & Regards,

Anagha Deshmukh

3 REPLIES 3
Read only

Former Member
0 Likes
532

Hello

Try to call transaction after loop/endloop:


LOOP AT it_output INTO wa_output.
.......
ENDLOOP.
PERFORM bdc_transaction USING 'MB11'.

Read only

Former Member
0 Likes
532

Hi,

Try this...

Separate plants and materials,split into two internal tables.

loop at itab into fs.(plant)

loop at material.

bdcsteps.

endloop.

bdcsteps.

call transaction .

endloop.

Read only

0 Likes
532

im also facing same issue..please Help...