BAPI_GOODSMVT_CREATE LT06
I'm going to create a program to rebatch FG with unit of issue BOX and stock status as available in full single bin.
My process is
1 select goods movement data from LQUA
2 post goods movement using records on each bin by call BAPI_GOODSMVT_CREATE
3 call transaction LT06 with Material Document created return from BAPI. In order to do that need recording BDC that has several steps.
Question is there are any way to call BAPI_GOODSMVT_CREATE that be able to create transfer order automatically and no need to call LT06 or not?
I found http://www.jt77.com/CRM/related-discussion-6508.html that suggest to pass value of goodsmvt_item-stge_type_pc, stge_type_st but still not work.
I got my solution.
After call BAPI_GOODSMVT_CREATE and get Material Document number then loop each Posting Change number get from MSEG and find Quant from LQUA the same MATNR and CHARG to be parameters to call L_TO_CREATE_POSTING_CHANGE to create Transfer Order instead of calling LT06
Similar Messages
-
Error while posting a document using the BAPI_GOODSMVT_CREATE
Hi,
i was trying to post the Goods Receipt document ( Tcode MB1C) using the bapi BAPI_GOODSMVT_CREATE
i am passing the item details and Serial number details.
the error triggered was Maintain Serial Numbers for Total Quantity
but i am passing the quantity as 1 ( in item data) and passing one serial number.
is this error because of data problem or am i missing to pass the value to some dependent parameter..?
Please help me out.
Thanks in advance.
SriramHi David,
i was tring to pass the same.
in item table we have we have four item details ( below)
RES_ITEM - Item Number of Reservation/Dependent Requirement
ORDER_ITNO - Order Item Number
S_ORD_ITEM - Item Number in Sales Order ( length mismatch with serial item number)
PO_ITEM - Item Number of Purchasing Document ( length mismatch with serial item number)
out 4 , 2 are ruled out because of length mismatch. and in the reaming two are
RES_ITEM - Item Number of Reservation/Dependent Requirement
ORDER_ITNO - Order Item Number
this is a Goods receipt document, please let me know which field is required to map with item number in the above two.
Regards,
Sriram. -
BAPI_GOODSMVT_CREATE - Error while posting a Material Document
Hi Experts,
We are trying to do the material document posting using the transaction "MB1C" manually in SAP. The movement type which we are using for the same is "261". While doing this is, it is asking for a work order number and the Recipient number. We gave the Recipient Number as "123". Material document is created successfully.
Again using the same transaction "MB1C" , we are trying to do the reversal of the material document which we posted previously against another work order number for the same material and the serial number if the material is serialised and as well as for the non serialised material.
Both this case, in SAP the material document is created succesfully. This is done manually in SAP.
When we are trying to create the material document using the BAPI 'BAPI_GOODSMVT_CREATE', for the above scenario, posting the material document '261' movement type for one work order and the reversal for another work order '262' movement type for the same material (whether it is a serialised or non serialised) we are getting the eror as "RE Qty. transferred exceeded 1 PC: 50,003,695 C001 USED 1200".
We are passing the following at the item level. MATERIAL Number, Plant, STGE_LOC, ENTRY_QNT, MOVE_TYPE, BATCH, ORDERID, RESERV_NO, RES_ITEM, ACTIVITY, XSTOB for reversal.
We are passing the GM_CODE as '05'.
Please let us know what needs to be changed inorder to create the material document properly without getting errors.
Thanks in Advance,
Mohan.Hi,
We fixed this issue by removing the reservation number of the material when we are trying to post the material document with the movement type "262".
The reason for removing the reservation number for the movement type "262"
The reservation number is getting created against a work order when we trying to create the work order in IW32. This reservation number is used for validating the stock while we are trying to consume and doing the reversal.
SAP is allowing us to reverse the consumed quantities only based on the reservartion number and hence we got this error.
To fix this error, if we are trying to reverse a particular material against a different work order for which it has been consumed previiously, remove the reservation number and item number and try posting the material document.
Hope this solution will solve your issue:)
Thanks and Regards,
Mohan. -
Hi Friends,
I need to create a goods receipt for an inbound delivery.
Iam planning to use either MB_CREATE_GOODS_MOVEMENT or BAPI_GOODSMVT_CREATE.
But every time iam getting the error saying that the 101 movement type cant be used.
In my case i need to use both the movement types 101 and 543.
Basically i need to populate both the main item and component material information.
If any one has done this, Can you please give me the sample code.
Regards
SasiHi,
Iam usig the gm_code as 05.
I am paasing the movement indicator ,in that particular field.
lw_goodsmvt_item-material = lw_imseg-matnr.
lw_goodsmvt_item-plant = lw_imseg-werks.
lw_goodsmvt_item-batch = lw_imseg-charg.
IF lw_imseg-sgtxt = 'F'.
lw_goodsmvt_item-move_type = '101'.
lw_goodsmvt_item-mvt_ind = 'B'.
lw_goodsmvt_item-NO_MORE_GR = 1.
lw_goodsmvt_item-stge_loc = lw_imseg-lgort.
ELSEIF lw_imseg-sgtxt = 'C'.
lw_goodsmvt_item-move_type = '543'.
endif.
lw_goodsmvt_item-entry_qnt = lw_imseg-erfmg.
lw_goodsmvt_item-entry_uom = lw_imseg-erfme.
lw_goodsmvt_item-expirydate = lw_imseg-mhdat.
lw_goodsmvt_item-DELIV_NUMB =
lw_goodsmvt_item-DELIV_ITEM =
am i doing something wrong here.
iam gettign the following error message
Goods movement not possible with mvmt type 101
Goods movement not possible with mvmt type 543 -
Error in Bapi_GoodsMvt_Create using Purchase order
Hi Friends,
I am using Bapi_goodsmvt_create for Goods Receipts against Purchase order.
The below code i have given for Goods receipts
It shows the error like
ID : 8J
Err No.:182
Message : Entry 4500000344 00040 0000 not valid; correct entry
Please help me to correct this error.
Thanks
Shankar
===================================
Heading Structure
st_gm_code-gm_code = '01'.
st_gm_header-pstng_date = '20070930'.
st_gm_header-doc_date = '20070930'.
st_gm_header-gr_gi_slip_no = '970015'.
st_gm_header-bill_of_lading = '527213'.
st_gm_header-header_txt = 'AIR'.
st_gm_header-ref_doc_no = '4500000344'.
Tables - ITEM CREATE.
itab_afs_gm_itemx-plant = '2000'.
itab_afs_gm_itemx-deliv_numb = '80100121'.
itab_afs_gm_itemx-stge_loc = '2110'.
itab_afs_gm_itemx-move_stloc = '2110'.
itab_afs_gm_itemx-po_number = '4500000344'.
itab_afs_gm_itemx-po_item = '00040'.
itab_afs_gm_itemx-vendor = '0000650003'.
itab_afs_gm_itemx-vendrbatch = 'ABC123'.
itab_afs_gm_itemx-move_type = '101'.
itab_afs_gm_itemx-mvt_ind = 'B'.
itab_afs_gm_itemx-material = '000000000030000227'.
itab_afs_gm_itemx-entry_qnt = 10.
APPEND itab_afs_gm_itemx .
****&& Grid values
gr_afs-matdoc_itm = '0001'.
gr_afs-grid_value = '205'.
gr_afs-withdrawn_sku = 'X'. "Final issue at sku level
gr_afs-stock_cat = '0000000001000366'.
APPEND gr_afs.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = st_gm_header
goodsmvt_code = st_gm_code
TESTRUN = ' '
IMPORTING
goodsmvt_headret = st_gm_headret
materialdocument = mat_doc
matdocumentyear = doc_year
TABLES
goodsmvt_item = itab_afs_gm_itemx
afs_goodsmvt_sku = gr_afs
return = bapi_return.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
CLEAR itab_afs_gm_itemx.
REFRESH itab_afs_gm_itemx.
CLEAR gr_afs.
REFRESH gr_afs.Hi,
Here is some sample code from one of my programs, which does a 551 movement type. This should get you started. Just check the RETURN table for messages, they should tell you what you are missing.
code
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'.
[/code]
Welcome to SDN! Please remember to award points for helpful answers and mark you post as solved when solved completely. Thanks.
REgards,
Raj. -
Error in updating 311 movement using BAPI_GOODSMVT_CREATE
Hi All,
I need hlep to understand the problem in doing a transfer.
SAP MII is doing a 311 type movement using BAPI_GOODSMVT_CREATE. BAPI is returning the response back to MII. Once the BAPI is commited it shall make transfer inside SAP. But it does not reflect the movement while checking under HUMO.
under SM13 it say " SSFCOMPOSER 323" error in address output (name not filled)
MII is getting this reponse back as a result of BAPI execution.
<?xml version="1.0" encoding="UTF-8"?>
<BAPI_GOODSMVT_CREATE>
<INPUT><GOODSMVT_CODE><GM_CODE>04</GM_CODE></GOODSMVT_CODE><GOODSMVT_HEADER><PSTNG_DATE>2010-07-03</PSTNG_DATE><DOC_DATE>2010-07-03</DOC_DATE><REF_DOC_NO/><BILL_OF_LADING/><GR_GI_SLIP_NO/><PR_UNAME/><HEADER_TXT/><VER_GR_GI_SLIP/><VER_GR_GI_SLIPX/><EXT_WMS/><REF_DOC_NO_LONG/><BILL_OF_LADING_LONG/><BAR_CODE/></GOODSMVT_HEADER><GOODSMVT_REF_EWM><REF_DOC_EWM/><LOGSYS/><GTS_SCRAP_NO/></GOODSMVT_REF_EWM><TESTRUN/></INPUT>
<OUTPUT><GOODSMVT_HEADRET><MAT_DOC/><DOC_YEAR>0000</DOC_YEAR></GOODSMVT_HEADRET><MATDOCUMENTYEAR>0000</MATDOCUMENTYEAR><MATERIALDOCUMENT/></OUTPUT>
<TABLES><EXTENSIONIN/><GOODSMVT_ITEM><item><MATERIAL>130116</MATERIAL><PLANT>2715</PLANT><STGE_LOC>LINE</STGE_LOC><BATCH>96</BATCH><MOVE_TYPE>311</MOVE_TYPE><STCK_TYPE/><SPEC_STOCK/><VENDOR/><CUSTOMER/><SALES_ORD/><S_ORD_ITEM>000000</S_ORD_ITEM><SCHED_LINE>0000</SCHED_LINE><VAL_TYPE/><ENTRY_QNT>96.000</ENTRY_QNT><ENTRY_UOM/><ENTRY_UOM_ISO/><PO_PR_QNT>0</PO_PR_QNT><ORDERPR_UN/><ORDERPR_UN_ISO/><PO_NUMBER/><PO_ITEM>00000</PO_ITEM><SHIPPING/><COMP_SHIP/><NO_MORE_GR/><ITEM_TEXT/><GR_RCPT/><UNLOAD_PT/><COSTCENTER/><ORDERID/><ORDER_ITNO>0000</ORDER_ITNO><CALC_MOTIVE/><ASSET_NO/><SUB_NUMBER/><RESERV_NO>0000000000</RESERV_NO><RES_ITEM>0000</RES_ITEM><RES_TYPE/><WITHDRAWN/><MOVE_MAT/><MOVE_PLANT>2715</MOVE_PLANT><MOVE_STLOC>J01</MOVE_STLOC><MOVE_BATCH>96</MOVE_BATCH><MOVE_VAL_TYPE/><MVT_IND/><MOVE_REAS>0000</MOVE_REAS><RL_EST_KEY/><REF_DATE>0000-00-00</REF_DATE><COST_OBJ/><PROFIT_SEGM_NO>0000000000</PROFIT_SEGM_NO><PROFIT_CTR/><WBS_ELEM/><NETWORK/><ACTIVITY/><PART_ACCT/><AMOUNT_LC>0</AMOUNT_LC><AMOUNT_SV>0</AMOUNT_SV><REF_DOC_YR>0000</REF_DOC_YR><REF_DOC/><REF_DOC_IT>0000</REF_DOC_IT><EXPIRYDATE>0000-00-00</EXPIRYDATE><PROD_DATE>0000-00-00</PROD_DATE><FUND/><FUNDS_CTR/><CMMT_ITEM/><VAL_SALES_ORD/><VAL_S_ORD_ITEM>000000</VAL_S_ORD_ITEM><VAL_WBS_ELEM/><GL_ACCOUNT/><IND_PROPOSE_QUANX/><XSTOB/><EAN_UPC/><DELIV_NUMB_TO_SEARCH/><DELIV_ITEM_TO_SEARCH>000000</DELIV_ITEM_TO_SEARCH><SERIALNO_AUTO_NUMBERASSIGNMENT/><VENDRBATCH/><STGE_TYPE/><STGE_BIN/><SU_PL_STCK_1>0</SU_PL_STCK_1><ST_UN_QTYY_1>0</ST_UN_QTYY_1><ST_UN_QTYY_1_ISO/><UNITTYPE_1/><SU_PL_STCK_2>0</SU_PL_STCK_2><ST_UN_QTYY_2>0</ST_UN_QTYY_2><ST_UN_QTYY_2_ISO/><UNITTYPE_2/><STGE_TYPE_PC/><STGE_BIN_PC/><NO_PST_CHGNT/><GR_NUMBER/><STGE_TYPE_ST/><STGE_BIN_ST/><MATDOC_TR_CANCEL/><MATITEM_TR_CANCEL>0000</MATITEM_TR_CANCEL><MATYEAR_TR_CANCEL>0000</MATYEAR_TR_CANCEL><NO_TRANSFER_REQ/><CO_BUSPROC/><ACTTYPE/><SUPPL_VEND/><MATERIAL_EXTERNAL/><MATERIAL_GUID/><MATERIAL_VERSION/><MOVE_MAT_EXTERNAL/><MOVE_MAT_GUID/><MOVE_MAT_VERSION/><FUNC_AREA/><TR_PART_BA/><PAR_COMPCO/><DELIV_NUMB/><DELIV_ITEM>000000</DELIV_ITEM><NB_SLIPS>000</NB_SLIPS><NB_SLIPSX/><GR_RCPTX/><UNLOAD_PTX/><SPEC_MVMT/><GRANT_NBR/><CMMT_ITEM_LONG/><FUNC_AREA_LONG/><LINE_ID>000000</LINE_ID><PARENT_ID>000000</PARENT_ID><LINE_DEPTH>00</LINE_DEPTH><QUANTITY>0</QUANTITY><BASE_UOM/><LONGNUM/></item></GOODSMVT_ITEM><GOODSMVT_SERIALNUMBER/><GOODSMVT_SERV_PART_DATA><item><LINE_ID>000000</LINE_ID><RET_AUTH_NUMBER/><DELIV_NUMBER/><DELIV_ITEM>000000</DELIV_ITEM><HU_NUMBER>115934300024</HU_NUMBER><INSPOUT_GUID/><EVENT/><DATE>0000-00-00</DATE><TIME>00:00:00</TIME><ZONLO/><TIMESTAMP>0</TIMESTAMP><SCRAP_INDICATOR/><KEEP_QUANTITY>0</KEEP_QUANTITY><GTS_STOCK_TYPE/><MOVE_GTS_STOCK_TYPE/></item></GOODSMVT_SERV_PART_DATA><RETURN><item><TYPE>S</TYPE><ID>L9</ID><NUMBER>514</NUMBER><MESSAGE>Delivery 80817129 created</MESSAGE><LOG_NO/><LOG_MSG_NO>000000</LOG_MSG_NO><MESSAGE_V1>80817129</MESSAGE_V1><MESSAGE_V2/><MESSAGE_V3/><MESSAGE_V4/><PARAMETER>GOODSMVT_HEADER</PARAMETER><ROW>0</ROW><FIELD/><SYSTEM>SP1330</SYSTEM></item></RETURN></TABLES>
</BAPI_GOODSMVT_CREATE>PL Stock in transit exceeded by 200 UNT : 10000000125 3065 0005"
the code does not matter, it is the process and the stock situation that does not allow the creation of the movement.
you cannot receive e.g. 200 from in-transit stock if you only have nothing in transit.
First the goods issue has to be performed in the shipping plant. -
Goods Receipt Report With 101 movement type using bapi_goodsmvt_create
Dear Abapers,
i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
bapi_goodsmvt_create and data should upload through excel sheet.
still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
What are all the inputs i need to take and please give some valuable inputs to me.
please do help ..... thanks for advance..
Thanks & regards,
Vinay.
Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
Edited by: Vinod Kumar on Sep 27, 2011 10:58 AMDear Abapers,
i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
bapi_goodsmvt_create and data should upload through excel sheet.
still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
What are all the inputs i need to take and please give some valuable inputs to me.
please do help ..... thanks for advance..
Thanks & regards,
Vinay.
Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM -
How to post Excise Invoice in GR using BAPI BAPI_GOODSMVT_CREATE ?
Hi,
I want to post Goods Receipt job (MB01) through BAPI 'BAPI_GOODSMVT_CREATE'.
But is there any parameter to post 'Excise Information' through (this/any) BAPI ?
Pls...... answer me soon.
thanks by advance.SEE THE FOLLOWING EXAMPLE
report zbapi_goodsmovement.
parameters: p-file like rlgrap-filename default
'c:\sapdata\TEST.txt'.
parameters: e-file like rlgrap-filename default
'c:\sapdata\gdsmvterror.txt'.
parameters: xpost like sy-datum default sy-datum.
data: begin of gmhead.
include structure bapi2017_gm_head_01.
data: end of gmhead.
data: begin of gmcode.
include structure bapi2017_gm_code.
data: end of gmcode.
data: begin of mthead.
include structure bapi2017_gm_head_ret.
data: end of mthead.
data: begin of itab occurs 100.
include structure bapi2017_gm_item_create.
data: end of itab.
data: begin of errmsg occurs 10.
include structure bapiret2.
data: end of errmsg.
data: wmenge like iseg-menge,
errflag.
data: begin of pcitab occurs 100,
ext_doc(10), "External Document Number
mvt_type(3), "Movement Type
doc_date(8), "Document Date
post_date(8), "Posting Date
plant(4), "Plant
material(18), "Material Number
qty(13), "Quantity
recv_loc(4), "Receiving Location
issue_loc(4), "Issuing Location
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
del_no(10), "Delivery Purchase Order Number
del_item(3), "Delivery Item
prod_doc(10), "Production Document No
scrap_reason(10), "Scrap Reason
upd_sta(1), "Update Status
end of pcitab.
call function 'WS_UPLOAD'
exporting
filename = p-file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = pcitab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'. "01 - MB01 - Goods Receipts for Purchase Order
loop at pcitab.
itab-move_type = pcitab-mvt_type.
itab-mvt_ind = 'B'.
itab-plant = pcitab-plant.
itab-material = pcitab-material.
itab-entry_qnt = pcitab-qty.
itab-move_stloc = pcitab-recv_loc.
itab-stge_loc = pcitab-issue_loc.
itab-po_number = pcitab-pur_doc.
itab-po_item = pcitab-po_item.
concatenate pcitab-del_no pcitab-del_item into itab-item_text.
itab-move_reas = pcitab-scrap_reason.
append itab.
endloop.
loop at itab.
write:/ itab-material, itab-plant, itab-stge_loc,
itab-move_type, itab-entry_qnt, itab-entry_uom,
itab-entry_uom_iso, itab-po_number, itab-po_item,
pcitab-ext_doc.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
TESTRUN = ' '
IMPORTING
goodsmvt_headret = mthead
MATERIALDOCUMENT =
MATDOCUMENTYEAR =
tables
goodsmvt_item = itab
GOODSMVT_SERIALNUMBER =
return = errmsg
clear errflag.
loop at errmsg.
if errmsg-type eq 'E'.
write:/'Error in function', errmsg-message.
errflag = 'X'.
else.
write:/ errmsg-message.
endif.
endloop.
if errflag is initial.
commit work and wait.
if sy-subrc ne 0.
write:/ 'Error in updating'.
exit.
else.
write:/ mthead-mat_doc, mthead-doc_year.
perform upd_sta.
endif.
endif.
FORM UPD_STA *
form upd_sta.
loop at pcitab.
pcitab-upd_sta = 'X'.
modify pcitab.
endloop.
call function 'WS_DOWNLOAD'
exporting
filename = p-file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = pcitab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6
ENDFORM. -
Short dump while using FM "BAPI_GOODSMVT_CREATE" in background
Hi Sir,
I am using the FM "BAPI_GOODSMVT_CREATE" to create the Goods movement. While running the program through a job in background, article docu is generated successfully,,but at the same time it gives short dump in ST22.
Short text
Exception condition "CNTL_ERROR" raised.
A RAISE statement in the program "CL_GUI_CUSTOM_CONTAINER=======CP" raised the
exception
condition "CNTL_ERROR".
Since the exception was not intercepted by a superior
program, processing was terminated.
Please tell me what can be the possible reason for the same and how to avoid the same?
Warm regards
KrishanThere's at least one note addressing this. You should be able to find it quite easily.
Rob -
BAPI_GOODSMVT_CREATE Closing scheduling line items when errors
Hello all,
I have an issue when running BAPI_GOODSMVT_CREATE. If someone for instance is in a scheduling agreement when running my code. I get a locked by user return error from the BAPI. This is fine but the problem is the line item is closed not allowing for reprocessing when the entry is no longer locked. When reprocessing I will get a PU Ordered quantity exceeded by 1 EA : MS9556-08 2 error message
Any advice? Is there a way to reopen a scheduling line item?
Here is what Im sending the BAPI Its looped so one Goods receipt per line in my custom z table.
ls_header-pstng_date = sy-datum.
ls_code-gm_code = c_01.
LOOP AT i_ztab ASSIGNING <lfs_ztab>.
IF <lfs_ztab>-zgr_status IS NOT INITIAL.
<lfs_ztab>-zgr_status = SPACE.
<lfs_ztab>-zgr_error = SPACE.
<lfs_ztab>-return_code = SPACE.
ENDIF.
lv_index = sy-tabix.
ls_header-doc_date = <lfs_ztab>-zload_dt.
lw_goods-material = <lfs_tab>-ematn.
lw_goods-plant = <lfs_ztab>-werks.
lw_goods-stge_loc = s_loc-low.
lw_goods-move_type = c_101.
lw_goods-mvt_ind = c_b.
lw_goods-vendor = <lfs_ztab>-lifnr.
lw_goods-entry_qnt = <lfs_ztab>-menge.
READ TABLE li_ekpo INTO lw_ekpo
WITH KEY ebeln = <lfs_ztab>-ebeln
ebelp = <lfs_ztab>-ebelp
BINARY SEARCH.
IF sy-subrc = 0.
lw_goods-po_number = <lfs_ztab>-ebeln.
lw_goods-po_item = <lfs_ztab>-ebelp.
lw_goods-entry_uom = lw_ekpo-meins.
ELSE.
<lfs_ztab>-zgr_status = c_f.
<lfs_ztab>-zgr_error = TEXT-003. "Contract not found error
<lfs_ztab>-return_code = c_e.
MOVE-CORRESPONDING <lfs_ztab> to w_ztab_up.
APPEND w_tab_up TO i_ztab_up.
CONTINUE.
ENDIF.
APPEND lw_goods TO li_goods.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = ls_header
GOODSMVT_CODE = ls_code
IMPORTING
MATERIALDOCUMENT = lv_matdoc
TABLES
GOODSMVT_ITEM = li_goods
RETURN = li_return.Hi Vinod,
Actually there are two line items in the PO and manually when I try to create a GR for both line items, it creates a GR but when I pass it thr' BAPI, it is generating a GR only for one Line item.
Thanks,
Prasad -
Error while doing PGI for Outbound delivery using BAPI BAPI_GOODSMVT_CREATE
Hi All,
I am getting an below error while doing PGI for outbound delivery using the BAPI BAPI BAPI_GOODSMVT_CREATE:
Goods movement not possible with mvmt type 601
Can anyone suggest me what will be the solution for it?
Regards,
Raghuraman.kI tried with the above BAPI but it is not working.
In my case a delivery has one line item with batch split and other line item without batch split.
Below is my code :
DATA : gwa_header_data TYPE bapiobdlvhdrcon,
gwa_header_ctrl TYPE bapiobdlvhdrctrlcon,
lv_delivery TYPE bapiobdlvhdrcon-deliv_numb,
git_item_data TYPE STANDARD TABLE OF bapiobdlvitemcon,
gwa_item_data TYPE bapiobdlvitemcon,
git_item_ctrl TYPE STANDARD TABLE OF bapiobdlvitemctrlcon,
gwa_item_ctrl TYPE bapiobdlvitemctrlcon,
git_return TYPE STANDARD TABLE OF bapiret2,
gwa_return TYPE bapiret2.
*Header data
gwa_header_data-deliv_numb = '0808000002'.
*Header Control data
gwa_header_ctrl-deliv_numb = '0808000002'.
gwa_header_ctrl-post_gi_flg = 'X'.
*Delivery Number
lv_delivery = '0808000002'.
*Item data and its corresponding control data
gwa_item_data-deliv_numb = '0808000002'.
gwa_item_data-deliv_item = '900002'.
gwa_item_data-dlv_qty = 4.
gwa_item_data-dlv_qty_imunit = 4.
gwa_item_data-fact_unit_nom = 1.
gwa_item_data-fact_unit_denom = 1.
APPEND gwa_item_data TO git_item_data.
gwa_item_ctrl-deliv_numb = '0808000002'.
gwa_item_ctrl-deliv_item = '900002'.
gwa_item_ctrl-chg_delqty = 'X'.
APPEND gwa_item_ctrl TO git_item_ctrl.
gwa_item_data-deliv_numb = '0808000002'.
gwa_item_data-deliv_item = '900003'.
gwa_item_data-dlv_qty = 6.
gwa_item_data-dlv_qty_imunit = 6.
gwa_item_data-fact_unit_nom = 1.
gwa_item_data-fact_unit_denom = 1.
APPEND gwa_item_data TO git_item_data.
gwa_item_ctrl-deliv_numb = '0808000002'.
gwa_item_ctrl-deliv_item = '900003'.
gwa_item_ctrl-chg_delqty = 'X'.
APPEND gwa_item_ctrl TO git_item_ctrl.
gwa_item_data-deliv_numb = '0808000002'.
gwa_item_data-deliv_item = '000020'.
gwa_item_data-dlv_qty = 10.
gwa_item_data-dlv_qty_imunit = 10.
gwa_item_data-fact_unit_nom = 1.
gwa_item_data-fact_unit_denom = 1.
APPEND gwa_item_data TO git_item_data.
gwa_item_ctrl-deliv_numb = '0808000002'.
gwa_item_ctrl-deliv_item = '000020'.
gwa_item_ctrl-chg_delqty = 'X'.
APPEND gwa_item_ctrl TO git_item_ctrl.
BREAK-POINT.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
EXPORTING
header_data = gwa_header_data
header_control = gwa_header_ctrl
delivery = lv_delivery
TABLES
item_data = git_item_data
item_control = git_item_ctrl
return = git_return.
BREAK-POINT.
IF git_return IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF. -
Error while using BAPI BAPI_GOODSMVT_CREATE for Momvent type 321
Hi Guys,
We trying to transfer material from Inspection to Un.Stock by using momvent type 321...In SAP we do QVM1 and do stock postion.
We are using BAPI BAPI_GOODSMVT_CREATE getting this error " E QA 495 Change the inspection stock of material 11036125 in QM only".
Any one have any idea how to overcome this issue.
AtulHi Sachin,
Pass the Item Number of Reservation to GOODSMVT_ITEM-RES_ITEM .
Regards
DKS -
BAPI_GOODSMVT_CREATE ERROR: A System Error Has Occurred While Locking
Hi All,
I am having a problem with a Z program that I am writing.
Basically, it uses the BAPI mentioned in the title. The program will read excel file that is being uploaded, and then will segregate the line items by 200 lines.
That means, if I were to upload 1000 line items, the BAPI will be called and executed 5 times (1000/200 = 5).
However, when trying to upload 10000 line items, I received this error after around 3000 line items.
"A system error has occurred while locking".
This happens when IMPORT parameter TEST_RUN is set to 'X'.
I found this after some googling: http://sap.ittoolbox.com/groups/technical-functional/sap-basis/lock-entry-system-error-1674434
I am hoping for your expert thoughts on this.
Thank you.BAPI TO Upload Inventory Data
* GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
* 02 - MB31 - Goods Receipts for Prod Order
* 03 - MB1A - Goods Issue
* 04 - MB1B - Transfer Posting
* 05 - MB1C - Enter Other Goods Receipt
* 06 - MB11
* Domain: KZBEW - Movement Indicator
* Goods movement w/o reference
* B - Goods movement for purchase order
* F - Goods movement for production order
* L - Goods movement for delivery note
* K - Goods movement for kanban requirement (WM - internal only)
* O - Subsequent adjustment of "material-provided" consumption
* W - Subsequent adjustment of proportion/product unit material
report zbapi_goodsmovement.
parameters: p-file like rlgrap-filename default
'c:\sapdata\TEST.txt'.
parameters: e-file like rlgrap-filename default
'c:\sapdata\gdsmvterror.txt'.
parameters: xpost like sy-datum default sy-datum.
data: begin of gmhead.
include structure bapi2017_gm_head_01.
data: end of gmhead.
data: begin of gmcode.
include structure bapi2017_gm_code.
data: end of gmcode.
data: begin of mthead.
include structure bapi2017_gm_head_ret.
data: end of mthead.
data: begin of itab occurs 100.
include structure bapi2017_gm_item_create.
data: end of itab.
data: begin of errmsg occurs 10.
include structure bapiret2.
data: end of errmsg.
data: wmenge like iseg-menge,
errflag.
data: begin of pcitab occurs 100,
ext_doc(10), "External Document Number
mvt_type(3), "Movement Type
doc_date(8), "Document Date
post_date(8), "Posting Date
plant(4), "Plant
material(18), "Material Number
qty(13), "Quantity
recv_loc(4), "Receiving Location
issue_loc(4), "Issuing Location
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
del_no(10), "Delivery Purchase Order Number
del_item(3), "Delivery Item
prod_doc(10), "Production Document No
scrap_reason(10), "Scrap Reason
upd_sta(1), "Update Status
end of pcitab.
call function 'WS_UPLOAD'
exporting
filename = p-file
filetype = 'DAT'
* IMPORTING
* FILELENGTH =
tables
data_tab = pcitab
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* OTHERS = 6
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'. "01 - MB01 - Goods Receipts for Purchase Order
loop at pcitab.
itab-move_type = pcitab-mvt_type.
itab-mvt_ind = 'B'.
itab-plant = pcitab-plant.
itab-material = pcitab-material.
itab-entry_qnt = pcitab-qty.
itab-move_stloc = pcitab-recv_loc.
itab-stge_loc = pcitab-issue_loc.
itab-po_number = pcitab-pur_doc.
itab-po_item = pcitab-po_item.
concatenate pcitab-del_no pcitab-del_item into itab-item_text.
itab-move_reas = pcitab-scrap_reason.
append itab.
endloop.
loop at itab.
write:/ itab-material, itab-plant, itab-stge_loc,
itab-move_type, itab-entry_qnt, itab-entry_uom,
itab-entry_uom_iso, itab-po_number, itab-po_item,
pcitab-ext_doc.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
* TESTRUN = ' '
* IMPORTING
goodsmvt_headret = mthead
* MATERIALDOCUMENT =
* MATDOCUMENTYEAR =
tables
goodsmvt_item = itab
* GOODSMVT_SERIALNUMBER =
return = errmsg
clear errflag.
loop at errmsg.
if errmsg-type eq 'E'.
write:/'Error in function', errmsg-message.
errflag = 'X'.
else.
write:/ errmsg-message.
endif.
endloop.
if errflag is initial.
commit work and wait.
if sy-subrc ne 0.
write:/ 'Error in updating'.
exit.
else.
write:/ mthead-mat_doc, mthead-doc_year.
perform upd_sta.
endif.
endif.
* FORM UPD_STA *
form upd_sta.
loop at pcitab.
pcitab-upd_sta = 'X'.
modify pcitab.
endloop.
call function 'WS_DOWNLOAD'
exporting
filename = p-file
filetype = 'DAT'
* IMPORTING
* FILELENGTH =
tables
data_tab = pcitab
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* OTHERS = 6
endform.
Code Formatted by: Alvaro Tejada Galindo on Dec 26, 2008 10:20 AM -
BAPI_GOODSMVT_CREATE short dump while posting a GR for inbound delivery
Dear Experts,
I am using BAPI_GOODSMVT_CREATE to post a goods receipt for a PO using Inbound Delivery
here is how I am populating bapi input parameters:
lw_goodsmvt_code-gm_code = '01'.
lw_goodsmvt_item-deliv_numb = lw_inb_delivery_items-delivery.
lw_goodsmvt_item-quantity = lw_inb_delivery_items-deliv_qty.
lw_goodsmvt_item-entry_qnt = lw_goodsmvt_item-quantity
lw_goodsmvt_item-no_more_gr = ''.
lw_goodsmvt_item-move_type = '101'.
lw_goodsmvt_item-mvt_ind = 'B'.
lw_goodsmvt_item-STGE_LOC = '0001'.
lw_goodsmvt_item-po_number and lw_goodsmvt_item-po_item are populated as well.
When I execute the BAPI I get the short dump
Message Class: 'VL'
Number = 143
in the module MB_POST_GOODS_MVT and a reference to 385830 note.
Would you please help me how to solve this problem?from the dump the error orrcurs here:
CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT'
EXCEPTIONS
error_message = 4.
As soon as we have started to put things into UPDATE TASK, we must
ensure that errors definitely terminate the transaction.
MESSAGE A is not sufficient because it can be catched from
external callers which COMMIT WORK afterwards, resulting in
incomplete updates. Read note 385830 for the full story.
IF NOT sy-subrc IS INITIAL.
> MESSAGE ID sy-msgid TYPE x NUMBER sy-msgno WITH "385830
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
MESSAGE A263.
ENDIF.
The short text of the error is: Cannot be processed with this transaction.
Can you tell me if my BAPI Call is correct to post GR in Inbound Delivery? -
Improve the performance of the 'BAPI_GOODSMVT_CREATE' Bapi
Hi All,
We have a requirement in which we create a material document number for each goods receipt note.
This is done with the help of 'BAPI_GOODSMVT_CREATE' . This BAPI is working perfectly fine and is correctly posting the material document number for each of the goods receipt.
The problem lies in the fact that this BAPI is geting called for each line item of the Purchase order ie it gets called in a loop , due to which this program is taking much longer time to run.
Is there any way or any sap notes which we can use to improve the performance of this BAPI .
Thanks ,
SumitHi,
Why do you call the bapi for each line item. All the line items per document should be processed together.
The standard code is mostly fine. The performance of these standard transactions generally deteriorates if good programming practices are not used in the user exits/badis available in the standard transaction. Check where is the pain point to figure out where the transaction takes more time.
Regards,
Abdullah.
Maybe you are looking for
-
How can I turn off Event ID 5156 AND 5145 in the Security Event Log?
Hi, I have a high volume web service. Everytime there is a connection from the outside, it logs this in my security event log. I want to turn this off. How can I stop the logging of event id 5156 on the web server and 5145 on the file server? Thank
-
Hi, i purchased iphone 4s with ios 5.1 from saudi arabia.my iphone 4s is not detected in itunes 10.6 version although i tried it by re installing itunes.i use windows 7 ultimate on my pc.
-
Dota 2 problem on macbook pro 13inch
i recently bought macbook pro 13inch , i downloaded steam and dota 2 but its not running properly. all the tool bar of dota 2 has become florecent green causing problem in reading the tool bar and when in game there is little lag and few grafic corru
-
Express does not reconnect after reboot of Extreme
My extreme is conencted (via ethernet) to my router (bridge mode) My Express is connected to Extreme to expand wireless network (bridge mode) However when i reboot the extreme, the Express is no longer visible I have to reboot as well. is this normal
-
Can I pair ipod touch remote to wired apple tv?
I only seem to be able to pair my ipod touch remote to my apple tv if I unplug my Ethernet network from the apple tv and use it wirelessly. the wireless network connects to my wired router, so isn't the wired and wireless the same network? is there a