Skip to Content
0
Former Member
Aug 08, 2013 at 09:26 PM

BAPI_GOODSMVT_CREATE for subcontracting PO

1756 Views

Dear all,

Please help with such issue. My task is to create GR against PO subcontracting , problem is when document is created at line with movement type 543 serial numbers and batch not assigned why it is so maybe there is mistake in code?

goodsmvt_item-line_id = 1.

goodsmvt_item-po_number = v_ebeln.

goodsmvt_item-po_item = i_item-item_line-posex.

goodsmvt_item-material = i_ekpo-matnr.

goodsmvt_item-plant = i_ekpo-werks.

goodsmvt_item-stge_loc = i_ekpo-lgort.

goodsmvt_item-move_type = '101.

goodsmvt_item-mvt_ind = 'B'.

goodsmvt_item-entry_qnt = 1.

goodsmvt_item-entry_uom_iso = 'EA'.

goodsmvt_item-vendrbatch = '5555'.

APPEND goodsmvt_item TO t_goodsmvt_item.

goodsmvt_serialnumber-matdoc_itm = 1.

goodsmvt_serialnumber-serialno = serial.

APPEND goodsmvt_serialnumber TO t_goodsmvt_serialnumber.

goodsmvt_item-parent_id = 1.

goodsmvt_item-line_id = 2.

goodsmvt_item-move_type = '543'.

CLEAR: goodsmvt_item-entry_qnt, goodsmvt_item-entry_uom, goodsmvt_item-mvt_ind,

goodsmvt_item-po_number, goodsmvt_item-po_item, goodsmvt_item-vendrbatch.

goodsmvt_item-material = i_ekpo-matnr.

goodsmvt_item-plant = i_ekpo-werks.

goodsmvt_item-stge_loc = i_ekpo-lgort.

goodsmvt_item-batch = '100071'

APPEND goodsmvt_item TO t_goodsmvt_item.

goodsmvt_serialnumber-matdoc_itm = 2.

goodsmvt_serialnumber-serialno = serial2.

APPEND goodsmvt_serialnumber TO t_goodsmvt_serialnumber.