cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use BDC for MIGO?? Why can't we use it??

Simha_
Employee
Employee
0 Kudos

Hi All,

I have a doubt regarding MIGO tarnsaction.

why cant we use BDC for MIGO.

what is the other solution??

Regards,

Simha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hai Narasimha Rao,

You are not supposed to use BDC for MIGO. Please see OSS Note #381630. Look for a BAPI instead.

You really don't want to do a BDC over the MIGO transaction. Reason for this is because MIGO uses a lot of frontend gui controls. You should use MB11 or the BAPI BAPI_GOODSMVT_CREATE.

clear: return, retmatdoc. refresh return.

  • Setup BAPI header data.

gdsmt_header-pstng_date = sy-datum.

gdsmt_header-doc_date = sy-datum.

gdsmt_code-gm_code = '06'. " MB11

  • Write 262 movement to table.

clear gdsmt_item.

move '262' to gdsmt_item-move_type .

move i_resb-matnr to gdsmt_item-material.

move p_bdmng to gdsmt_item-entry_qnt.

move i_resb-meins to gdsmt_item-entry_uom.

move i_resb-werks to gdsmt_item-plant.

move i_resb-lgort to gdsmt_item-stge_loc.

move i_afko-aufnr to gdsmt_item-orderid.

append gdsmt_item.

  • Write 551 movement to table

clear gdsmt_item.

move '551' to gdsmt_item-move_type .

move i_resb-matnr to gdsmt_item-material.

move p_bdmng to gdsmt_item-entry_qnt.

move i_resb-meins to gdsmt_item-entry_uom.

move i_resb-werks to gdsmt_item-plant.

move i_resb-lgort to gdsmt_item-stge_loc.

move p_grund to gdsmt_item-move_reas.

  • Determine cost center per plant

if i_resb-werks = '0004'.

move '0000041430' to gdsmt_item-costcenter.

elseif i_resb-werks = '0006'.

move '0000041630' to gdsmt_item-costcenter.

elseif i_resb-werks = '0007'.

move '0000041730' to gdsmt_item-costcenter.

elseif i_resb-werks = '0008'.

move '0000041830' to gdsmt_item-costcenter.

endif.

append gdsmt_item.

  • Call goods movement BAPI

call function 'BAPI_GOODSMVT_CREATE'

exporting

goodsmvt_header = gdsmt_header

goodsmvt_code = gdsmt_code

importing

goodsmvt_headret = gdsmt_headret

materialdocument = retmatdoc

tables

goodsmvt_item = gdsmt_item

return = return.

if not retmatdoc is initial.

wait up to 5 seconds.

commit work and wait.

call function 'DEQUEUE_ALL'.

else.

commit work and wait.

call function 'DEQUEUE_ALL'.

message i013.

endif.

Regards,

Srikanth.

Reward points if helpful.

Answers (4)

Answers (4)

Former Member
0 Kudos

Always the BAPI is the best way to load data however if you need to use the screen approach you can use ECATT tool.

You can create a script for the ECATT and execute the same by providing a test file and it will create the goods mvmt docs.

Former Member
0 Kudos

Hi narasimha,

1. why cant we use BDC for MIGO.

Enjoy transactions have complex controls

(like grid, tree control)

which use classes.

The value in such controls cannot be assigned

directly thru bdc.

Hence, we cannot use them.

2. For such problems,

sap recommends BAPI which have been

specially made for MIGO, etc,

and other transactions !

regards,

amit m.

ferry_lianto
Active Contributor
0 Kudos

Hi Narasimha,

You can NOT build BDC solution to call transaction MIGO (Enjoy SAP transasction). It will never work properly.

You can call transaction <b>MB11 (Goods Movement)</b> instead.

Other solution, you can use BAPI <b>BAPI_GOODSMVT_CREATE.</b>

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

MIGO is a enjoy SAP transaction so it is not possible to use BDC. Why don't you use BAPI for the same?

(Use BAPI_GOODSMVT_CREATE instead.)

Message was edited by: Ashish Gundawar