2012 Nov 20 6:05 PM
hello i'm facing some problems with the bapi BAPI_GOODSMVT_CREATE
with a material with serial number.
in the order i have a material with 10 serial numbers.
i'm calling the BAPI_GOODSMVT_CREATE
like this:
loop at it_zqu14_tabconflmi into wa_zqu14_tabconflmi.
* it_zqu14_tabconflmi3[] = it_zqu14_tabconflmi2[].
refresh: i_gm_serialnumber, i_goodsmvt_item.
*header
clear l_goodsmvt_header.
l_goodsmvt_header-pstng_date = sy-datum.
l_goodsmvt_header-doc_date = sy-datum.
l_goodsmvt_header-pr_uname = sy-uname.
* l_goodsmvt_header-gr_gi_slip_no = wa_zqu14_tabconflmi-bollacons.
*mvt_code
l_goodsmvt_code = '04'.
*pos
clear i_goodsmvt_item.
*material
i_goodsmvt_item-material = wa_zqu14_tabconflmi-codeart.
*plant
i_goodsmvt_item-plant = '1000'.
loop at it_zqu14_tabconflmi2 into wa_zqu14_tabconflmi2
where codeart = wa_zqu14_tabconflmi-codeart
and testolib1 = wa_zqu14_tabconflmi-testolib1.
i_goodsmvt_item-batch = wa_zqu14_tabconflmi2-testolib1.
*storage location
select single lgort from mseg into v_lgort
where mblnr = wa_zqu14_tabconflmi2-testolib6
and mjahr = wa_zqu14_tabconflmi2-mjahr
and zeile = wa_zqu14_tabconflmi2-zeile.
i_goodsmvt_item-stge_loc = v_lgort.
i_goodsmvt_item-vendor = wa_zqu14_tabconflmi2-codforn.
i_goodsmvt_item-move_type = '321'.
i_goodsmvt_item-po_number = wa_zqu14_tabconflmi2-testolib3.
i_goodsmvt_item-po_item = wa_zqu14_tabconflmi2-testolib4.
i_goodsmvt_item-entry_qnt = wa_zqu14_tabconflmi2-qtacons.
* i_goodsmvt_item-entry_uom = 'ST'.
if wa_zqu14_tabconflmi2-testolib5 <> ' '.
i_goodsmvt_item-spec_stock = 'E'.
i_goodsmvt_item-sales_ord = wa_zqu14_tabconflmi2-testolib5.
i_goodsmvt_item-s_ord_item = wa_zqu14_tabconflmi2-kdpos.
i_goodsmvt_item-val_sales_ord = wa_zqu14_tabconflmi2-testolib5.
i_goodsmvt_item-val_s_ord_item = wa_zqu14_tabconflmi2-kdpos.
endif.
i_gm_serialnumber-serialno = wa_zqu14_tabconflmi2-testolib2.
i_gm_serialnumber-matdoc_itm = wa_zqu14_tabconflmi2-zeile. "zeile"
append i_gm_serialnumber.
append i_goodsmvt_item.
endloop.
i'm feeling i_gm_serialnumber with all the serial number and considering each serial number like an item
but when i call the bapi
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = l_goodsmvt_header
goodsmvt_code = l_goodsmvt_code
importing
goodsmvt_headret = l_goodsmvt_headret
materialdocument = l_materialdocument
matdocumentyear = l_matdocumentyear
tables
goodsmvt_item = i_goodsmvt_item
goodsmvt_serialnumber = i_gm_serialnumber
return = i_return.
i have an error message:
ID: IO No.: 212 (select only one serial number instead of 10)
then for all the others items the message ID: M7 No.: 175
what do i miss?
i tried to call the bapi n times for each serial number but after that the first item i had been moved, for the next items i always have the message 😧 M7 No.: 022 and i guess it's normal because the batch has been already moved with the fitrst call.
I also found a sap note 1278707 bapi good movements and implemented it , but i still have the issue.
Any clue?
Thanx .
2012 Nov 22 12:07 PM
Hi Ebongue,
In BAPI_GOODSMVT_CREATE, the serial number has to be given only once. The system calculates the further serial numbers and puts against the material automatically. The serial number which you give, has to the last serial number of that number range that is used. It should not be the next number of that serial number range. This would be calculated and taken by system automatically during their BDC session (from BAPI)
Regards,
Hardik Mehta
hello i'm facing some problems with the bapi BAPI_GOODSMVT_CREATE
with a material with serial number.
in the order i have a material with 10 serial numbers.
i'm calling the BAPI_GOODSMVT_CREATE
like this:
loop at it_zqu14_tabconflmi into wa_zqu14_tabconflmi.
* it_zqu14_tabconflmi3[] = it_zqu14_tabconflmi2[].
refresh: i_gm_serialnumber, i_goodsmvt_item.
*header
clear l_goodsmvt_header.
l_goodsmvt_header-pstng_date = sy-datum.
l_goodsmvt_header-doc_date = sy-datum.
l_goodsmvt_header-pr_uname = sy-uname.
* l_goodsmvt_header-gr_gi_slip_no = wa_zqu14_tabconflmi-bollacons.
*mvt_code
l_goodsmvt_code = '04'.
*pos
clear i_goodsmvt_item.
*material
i_goodsmvt_item-material = wa_zqu14_tabconflmi-codeart.
*plant
i_goodsmvt_item-plant = '1000'.
loop at it_zqu14_tabconflmi2 into wa_zqu14_tabconflmi2
where codeart = wa_zqu14_tabconflmi-codeart
and testolib1 = wa_zqu14_tabconflmi-testolib1.
i_goodsmvt_item-batch = wa_zqu14_tabconflmi2-testolib1.
*storage location
select single lgort from mseg into v_lgort
where mblnr = wa_zqu14_tabconflmi2-testolib6
and mjahr = wa_zqu14_tabconflmi2-mjahr
and zeile = wa_zqu14_tabconflmi2-zeile.
i_goodsmvt_item-stge_loc = v_lgort.
i_goodsmvt_item-vendor = wa_zqu14_tabconflmi2-codforn.
i_goodsmvt_item-move_type = '321'.
i_goodsmvt_item-po_number = wa_zqu14_tabconflmi2-testolib3.
i_goodsmvt_item-po_item = wa_zqu14_tabconflmi2-testolib4.
i_goodsmvt_item-entry_qnt = wa_zqu14_tabconflmi2-qtacons.
* i_goodsmvt_item-entry_uom = 'ST'.
if wa_zqu14_tabconflmi2-testolib5 <> ' '.
i_goodsmvt_item-spec_stock = 'E'.
i_goodsmvt_item-sales_ord = wa_zqu14_tabconflmi2-testolib5.
i_goodsmvt_item-s_ord_item = wa_zqu14_tabconflmi2-kdpos.
i_goodsmvt_item-val_sales_ord = wa_zqu14_tabconflmi2-testolib5.
i_goodsmvt_item-val_s_ord_item = wa_zqu14_tabconflmi2-kdpos.
endif.
i_gm_serialnumber-serialno = wa_zqu14_tabconflmi2-testolib2.
i_gm_serialnumber-matdoc_itm = wa_zqu14_tabconflmi2-zeile. "zeile"
append i_gm_serialnumber.
append i_goodsmvt_item.
endloop.
i'm feeling i_gm_serialnumber with all the serial number and considering each serial number like an item
but when i call the bapi
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = l_goodsmvt_header
goodsmvt_code = l_goodsmvt_code
importing
goodsmvt_headret = l_goodsmvt_headret
materialdocument = l_materialdocument
matdocumentyear = l_matdocumentyear
tables
goodsmvt_item = i_goodsmvt_item
goodsmvt_serialnumber = i_gm_serialnumber
return = i_return.
i have an error message:
ID: IO No.: 212 (select only one serial number instead of 10)
then for all the others items the message ID: M7 No.: 175
what do i miss?
i tried to call the bapi n times for each serial number but after that the first item i had been moved, for the next items i always have the message 😧 M7 No.: 022 and i guess it's normal because the batch has been already moved with the fitrst call.
I also found a sap note 1278707 bapi good movements and implemented it , but i still have the issue.
Any clue?
Thanx .
2012 Nov 20 7:58 PM
Is it possible to post the content of 'i_gm_serialnumber' ? Make sure that the different serial no. is appended with the same item no.
If your loop is doing something like this I don't see a problem:
i_gm_serialnumber-serialno = '11111111'
i_gm_serialnumber-matdoc_itm = '0001'
append i_gm_serialnumber.
i_gm_serialnumber-serialno = '222222222'
i_gm_serialnumber-matdoc_itm = '0001'
append i_gm_serialnumber.
i_gm_serialnumber-serialno = '333333333'
i_gm_serialnumber-matdoc_itm = '0001'
append i_gm_serialnumber.
And so on...
2012 Nov 20 11:20 PM
yup i've checked it in debug i have the serial number appended correctly.
this is the I_GM_SERIALNUMBER
matdoc_item /serialno
| 0001 | 1000 |
| 0001 | 1001 |
| 0001 | 1002 |
and this is the I_GOODSMVT_ITEM
material plant stlo batch
| 1601S0040B000 | 1000 | M001 | 0000034742 | 321 |
| 1601S0040B000 | 1000 | M001 | 0000034742 | 321 |
| 1601S0040B000 | 1000 | M001 | 0000034742 | 321 |
2012 Nov 22 11:57 AM
Did you check the documentation available for the equipment list?
If the XSAUT indicator is set in the table parameter GoodsmvtItem, the system automatically determines the serial numbers for an item.
When creating a goods movement with serial numbers, various scenarios are possible:
The XSAUT indicator is set:
The XSAUT indicator is not set:
Regards,
Felipe
2012 Nov 22 12:33 PM
the fact is that these are the serial numbers determinated by the system when we do the migo. If the material need a quality control it's been send to the quality check. If the control is ok, we need to do an 321 and the issue is there. The serial has been determinated by the system ( infact the 101 mvt does not create problem) only the 321. If we do manually the 321 there is no issue, there is only when we try to use a job using the bapi.
2016 Apr 22 12:43 PM
Hi Ebongue,
As per my knowledge matdoc_itm is not the PO item number, but the line number within the GOODSMVT_ITEM table. For example, you create one line in the GOODSMVT_ITEM table, referring to po item 0002, the matdoc_itm field should be 1, not 2.
Sorry if i am Wrong,
Thank you
2012 Nov 22 12:07 PM
Hi Ebongue,
In BAPI_GOODSMVT_CREATE, the serial number has to be given only once. The system calculates the further serial numbers and puts against the material automatically. The serial number which you give, has to the last serial number of that number range that is used. It should not be the next number of that serial number range. This would be calculated and taken by system automatically during their BDC session (from BAPI)
Regards,
Hardik Mehta
2012 Nov 22 12:34 PM
the fact is that these are the serial numbers determinated by the system when we do the migo. If the material need a quality control it's been send to the quality check. If the control is ok, we need to do an 321 and the issue is there. The serial has been determinated by the system ( infact the 101 mvt does not create problem) only the 321. If we do manually the 321 there is no issue, there is only when we try to use a job using the bapi.
2012 Nov 22 1:10 PM
So, fill the "i_goodsmvt_item-xsaut = 'X'" and don't pass the table parameter "i_gm_serialnumber" the system should fill automatically. It will be a problem?
2012 Nov 22 1:22 PM
Won't this create a discrepancy? i mean won't we still see in mmbe the serial number in quality?
2012 Nov 22 1:35 PM
Sincerly I dont know, maybe the ones that is in quality is not considered by the auto determination. If it's not PRD environment, try it.
2012 Nov 22 1:43 PM