Application Development 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: 

Enter Good Movement - MB11 Batch Input or BAPI ??

Former Member
0 Kudos

HI,

I need to mass migrate stocks using MB11.

is there any BAPI for creating Good Movement?

I am planning to USE LSMW batch input.

I am looking for other alternatives like BAPI's.

if anyone worked on it, pls let me know.

I promise to reward the replies

thanks

Martin

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, there is a BAPI. BAPI_GOODSMVT_CREATE.

Regards,

Rich Heilman

5 REPLIES 5

Former Member
0 Kudos

Martin,

Did you look into this BAPI - BAPI_GOODSMVT_CREATE?

Regards,

Ravi

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, there is a BAPI. BAPI_GOODSMVT_CREATE.

Regards,

Rich Heilman

0 Kudos

Here is a sample of the coding....



* Structures for BAPI
data: gdsmt_header   like bapi2017_gm_head_01.
data: gdsmt_code like bapi2017_gm_code.
data: gdsmt_headret like bapi2017_gm_head_ret.
data: gdsmt_item like bapi2017_gm_item_create occurs 1 with header line.
data: return like bapiret2 occurs 0.
data: retmatdoc like bapi2017_gm_head_ret-mat_doc.


* 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.

* Determine cost center 
    move '0000041430' to gdsmt_item-costcenter.

  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.


Regards,

Rich Heilman

Former Member
0 Kudos

hi,

con you try BAPI_GOODSMVT_CREATE

bye

enzo

Former Member
0 Kudos

Thanks Rich

I got it.

Message was edited by: Martin