BAPI_GOODSMVT_CREATE for Movement type 262
Can anyone please suggest a BAPI or FM for MB1A transaction for movement type 262 ?
I am trying to use it but returns with error 'Stock data of serial number 40000000 not suitable for movement'
Edited by: Venkat Naga on Dec 2, 2011 8:31 PM
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.
Similar Messages
-
Issue with Return Delivery for movement type 262
Hi,
I have got a strange issue, the user is trying to do a MIGO Return Delivery for a material document using movement type 262, this he claims has been doing it for many materials. However when i go to the MKPF table i see the transaction Code field to be MIGO_GI for all the material documents for which he claims to have done return delivery. But under this transaction code we have only 4 options - Display, Issue, Cancel and Remove from storage.
Now when he tries to do the return delivery for movement type 262 he get an error message "Check table T156N: entry RL 262 does not exist" , but this has been very well maintained in the table.
Can you please let me know -
If it is possible to do a return delivery for a movement type 262?
If yes how to address the above error encountered.
Thanks in advance
SachinHi Sachin,
If you think of return delivery to vendor with or w/o PO reference you can use movement types 161, 122, 124 as default settings.
Movement type 261 means withdrawal against production order and its reverse is MVT 262. The latter can be used e.g. via MB1A (or you can make storno of a confirmation by 261).
Are you sure your user is using the correct terminology ('return delivery')? Please check the material documents he/she claims to have booked as return delivery. (in MB51 you can get a list of all material movements of MVT 261 that belong to 'your user' and after that you can open the material document and check through which transaction the booking was made.)
BR
Csaba -
Transfer Requirement for Movement Type 262 (Cancel With Ref to Reservation)
Hi Experts,
it is possible to configure the system to create a Transfer requirement for movement type 262 (Cancel With Reference to reservation) ?
When i execute a movement type 262 (Cancel with reference to Order), the system creates a Transfer Requirement, i can process it in transaction LB12. Now i am using the movement type 262 to Reservation, but the system does not create a transfer Requirement.
I am using SAP ECC 6.0.
Thanks in advance,
Alejandro López.Hi Alejandro,
Can you clarify what process you are performing by this comment? .. "_Now i am using the movement type 262 to Reservation"_.
As per standard process TR (transfer requirement) creation takes place as per the setting in IM-WM interface. Please check in Tcode OMLR, if TR create field is having "X" for the warehouse and reference movement type record. Normally whenever any material document gets posted in IM, MM-WM interface provide the decisions about which WM movement type to pick for warehouse and data about TR , PCN and TO creation.
Hope this will help.
Regards,
Sudhir -
Transfer Requirement for Movement Type 262 to Reservation
Hi Experts,
it is possible to configure the system to create a Transfer requirement for movement type 262 to reservation?
When i execute a movement type 262 to Order, the system creates a Transfer Requirement, i can process it in transaction LB12. Now i am using the movement type 262 to Reservation, but the system does not create a transfer Requirement.
I am using SAP ECC 6.0.
Thanks in advance,
Alejandro López.
Edited by: Alejandro López on Feb 28, 2011 1:55 PMHi Alejandro,
Can you clarify what process you are performing by this comment? .. "_Now i am using the movement type 262 to Reservation"_.
As per standard process TR (transfer requirement) creation takes place as per the setting in IM-WM interface. Please check in Tcode OMLR, if TR create field is having "X" for the warehouse and reference movement type record. Normally whenever any material document gets posted in IM, MM-WM interface provide the decisions about which WM movement type to pick for warehouse and data about TR , PCN and TO creation.
Hope this will help.
Regards,
Sudhir -
BAPI_GOODSMVT_CREATE for movement type 161, issues in PO creation
Hello Gurus,
I am using movement type 161 with BAPI_GOODSMVT_CREATE in order creating a vendor PO based on the goods receipt posted with the BAPI.
It works fine, nevertheless due to business requirements, I need to apply the following changes:
- in SAP standard the order type is NB by default but in our case I would like to force another order type using the same range that NB. I guess this could be done by activating exit ZXM06U17 (MM06E003). Does someone could confirm it?
- in our process, the purchasing group is not maintained at vendor level (LFM1-EKGRP) but as this field is mandatory in the PO creation and as this data can not be maintained in BAPI_GOODSMVT_CREATE, does someone know if it would be possible to force this value during the PO creation (EKKO-EKGRP) based on a maintenance table? If yes in which user-exit? Exit ZM06U43 could be used?
- furthermore, our specific PO type should have a specific account assignement EKPO-KNTTP instead of the default value U, does someone know if it would be possible to force this value during the PO creation (EKKO-EKGRP) based on a maintenance table? If yes in which user-exit? Exit ZM06U43 could be used?
Kind regards
ChrisHi Priya,
Just want to share with your guys how to fit this error in BAPI_GOODSMVT_CREATE.
For movement type 161 of PO return you have to pass movement type 101 instead of 161
goodsmvt_item-bwart = 101. After that standard function will determine 101 to 161 automatically and
post that material doc.
NOTE:
In my case
It just heppen only the FIRST time that you do movement with PO Return wich is needed to pass
101 in stead of 161 but after that you can pass 161 the system will continue process correctly.
Hope it help.
Sayan. -
BAPI_GOODSMVT_CREATE for mov.type 101 for Delivery
Hi expert,ù
I have to use the BAPI_GOODSMVT_CREATE to create a 101 referring to a delivery but I can't find wich parameters I have to set.
If I refre to a purch.order it works correclyt, but the same settings are not applicable for delivery.
Any documentations or example?
ThanksHi,
Check if this is useful.
*-Step 1: Create Inbound delivery from outbound delivery
Input the delivery number, date & creator name
to impkf structure
*-- Do MIGO using Outbound delivery
wa_imkpf-bldat = goodsrecdate.
wa_imkpf-budat = goodsrecdate.
wa_imkpf-xblnr = deliverynumber.
wa_imkpf-usnam = sy-uname.
CLEAR ws_i_cnt.
*-- Pass all the necessary details to I_MSEG - item details
CLEAR wa_wueb. REFRESH i_mseg.
LOOP AT i_wueb INTO wa_wueb.
CLEAR wa_lips. CLEAR wa_mseg.
READ TABLE i_lips INTO wa_lips WITH KEY vbeln = wa_wueb-vbeln
posnr = wa_wueb-vbelp BINARY SEARCH.
IF sy-subrc = 0 AND wa_lips-lgnum NE space. " only for WH managed
ws_i_cnt = ws_i_cnt + 1.
wa_mseg-line_id = ws_i_cnt. " Line Number
wa_mseg-global_counter = ws_i_cnt. " Line Number
wa_mseg-bwart = '101'. " Movement Type
wa_mseg-matnr = wa_wueb-matnr. " Material Number
wa_mseg-werks = wa_wueb-werks. " Plant
wa_mseg-lgort = wa_wueb-lgort. " Storage Loc
wa_mseg-charg = wa_wueb-charg. " Batch
wa_mseg-kzbew = c_b. " Movement Indicator ( B indicates
Goods movement for purchase order)
wa_mseg-erfmg = wa_wueb-erfmg. " Quantity
wa_mseg-erfme = wa_wueb-erfme. " UoM
wa_mseg-bprme = wa_wueb-erfme. " UoM
wa_mseg-menge = wa_wueb-erfmg. " Qty
wa_mseg-meins = wa_wueb-erfme. " UoM
wa_mseg-ebeln = wa_wueb-ebeln. " STO Number
wa_mseg-ebelp = wa_wueb-ebelp. " STO Item Number
wa_mseg-migo_elikz = 1. " Delivery completion indicator( 1 - set automatically)
wa_mseg-bstmg = wa_wueb-erfmg. " QTY
wa_mseg-lgnum = wa_lips-lgnum. " WH No
wa_mseg-vbeln = wa_wueb-vbeln. " Delivery Number
wa_mseg-posnr = wa_wueb-vbelp. " Delivery Item number
wa_mseg-lsmng = wa_wueb-erfmg. " QTY
wa_mseg-lsmeh = wa_wueb-erfme. " UoM
wa_mseg-bukrs = wa_wueb-ekorg. " Purchase org
*-- Get Vendor Number from STO
CLEAR wa_ekko.
READ TABLE i_ekko INTO wa_ekko WITH KEY ebeln = wa_wueb-ebeln BINARY SEARCH.
IF sy-subrc = 0.
wa_mseg-lifnr = wa_ekko-lifnr. " Vendor number
ENDIF.
wa_mseg-ean11_bme = wa_wueb-ean11. " EAN11
wa_mseg-insmk = space. " Stock Type ( space - Unrestricted use)
wa_mseg-weanz = 1. " Number of GR/GI Slips to Be Printed
wa_mseg-weanzx = c_x. " Updated information in related user data field
wa_mseg-wempfx = c_x. " Updated information in related user data field
wa_mseg-abladx = c_x. " Updated information in related user data field
APPEND wa_mseg TO i_mseg.
ENDIF.
ENDLOOP.
*-- Do MIGO
CALL FUNCTION 'MB_CREATE_GOODS_MOVEMENT'
EXPORTING
imkpf = wa_imkpf
xallp = c_x
xallb = c_x
xallr = c_x
ctcod = c_migo
xlisu = c_x
IMPORTING
emkpf = i_emkpf
TABLES
emseg = i_emseg
imseg = i_mseg.
IF i_emkpf-subrc = 1. "Inbound delivery creation is success
ws_c_indelvry = i_emkpf-msgv1. -
BAPI_GOODSMVT_CREATE FOR MOVE TYPE 601
CAN I USE THIS BAPI FOR GOOD ISSUE WITH MOVEMENT 601 FOR OUTBOUND DELIVERY
see the documentation itself , there u will find what kind of params u have to use.
Regards
Peram -
BAPI_GOODSMVT_CREATE is not working for movement type 701 in MIGO
Hi gurus
Can anybody help to track that bapi: BAPI_GOODSMVT_CREATE is not working for movement type 701 for MIGO Transaction.call this standard BAPI, AND EXECUTE IN SE37
""Local Interface:
*" IMPORTING
*" VALUE(GOODSMVT_HEADER) LIKE BAPI2017_GM_HEAD_01 STRUCTURE
*" BAPI2017_GM_HEAD_01
*" VALUE(GOODSMVT_CODE) LIKE BAPI2017_GM_CODE STRUCTURE
*" BAPI2017_GM_CODE
*" VALUE(TESTRUN) LIKE BAPI2017_GM_GEN-TESTRUN DEFAULT SPACE
*" VALUE(GOODSMVT_REF_EWM) LIKE /SPE/BAPI2017_GM_REF_EWM STRUCTURE
*" /SPE/BAPI2017_GM_REF_EWM OPTIONAL
*" EXPORTING
*" VALUE(GOODSMVT_HEADRET) LIKE BAPI2017_GM_HEAD_RET STRUCTURE
*" BAPI2017_GM_HEAD_RET
*" VALUE(MATERIALDOCUMENT) TYPE BAPI2017_GM_HEAD_RET-MAT_DOC
*" VALUE(MATDOCUMENTYEAR) TYPE BAPI2017_GM_HEAD_RET-DOC_YEAR
*" TABLES
*" GOODSMVT_ITEM STRUCTURE BAPI2017_GM_ITEM_CREATE
*" GOODSMVT_SERIALNUMBER STRUCTURE BAPI2017_GM_SERIALNUMBER
*" OPTIONAL
*" RETURN STRUCTURE BAPIRET2
*" GOODSMVT_SERV_PART_DATA STRUCTURE
*" /SPE/BAPI2017_SERVICEPART_DATA OPTIONAL
*" EXTENSIONIN STRUCTURE BAPIPAREX OPTIONAL
*" GOODSMVT_ITEM_CWM STRUCTURE /CWM/BAPI2017_GM_ITEM_CREATE
*" OPTIONAL
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = goodsmvt_header
goodsmvt_code = goodsmvt_code
testrun = testrun
goodsmvt_ref_ewm = goodsmvt_ref_ewm
importing
goodsmvt_headret = goodsmvt_headret
materialdocument = materialdocument
matdocumentyear = matdocumentyear
tables
goodsmvt_item = goodsmvt_item
goodsmvt_serialnumber = goodsmvt_serialnumber
return = return
goodsmvt_serv_part_data = goodsmvt_serv_part_data
extensionin = extensionin.
commit work.
hi, rewards point, if this is useful,
regrds
karthikeyan -
Error while using BAPI_GOODSMVT_CREATE wiht movement type 311.
Hi All experts,
i am geting error msg, while using BAPI_GOODSMVT_CREATE wiht movement type 311.
the error msg is " For reservation 0000443815 0000, no movements can be posted".
Here is my code.
IF I_ZMM_S_MBIB_LOT[] IS NOT INITIAL.
*moving posting date and document date to header
GOODSMVT_HEADER-PSTNG_DATE = ZMM_S_MBIB_311-BUDAT.
GOODSMVT_HEADER-DOC_DATE = ZMM_S_MBIB_311-BUDAT.
LOOP AT I_ZMM_S_MBIB_LOT WHERE MENGE NE '0'.
IF I_ZMM_S_MBIB_LOT-IND = 'X'.
*moving material and plant ,stge_loc,qty and movement type to header
GOODSMVT_ITEM-MATERIAL = I_ZMM_S_MBIB_LOT-MATNR.
GOODSMVT_ITEM-PLANT = I_ZMM_S_MBIB_LOT-WERKS.
GOODSMVT_ITEM-BATCH = I_ZMM_S_MBIB_LOT-CHARG.
GOODSMVT_ITEM-STGE_LOC = I_ZMM_S_MBIB_LOT-SLGORT.
GOODSMVT_ITEM-MOVE_TYPE = '311'.
GOODSMVT_ITEM-ENTRY_QNT = I_ZMM_S_MBIB_LOT-MENGE.
GOODSMVT_ITEM-ENTRY_UOM = I_ZMM_S_MBIB_LOT-MEINS.
GOODSMVT_ITEM-MOVE_MAT = I_ZMM_S_MBIB_LOT-MATNR.
GOODSMVT_ITEM-MOVE_PLANT = I_ZMM_S_MBIB_LOT-RWERKS.
GOODSMVT_ITEM-MOVE_BATCH = I_ZMM_S_MBIB_LOT-UMCHA.
GOODSMVT_ITEM-MOVE_STLOC = I_ZMM_S_MBIB_LOT-UMLGO.
GOODSMVT_ITEM-RESERV_NO = I_ZMM_S_MBIB_LOT-RSNUM.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GOODSMVT_HEADER
GOODSMVT_CODE = '04'
TESTRUN = ' '
GOODSMVT_REF_EWM =
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT = MATERIALDOCUMENT
MATDOCUMENTYEAR = MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = GOODSMVT_ITEM
GOODSMVT_SERIALNUMBER =
RETURN = RETURN.
GOODSMVT_SERV_PART_DATA =
EXTENSIONIN =
ELSE.
Moderator message: duplicate post locked.
Edited by: Thomas Zloch on Feb 23, 2011 11:46 AMHi Sachin,
Pass the Item Number of Reservation to GOODSMVT_ITEM-RES_ITEM .
Regards
DKS -
Dear Experts,
When i create a maintenance order for equipment and assign serialized spare parts With negative sign and valuation type damaged then i go to T-code MIGO to receive the spare parts (Movement type 262), the below error message has been showed up. This is because, I want to receive the spare part into the warehouse with valuation type (Damaged) differ from the valuation type of issuing it at the first time (Under test)
So is there a way to receive a spare part with the same serial number on a different valuation type than that one it has been issued upon it firstly.grating jagdeep
this screen shoots for what you have asked for -
Error in BAPI_GOODSMVT_CREATE with movement type *261' after posting
Hi All,
After sucessfull posting of BAPI_GOODSMVT_CREATE with movement type *261' .
After posting ,while checking In mb51 document exists for it but checking in mmbe stock not reduced from resisticted stock.
Can you kindly tell the import parameter to be filled to over come this error.
Thank you.
Thanks,
AMSHi Himanshu/ Tejaswini Khante / Madhu,
Thank you all for your kind reply.
@Himanshu....I have tried with LWA_ITEM-STCK_TYPE = BLANK, Still it didnt work.
@Tejaswini Khante ...I checked the MMBE tcode, all the stocks are in 'Unrestricted use' only. The quality inspection, reserved fields are all blank. The materials are not Batch managed.
@Madhu...Yes, i discussed with the Functional, yet to find a possible solution.
Thanks & Regards
Rajesh -
Error in Transfer posting for movement type 303
Hi Sir,
I am getting following error while doing Transfer posting for movement type 303 thru BAPI_GOODSMVT_CREATE
Error in Function:
Order not found or not permitted for Goods Movement.
I am passiing all mandatory parameter for it as per BAPI Documentaion in tcode BAPI
Transfer posting
Transfer posting without reference to a reservation
The following fields must be populated:
Material number
Plant
Storage location
Movement type
Movement indicator
Quantity in unit of entry
ISO code unit of measurement for unit of entry
If I am doing manually by MB1B tcode, it is successfully done.......here its not asking any ORDER No...
Please help me .........
Regards,
KrishanI'm not sure what you're system set up is... So I'd suggest looking at everything you enter on the screen and then checking to make sure you are passing all the information in the BAPI.
With that said our system does require posting date, and batch. You might check that. Also check that you've included all the required information in the header.
Did you use the same data when you tried to process the BAPI that you used when you tried to do MB1B manually? -
Need Fields KDAUF, KDPOS, BWART update in table GLPCA for movement type 633
Hi All,
I need following field update in Table GLPCA for movement type 633 (Consignment Issue):
KDAUF : sale document no.
KDPOS : Order Line Otem
BWART : Movement Type
The same fields are updated for movement type 601 (Standard order). Also I checked with Table MSEG and find the same as above.
Thanks in advance.
ATYou should use the BAPI instead BAPI_GOODSMVT_CREATE
of BDC.
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
Welcome to SDN. Please be sure to award points for any helpful answers and mark your post as solved when solved completely. Thanks.
REgards,
Rich Heilman -
Movement type 262 when creating a work order (tx IW31)
Hi experts!!!!!
I need to cover the following scenario:
*sometimes, when the client carries out a work, they recover one item. Ideally they want to take into consideration this item as well from a point of view of costs, which means that in order to carry our the work some items and labour will be used and it will be considered as a cost but the item recovered will be considered as less cost (profit). In customizing (plant maitenance -->Maitenance and service orders --> General data -->define movement types for material reservations) that it is possible to customize the movement type to be used in case of reservations (goods issues and cancellation of goods issues). I have checked that if I change the customizing and I put 262 instead of 261, the system behaves as desired. The thing is that this affects to all the components and this is not correct. Therefore, from the work order (IW32 or IW31) I have tried to change the movement type manually, but I found that the field movement type (at component level for items L, field RESBD-BWART) is grey and it can not be changed.
Therefore, my question is:
*how to customize field RESBD-BWART so that I can change whenever I create or change a work order
*which is the meaning of having cancellation of goods issue in the customizing if then I only can use movement 261.
On the other hand, I have checked the functionality "refurbishment" but I doesn't fit because we have to use valuation type and this is not desired....
Best regardsHi,
The materials that you are entering in the component tab are "Planned" materials that you may use during the execution of the order. In your case i don't see the necessity to enter it here, You could directly do a Return goods issue against the order using movement type 262, for that specific material.This should solve your needs.
Regards
Narasimhan -
GOODSMVT_CREATE for movement type 161, Error mg " Enter Purchase group "
Hi Experts,
While creating PO for movement type 161 , it doesnu2019t insert the good receipt in SAP . I am getting the error message " Enter the Purchase group" after coming out from the BAPI_GOODSMVT_CREATE.
i tried with movement 101 and it create correctly the GR in SAP . Problem oly with movement type 161.
Anything i have to do changes in code or its functional side (they have to maintain.).
Please help me.
Thanks a lot in Advance.
Regards,
Priya.Hi Priya,
{CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = p_lt_goodsmvt_header " here in this header struc pass movement type
goodsmvt_code = ' ' " pass this value correctly
testrun = ' '
IMPORTING
goodsmvt_headret = p_e_goodsmvt_headret
TABLES
goodsmvt_item = p_lt_goodsmvt_item
return = lt_return.}
Thx,
Vishnu .
Maybe you are looking for
-
HELP New Install CS3.3 on a MAC
HI, I have a Mac freash out the box it has OX 10.5 and I tried to install CS3.3 upgrade on it but all it did was install fireworks and Pro 9. my question Do I have to have CS3 on my Mac first then use the up grade CD to upgrade should the up grade ha
-
How do you unlock an object in Fireworks CS5?
Hi There, I locked a few objects but now I can't find an unlock command - how do you do this in Fireworks? Found a menu in the layers palate which did the trick - pretty cryptic though! Cheers Ben
-
Hi All, I want to do initial load for BP related Customizing Objects. I know what all object i need to load. I want to know what r all configuration i need to do in ECC and CRM inorder to do Initial load. Please help me on this. Kind Regards, Anil
-
Can someone please explain to me what exactly photoshop extended is and why it's different from just regular photoshop?
-
IPhone 3G keeps needing to be restored
My iPhone has worked fine the past year and a half, but recently hasn't been working. It was getting no service in areas where there is service a week or so ago. Two days ago it said iPhone cannot make or receive calls restore needed. I did the resto