‎2008 Jun 19 12:18 PM
Hi,
is there mandatory parameter ?
i got error "
TYPE = E , ID = M7 , NUM = 076
MESSAGE
"Special stock 1000 Q X-03002-1-10 MAT01 of this material does not exist"
but, no problem with same data by t-code mb1b, only error in using bapi .
as error, i checked avaiable stock based on project inventory(X-03002-1-10) and was available to transfer .
st_goodsmvt_header-pstng_date = gt_list-budat.
st_goodsmvt_header-doc_date = gt_list-budat.
st_goodsmvt_code-gm_code = '04'. "
refresh: it_goodsmvt_item, it_goodsmvt_serialnumber, it_return.
clear: it_goodsmvt_item, it_goodsmvt_serialnumber, it_return.
it_goodsmvt_item-move_type = '311'.
it_goodsmvt_item-material = gt_list-matnr.
it_goodsmvt_item-plant = gt_list-werks.
it_goodsmvt_item-stge_loc = gt_list-lgort.
it_goodsmvt_item-spec_stock = gt_list-sobkz.
it_goodsmvt_item-move_mat = gt_list-matnr.
it_goodsmvt_item-move_plant = gt_list-werks.
it_goodsmvt_item-move_stloc = gt_list-tolgort.
it_goodsmvt_item-entry_qnt = gt_list-menge.
it_goodsmvt_item-entry_uom = gt_list-meins.
it_goodsmvt_item-wbs_elem = gt_list-wbselm. "X-03002-1-10
it_goodsmvt_item-val_wbs_elem = gt_list-wbselm.
append it_goodsmvt_item.
clear : g_materialdocument, g_matdocumentyear.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = st_goodsmvt_header
goodsmvt_code = st_goodsmvt_code
importing
goodsmvt_headret = st_goodsmvt_headret
materialdocument = g_materialdocument
matdocumentyear = g_matdocumentyear
tables
goodsmvt_item = it_goodsmvt_item
return = it_return.
clear g_goodsmvt_doc.
if not st_goodsmvt_headret is initial.
g_goodsmvt_doc = st_goodsmvt_headret-mat_doc.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
p_result = 'S'.
else.
read table it_return index 1.
p_result = 'E'.
endif.
Edited by: venjamin on Jun 19, 2008 6:20 AM
‎2008 Jun 19 12:23 PM
Hello.
Is it a special stock material? Check variable gt_list-sobkz.
Regards,
Valter Oliveira.
‎2008 Jun 19 12:24 PM
‎2008 Jun 19 12:37 PM
Hello.
Confirm in table MSSQ if you have that kind of stock for that material and werks.
Hope this helps.
Regards.
Valter Oliveira.
‎2008 Jun 19 1:21 PM
Hi.
Please have a look into the [rules of engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] of all SDN forums. Threads not following the rules will be deleted. See Michael Schwandt's [blog about strict moderation|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10047] [original link is broken] [original link is broken] [original link is broken]; for details. As these strict moderation policy is quite new I will not delete this thread but lock it.
Best regards,
Jan Stallkamp