BAPI_GOODSMVT_CREATE for movement 971 (TCode MB1B)
Dear all,
I try to use the BAPI_GOODSMVT_CREATE to create a good movement 971 but nothing seems to be created..
Below the parameters used :
Header
wa_goodsmvt_header-doc_date = sy-datum.
wa_goodsmvt_header-pstng_date = sy-datum.
wa_goodsmvt_header-pr_uname = sy-uname.
Code Movement
wa_goodsmvt_code-gm_code = '04'.
Items
wa_goodsmvt_item-material = . "Material
wa_goodsmvt_item-plant = . "Plant
wa_goodsmvt_item-stge_loc = . "Sotrage Location
wa_goodsmvt_item-entry_qnt = . "Quantity
wa_goodsmvt_item-entry_uom = . "Unity
wa_goodsmvt_item-move_type = '971'. "Code movement
wa_goodsmvt_item-move_stloc = . "Receiving Storage Location
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_goodsmvt_header
goodsmvt_code = wa_goodsmvt_code
TABLES
goodsmvt_item = t_goodsmvt_item
return = t_return.
When I use the transaction M1B1 with this parameters, the document is created. Do you know if something missing?
Thank you very much in advance.
Best regards,
Robin
First read my answers at Re: "BAPI_GOODSMVT_CREATE" for delivery
- Look in table T158B for transaction(s) allowed to movement '971' (is this a customer specific movement type, transaction OMJJ)
- Look in table T158G to find gm_code (MB1B is '04')
I hope you don't forget the COMMIT_WORK/BAPI_TRANSACTION_COMMIT and that you looked in table RETURN for error messages.
Regards,
Raymond
Similar Messages
-
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 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 PMHi,
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. -
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 - error for movement type 343 (movement code - 04)
Hi Gurus,
I am using BAPI_GOODSMVT_CREATE for doing transfer posting MB1B.
I need to do transfer posting using movement type - 343 "Blocked to Unrestricted stock"
Movement type - 343
GOODSMVT_CODE - 04 (transfer posintg)
I am getting error message -
E /CWM/MM 001 Transfer the parallel entry quantity/entry unit of measure
Help me with some pointers.
Thanks,
MadanRajesh,
Here is my code for line items:
MATERIAL 100001374
PLANT 1AAE
STGE_LOC B100
BATCH 0111331309
MOVE_TYPE 343
ENTRY_QNT 10.000
ENTRY_UOM EA
Let me know should I need to fill any other fields.
Thanks,
Madan -
Hi All
Do you know why this behaviour different for subtitution written under cost center accounting.
We have written substitution using coding block table. Logic of substitution is in case of any GL maintained in a set is being used for posting , then we will replace the cost center with profit center vlaue. Reason being we have same naming convention for Cost center and Profit center.
Thanks
SoniaHi,
MB1B is t-code for stock transfer posting.
Stock transfer posting generate FI document using balance sheet account, not P&L account.
Because you don’t create cost elements using balance sheet accounts related to stock, I think that Substitution written under cost center accounting is not working for tcode MB1B is right. -
BAPI_GOODSMVT_CREATE For MB1B
Hi Friends,
i wrote a program using BAPI_GOODSMVT_CREATE.
for MB1B stock transfer.
Its creating Material Document as well as Accounting document.
we dont want to create accounting document.
can anybody help me how to solve it.
regards,
MalikTry to use the BAPI BAPI_GOODSMVT_CREATE with GOODSMVT_CODE = 04
-
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 -
Bapi_goodsmvt_create for 961 mov. type
hi all,
can i use bapi_goodsmvt_create function module for 961 movement type?
Edited by: vinil aturi on Jun 11, 2008 11:10 AMdear aturi,
what is the 961 movement type for ?
Yes you can definitley use BAPI_GOODSMVT_CREATE for 961 Movement Type
as i had used it for 101 and 301 movement types in my program.
Hope this helps you out.
Do reward if useful.
Thanks
Venugopal -
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? -
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 -
BAPI_GOODSMVT_CREATE for code 04 and special ind E
Hi Everybody
My requirement is like when we create sales order and put Item category ZXLC local branch transfer and save the sale order..It creates purchase requisation and we pass supply plant there. It shold create document through MB1B. We are using BAPI BAPI_GOODSMVT_CREATE for that but it is not creating document.
We are passing code 04 goods movement code and special indicator E.
My problem is that where I have to call this BAPI. I mean user exit or enhancement and what are the parameter we should pass. Can any body send me the piece of code for that...I m calling this BAPI thru user exit USEREXIT_SAVE_DOCUMENT in the include program MV45AFZZ. I m passing posting date, doc date, user name movement type 412 at header level. I passed GOODSMVT_CODE as '04'.
LT_GOODSMVT_ITEM-material = xvbap-matnr.
LT_GOODSMVT_ITEM-plant = eban-RESWK.
if xvbap-lgort is initial.
LT_GOODSMVT_ITEM-stge_loc = '0001'.
else.
LT_GOODSMVT_ITEM-stge_loc = xvbap-lgort.
endif.
LT_GOODSMVT_ITEM-spec_stock = 'E'.
LT_GOODSMVT_ITEM-SALES_ORD = xvbap-vbeln.
LT_GOODSMVT_ITEM-S_ORD_ITEM = xvbap-POSNR.
LT_GOODSMVT_ITEM-VAL_SALES_ORD = xvbap-vbeln.
LT_GOODSMVT_ITEM-VAL_S_ORD_ITEM = xvbap-POSNR.
*quantity
LT_GOODSMVT_ITEM-entry_qnt = xvbap-KWMENG.
LT_GOODSMVT_ITEM-entry_uom = xvbap-meins.
AT ITEM LEVEL.
Is this the right place for calling this BAPI and for code 04 and special ind E r these the sufficient parameters. It shows error msg
pass the sales order number whereas I m passing the sales order no. correctly even I tested this with existing sales order in debug mode.. -
HI,
What is the diffrence between Tcode MB1B/MB1C/MB1AMB1B - Transfer Posting {may physical (or) logical (not physical) stock transfer of goods}.
MB1C - Initial Uploading for Stock
Initial Entry of Inventory Data
You must carry out an initial entry of stock balances when implementing the SAP System in order to transfer physical warehouse stocks or book inventories from an existing system into the SAP System as book inventories. No physical movements actually take place. The initial entry of stock balances can be carried out for the following three stock types:
· Unrestricted-use stock
· Stock in quality inspection
· Blocked stock
If the stocks are to be transferred from a legacy system, the initial entry of stock balances for large volumes of data is carried out via the Data Transfer Workbench (see MM Goods Movements: Data Transfer Workbench).
You can also carry out the initial entry of stock balances manually.
You use the following movement types to enter an initial entry of stock balances manually:
· Unrestricted-use stock (561)
· Stock in quality inspection (563)
· Blocked stock (565)
The quantity taken over into book inventories is posted to the appropriate stock and increases the total valuated stock of the material.
MB1A - for Goods Issue
Regards,
Anbu -
Hide/Suppress Cost center field in MIGO and MB1A for movement types 551&552
Hi All,
Can anybody tell me how to suppress or hide the cost center field in MIGO or MB1A for movement types 551 and 552?
I did below settings and it worked fine for only MB1A and for MIGO still it is showing cost center field.
IMG > Materials Management > Inventory Management and Physical Inventory >Goods Issue/Transfer posting > Define screen layout > select movement type to change the option.
Also I did gothrough the settings for Enjoy transaction (MIGO) there we have only option to make fields either "Required entry" or "Optional entry" and we don't have an option to hide/suppress.
Please advise or help me .
Thanks in advance!
Regards,
PraveenHi
The cost center field is a required field in mvt type 551 as you are scrapping materials, some cost center will need to take the cost of this operation.
Anyway, you first need to make the field as optional for example, before you move.
One option is that you create a screen variant in Tcode SHD0 for MB1A, where 551 is setup as constant (with content) , and mark Cost center as invisible and assign this screen variant to a transaction in SE93.
regards
Sidi
Maybe you are looking for
-
Can i set up a second itunes account on my laptop?
I have just managed to set up an account for my iphone, but would like to set up another on the same laptop for my husbands very old ipod and let's just say we don't share the same taste in music! Thank you!
-
I can no longer open most videos sent to me.
Hi, I can no longer open most videos sent to me on Facebook - my warranty is expired even though my MacBook Air is just a little over a year old - any suggestions would be appreciated. TIA
-
Finder is gone - how do I get it back?
After installing a recent system update my finder disappeared also everything on my desktop. The files are still there (can be accessed through Word, Excel, etc) but it's blank. Don't even have an apple menu available unless I'm running an applicatio
-
Hi friends! I need some help! I have an LOOP and inside this a Program Lines. After I have a TEXT. All this things is in a table. HEADER_TEXT TYPE STRING. LOOP AT T_LINES INTO W_LINES. CONCATENATE W_LINES INTO HEADER_TEXT. After Loop. TEXT_
-
I have a 64gb Ipad wifi + 3G and had it since January.. now it doesnt work. screen went blank on it so lloked around and tried everything, hold down sleep and home button etc and even put it in recovery mode and tried to restore it but it doesnt do a