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: 

MB1B Transacation

Former Member
0 Kudos
146

Helo Friends,

I have to develop a BDC for MB1B transction.

Can you one suggest me as how it can be done manually and which are the tables that would be updated, or any links that would talk more about MB1B.

Shejal.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos
91

Hi,

Please check this link perhaps it may help.

http://www.saptechies.com/category/material-management/purchase-order/page/3/

For the tables, it will update MSEG and MKPF.

Also check include program MM07MTOP.

Regards,

Ferry Lianto

10 REPLIES 10

former_member181962
Active Contributor
0 Kudos
91

Hi Shejal,

Read this links:

http://www.copacustomhelp.state.pa.us/infopak/content/prim__mb1b_tranpostingmatr/cc/html/index.htm

http://www.ies.state.pa.us/imaginepa/cwp/view.asp?a=4&Q=197655&PM=1

Coming to doing a bdc, i would rather suggest you to go for BAPI: BAPI_GOODSMVT_CREATE.

Read the documentation in se37 transaction to know how to use it.

Regards,

ravi

Message was edited by: Ravi Kanth Talagana

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
91

Hi, the tables updated would be MKPF, and MSEG. You should use the BAPI instead of BDC. Here is an example of using this BAPI for another requirement. IN this case it is doing a different movement type.



report zrich_0001.


* Structures for BAPI
data: gm_header  type bapi2017_gm_head_01.
data: gm_code    type bapi2017_gm_code.
data: gm_headret type bapi2017_gm_head_ret.
data: gm_item    type table of
                 bapi2017_gm_item_create with header line.
data: gm_return  type bapiret2 occurs 0 with header line.
data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.

clear: gm_return, gm_retmtd. refresh gm_return.

* Setup BAPI header data.
gm_header-pstng_date = sy-datum.
gm_header-doc_date   = sy-datum.
gm_code-gm_code      = '06'.                                " MB11

* Write 971 movement to table
clear gm_item.
move '971'                 to gm_item-move_type     .
move '000000000040000100'  to gm_item-material.
move '1'     to gm_item-entry_qnt.
move 'EA'    to gm_item-entry_uom.
move '0004'  to gm_item-plant.
move '4999'  to gm_item-stge_loc.
move '0901'   to gm_item-move_reas.


append gm_item.

* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
     exporting
          goodsmvt_header  = gm_header
          goodsmvt_code    = gm_code
     importing
          goodsmvt_headret = gm_headret
          materialdocument = gm_retmtd
     tables
          goodsmvt_item    = gm_item
          return           = gm_return.

if not gm_retmtd is initial.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
else.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
endif.

write:/ gm_retmtd.

loop at gm_return.
  write:/ gm_return.
endloop.

Regards,

Rich HEilman

Former Member
0 Kudos
91

Hi Shejal,

try Tcode SHDB with MB1B and than generate a Programm.

This you have to update.

Regards, Dieter

ferry_lianto
Active Contributor
0 Kudos
92

Hi,

Please check this link perhaps it may help.

http://www.saptechies.com/category/material-management/purchase-order/page/3/

For the tables, it will update MSEG and MKPF.

Also check include program MM07MTOP.

Regards,

Ferry Lianto

0 Kudos
91

Thanks Everyone.

Shejal.

0 Kudos
91

I am using Movement Type 343, 334, 943, 944.

Any suggesstions of which BAPI i should I use.

Shejal.

0 Kudos
91

Shejal, You still use the same BAPI regardless of what movement type that you are using as you can see in the examples above.

'BAPI_GOODSMVT_CREATE'

Regards,

Rich Heilman

0 Kudos
91

Hi everybody...

I have a similar problem, I have to do a movement type 413 on MB1B transaction.

First of all I was trying using a call transaction, but unfortunately on the third screen comes a initial error message and it brakes the call transaction.

So I decide to do with the bapi: 'BAPI_GOODSMVT_CREATE'.

Does anybody can help me how to do it ?

Thanks very much in advance....

Rafael Medina

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
91

I found another example which does a transfer posting using Movement type 301. This may be a better example.



* Structures for BAPI
  data: gm_header  type bapi2017_gm_head_01.
  data: gm_code    type bapi2017_gm_code.
  data: gm_headret type bapi2017_gm_head_ret.
  data: gm_item    type table of
                   bapi2017_gm_item_create with header line.
  data: gm_return  type bapiret2 occurs 0.
  data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.

  clear: gm_return, gm_retmtd. refresh gm_return.

* Setup BAPI header data.
  gm_header-pstng_date    = sy-datum.
  gm_header-doc_date      = sy-datum.
  gm_code-gm_code         = '06'.        " MB11

* Write 301 movement to table
  clear gm_item.
  gm_item-move_type       = '301'.
  gm_item-material        = '000000000040001000'.
  gm_item-entry_qnt       = '1'.
  gm_item-plant           = '0004'.
  gm_item-move_plant      = '0006'.

  gm_item-stge_loc   = '4001'.
  gm_item-move_stloc = '6001'.
  append gm_item.

* Call goods movement BAPI
  call function 'BAPI_GOODSMVT_CREATE'
       exporting
            goodsmvt_header  = gm_header
            goodsmvt_code    = gm_code
       importing
            goodsmvt_headret = gm_headret
            materialdocument = gm_retmtd
       tables
            goodsmvt_item    = gm_item
            return           = gm_return.

*    call function 'BAPI_TRANSACTION_COMMIT'
*       exporting
*            wait = 'X'.

  if not gm_retmtd is initial.
    commit work and wait.
    call function 'DEQUEUE_ALL'.
  else.
    commit work and wait.
    call function 'DEQUEUE_ALL'.
  endif.

Regards,

Rich Heilman

ferry_lianto
Active Contributor
0 Kudos
91

Hi,

You can use BAPI BAPI_GOODSMVT_CREATE as suggested by others.

Please check this link for sample codes.

http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm

Also you can use FM MB_CREATE_GOODS_MOVEMENT.

Regards,

Ferry Lianto