2006 Jun 21 9:45 PM
We are currently using a BDC session to post our Goods Receipt, by calling the transaction MB01.
What are all the PROS and cons of using the BDC session?
Whether I can go for a BAPI for the above scenario?
Thanks.
2006 Jun 21 10:00 PM
Rohini,
if the inbound delivery is relevant for goods movement, you cannot use BAPI_GOODSMVT_CREATE to do the goods receipt. You have to post the goods receipt via the delivery. To do so you have the option use transactions VL32N or VL06IG, or you use idoc DELVRY03 (message type WHSCON) to post the goods receipt. I know now BAPI to do just the goods receipt for an inbound delivery.
Try
BAPI_ACC_GOODS_MOVEMENT_POST OR
SD_SHIPMENT_POST_GOODS_ISSUE OR
MB_POST_GOODS_MOVEMENT OR
to post a goods receipt.
To change the status use the FM STATUS_CHANGE_EXTERN.
Hope this helps...
Regards,
Naveen
We are currently using a BDC session to post our Goods Receipt, by calling the transaction MB01.
What are all the PROS and cons of using the BDC session?
Whether I can go for a BAPI for the above scenario?
Thanks.
2006 Jun 21 9:51 PM
You can go to BAPI <b>BAPI_GOODSMVT_CREATE</b> for this.
This piece of code may be helpful.
* 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 551 movement to table
clear gm_item.
move '551' to gm_item-move_type .
move '000000000040001234' 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 '4000' to gm_item-stge_loc.
move '201' to gm_item-move_reas.
* Determine cost center per plant
case xresb-werks.
when '0004'.
move '0000041430' to gm_item-costcenter.
when '0006'.
move '0000041630' to gm_item-costcenter.
when '0007'.
move '0000041731' to gm_item-costcenter.
when '0008'.
move '0000041830' to gm_item-costcenter.
endcase.
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'.Thanks )
Message was edited by: Naren Somen
2006 Jun 21 10:00 PM
Rohini,
if the inbound delivery is relevant for goods movement, you cannot use BAPI_GOODSMVT_CREATE to do the goods receipt. You have to post the goods receipt via the delivery. To do so you have the option use transactions VL32N or VL06IG, or you use idoc DELVRY03 (message type WHSCON) to post the goods receipt. I know now BAPI to do just the goods receipt for an inbound delivery.
Try
BAPI_ACC_GOODS_MOVEMENT_POST OR
SD_SHIPMENT_POST_GOODS_ISSUE OR
MB_POST_GOODS_MOVEMENT OR
to post a goods receipt.
To change the status use the FM STATUS_CHANGE_EXTERN.
Hope this helps...
Regards,
Naveen
2006 Jun 21 10:21 PM
Well, the pro is that it works. If you don't need to change it...
On the other hand, SAP says (note 304122) that MB01 will probably be removed after 4.7...
Rob