Problem in BAPI_GOODSMVT_CREATE
Hi,
I am using BAPI_GOODSMVT_CREATE for creating GR against production order ,
GOODSMVT_CODE : 02
MVT_IND : F
and other required data i have pass properly like orde rnumber, material, quantity, UOM, serial number also test RUN is space, but after execute of RFC system issue the document number, but actual document not posted in the system, when i check that document number it is not present in the system means it is just doing as test run but test rub field is blank.
regards,
zafar
Hi,
Problem solve, after the BAPI_GOODSMVT_CREATE the other BAPI, BAPI_TRANSACTION_COMMIT is required to be call i was testing in se37 with BAPI_GOODSMVT_CREATE only after create new bapi by adding of commit bapi problem solve.
regards,
zafar
Similar Messages
-
Problem with BAPI_GOODSMVT_CREATE and MAA
Hi experts,
I'm trying to GR a PO with MAA (Multiple Account Assingment) by using BAPI_GOODSMVT_CREATE.
My problem is that, as is a return delivery, BAPI is checking wether the reference doc, position and year have been populated for the MAA related positions.
This is done in method CL_MMIM_MAA_2 --> MAA_ITEM_DUPLICATOR_BAPI. As ain't populating those fields, BAPI returns error message M7 465 and not EM document is created.
But, when doing the same by using MIGO transaction, document is created as there is not validation for reference document, because MIGO is using method CL_MMIM_MAA_2 --> MAA_ITEM_DUPLICATOR_MIGO.
I've ssearched fot SAP NOTES (1654305) and SCN posts, with no results.
Can someone explain how to do a return delivery with MAA by using BAPI_GOODSMVT_CREATE?. Is there any way to avoid the validation when using the BAPI?.
Thank you so much in advance.
Regards,
Carlos.Hi,
I think the reason and the solution for the error M7 465 is well explained in the note: 1654305 - MAA2 error M7 599 during return delivery GR with BAPI
If the note is applicable for you and still the problem is not solved with the note, you may cross check the changes mentioned in the note and you may raise an OSS ticket to SAP.
Regards,
AKPT -
Problem with BAPI_GOODSMVT_CREATE to transfer stock
Hi all,
i met a problem when i use BAPI_GOODSMVT_CREATE to transfer stock from one stock to another stock (one step).
parameters:
Goodsmvt_code = '04' " MB1B
Material,Plant,Stge_loc,Batch,Move_type,move_plant,Move_stloc,Move_batch
Matdoc_item,Serialno
then execute the bapi. i get the successful result.
but when i check the stock, nothing happened.
i also check the table SER03. the material documents didn't generate.
i use MB1B to do it directly. the material is transfered and the material documents also generated.
can anyone tell me what's wrong and what should i do? thank you very much.Dear Dave,
Actually the Bapi that you user is a Test Function , so it will not posted,just do simulation, you need to copy the FM to program then commit it, then it will post the document.
Regards,
w1n -
Problem with BAPI_GOODSMVT_CREATE not updating Reservation
Hi,
When i do a manual MB1A 'Goods issue' with reference to Work Order it is posting the goods issue and updating the RESB ,but when i do the same through the bapi code 03 Table i was not able to post the goods issue at all. am i missing a input field in the bapi .Plz help me out.
My code.
gf_goodsmvt_code-gm_code = '03'. "GI
gf_goodsmvt_header-pstng_date = sy-datum.
gf_goodsmvt_header-doc_date = sy-datum.
LOOP AT it_details INTO gf_details .
MOVE :gf_details-matnr TO gf_goods-material,
gf_details-werks TO gf_goods-plant,
rm07m-lgort TO gf_goods-stge_loc,
gf_details-charg TO gf_goods-batch,
rm07m-bwart TO gf_goods-move_type.
MOVE gf_details-issue_qty TO gf_goods-entry_qnt .
MOVE gf_details-meins TO gf_goods-entry_uom.
gf_goods-mvt_ind = 'F'.
gf_goods-reserv_no = gf_details-rsnum.
gf_goods-res_item = gf_details-posnr.
gf_goods-res_type = gf_details-rsart.
gf_goods-withdrawn = 'X'.
gf_goods-orderid = rm07m-aufnr.
gf_goods-order_itno = 1.
APPEND gf_goods TO it_goodsmvt_item.
CLEAR gf_goods.
ENDLOOP.
IF NOT it_goodsmvt_item[] IS INITIAL.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = gf_goodsmvt_header
goodsmvt_code = gf_goodsmvt_code
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET =
materialdocument = g_mat_doc
MATDOCUMENTYEAR =
TABLES
goodsmvt_item = it_goodsmvt_item
GOODSMVT_SERIALNUMBER = 'X'
return = it_return.check below Threads :
Issue related to EXIT statement
and see the sample program :
Structures for BAPI
data: gdsmt_header like bapi2017_gm_head_01.
data: gdsmt_code like bapi2017_gm_code.
data: gdsmt_headret like bapi2017_gm_head_ret.
data: gdsmt_item like bapi2017_gm_item_create occurs 1 with header line.
data: return like bapiret2 occurs 0.
data: retmatdoc like bapi2017_gm_head_ret-mat_doc.
Setup BAPI header data.
gdsmt_header-pstng_date = sy-datum.
gdsmt_header-doc_date = sy-datum.
gdsmt_code-gm_code = '06'. " MB11
Write 262 movement to table.
clear gdsmt_item.
move '262' to gdsmt_item-move_type.
move i_resb-matnr to gdsmt_item-material.
move p_bdmng to gdsmt_item-entry_qnt.
move i_resb-meins to gdsmt_item-entry_uom.
move i_resb-werks to gdsmt_item-plant.
move i_resb-lgort to gdsmt_item-stge_loc.
move i_afko-aufnr to gdsmt_item-orderid.
append gdsmt_item.
Determine cost center
move '0000041430' to gdsmt_item-costcenter.
append gdsmt_item.
Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gdsmt_header
goodsmvt_code = gdsmt_code
importing
goodsmvt_headret = gdsmt_headret
materialdocument = retmatdoc
tables
goodsmvt_item = gdsmt_item
return = return.
Reward Points if it is helpful
Thanks
Seshu -
Problem with bapi_goodsmvt_create
hi all,
iam using bapi_goodsmvt_create to do a goods recipt for a PO. while running the error message iam getting is
"No goods receipt possible for PO 2200000065 010". But i can do it manually the recipt using MIGO for that PO & if i delete that Goods Recipt manually and if i run the program again, the program is picking that PO and its recipting properly as expected.
the requirement is it should do it for the first time itself, rather than receipting manually & deleting that receipt & running the program again
Help me in this issue,
Cheers,
Prem.here is the program...
The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system.
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.
*--- End of Program
points please... -
Problem with BAPI_GOODSMVT_CREATE FM - intersting Issue
HI all,
I need to do the GR for an open inbound delivery. At the item level of precessing document i.e PO 'No goods receipt' check is marked. Same thing is copied to my inbound delivery 'No goods Movement' is marked in Adminstrative tab of my inbound delivery item.
When I use the BAPI BAPI_GOODSMVT_CREATE to do GR for this Inbound delivery, it throws an error saying that 'No goods receipt possible for the PO item'.
But when I do the same thing manually it happened successfully by creating a "service confirmation document" and changed the goods movement status as C (fully completed) without creating an material document as these items are no relevant items for goods movement.
As we are moving goods directly from Vendor to customer, just we want to do service confirmation to vendor without any goods movement. It happening manually but not through BAPI. Please suggest.
Helpful anwers are certainly rewared
Thanks,
Raggs.Hi,
Incase a goods movement document is not getting created then it will not be possible to use the BAPI BAPI_GOODSMVT_CREATE.
Although your process is interesting but its a widely used process.
I think there should be a service order in this scenario against which the confirmation may be happening.
Check any BAPI is available for creating the service order document and then confirming teh same
Check with your functional consultant to explain you the entire cycle and then check for some BAPI or FM available.
Regards,
Ankur Parab -
Problem for BAPI_GOODSMVT_CREATE....
i am using BAPI_GOODSMVT_CREATE for stock update for mb1c tcode.....material document is generated but stock is not update.....and table is not update for stock.....
Hi Vinay,
whenever you are using any BAPI, before that you need to test BAPI alone with data available as per the requirement.
I am sure that you have done that, and whenever you are testing any BAPI use tset sequence where you can defined on sequence what are the bapi you are going to call.
like
go to SE37---> Function Module --->Test ---> Test Sequence , here you need to mentione bapis
like in 1st row BAPI_GOODSMVT_CREATE and then second row BAPI_TRANSACTION_COMMIT
If you are testing bapi in this way then you never forget to call any of the FM during programing. -
BAPI_GOODSMVT_CREATE Problem with movement 161
Hi Gurus,
I have a problem with BAPI_GOODSMVT_CREATE and movement type 161. We used to put 161 as the movement type when referencing a PO with "Returns Item" marked. Movement was properly posted. But now I am facing the following issue, when trying to post 161 I have the message "No goods receipt possible for purchase order 4200000084 ...", If I use movement type 101 system will assume 161 and everything is OK, but I don't understand why I could use 161 before and now I can´t, this is happening with all my POs with "Returns Item" marked.
I understand that I can just use 101, the problem is that this will require a change in a non-SAP system... that is why we prefer still using 161.
Any help will be highly appreciatted.
Thanks!Hi,
Check this link;
Re: BAPI_GOODSMVT_CREATE for movement type 161
Regards -
Cannot use BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BEFORE_UPDATE
Hi experts,
I need to do enhance to post additional 313 movement after post 962 movement.
I picked up MB_DOCUMENT_BEFORE_UPDATE to be triggered after press save button and used BAPI_GOODSMVT_CREATE to post 313.
The problem is BAPI_GOODSMVT_CREATE returned error 'Enter Plant'!.
All parameters were already tested with SE37 and it worked great.
I did a lot debugging and found that all MSEG data were mysteriously cleared after it run 'PERFORM fusszeile_wa_pruefen(sapmm07m) USING x.' in source code SAPLMBWL.
After that, I tried a new way. I submitted my Z program ,which call BAPI_GOODSMVT_CREATE with exactly same parameter, in BADI and it returned error that material ... batch ... is already locked.
I'm not sure that is it possible to post additional material document in this BADI(MB_DOCUMENT_BEFORE_UPDATE).
Best regards,
AmornponThanks for reply.
I did create FM and called it in BADI but it gave the same result as I called BAPI directly from enhance program.
and what do you mean 'NEW TASK' Is that you mean call function in update task?
I did try call function in update task but it didn't work.
The problem is BAPI function returned that Mat XXX Batch XXX is alreay locked by XXX and also cannot get created material doc number. -
Bapi BAPI_GOODSMVT_CREATE lock issues
Hi all,
I have a problem with BAPI_GOODSMVT_CREATE, FM
I have using this to post goods movement type 309 & 321 and I am calling this in LOOP as there are more number of goods movement.
In each iteration i have to post the goods movement and after that i have to create the delivery using bdc MBRL Tcode.
The problem is the BAPI is locking the Material document number even after posting the goods movement for a while. Because of this the delivery creation is failing.
After BAPI i'm using BAPI commit work FM
I have used FM deque_all, but its not working. wait up to 2 secs.
Even the combination of deque_all & wait up to 2 secs is not working.
Is there anyother way to release locks?
ThanksHi,
Try this way ......
SET UPDATE TASK LOCAL.
if sy-subrc eq 0.
call function BAPI_GOODS_MVMT_CREATE
endif.
if return is initial with no errors then
SET UPDATE TASK LOCAL.
if sy-subrc eq 0.
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = return.
endif. -
Problem in executing BAPI_GOODSMVT_CREATE
Hello Experts,
I have created STO. From STO I have created an Inbound Delivery.Now I have to do PGR by using BAPI_GOODSMVT_CREATE.
I am passing
GOODSMVT_CODE 01
GOODSMVT_ITEM
Material
Plant
Storage Location
Batch
Move _Type - 109 (As mentioned by Functional)
Entry_QNT
Entry_UOM
PO_Number
PO_Item
No_More_GR
MVT_IND - B
DELIV_NUMB_TO_SEARCH
DELIV_ITEM_TO_SEARCH
But error message getting populated in IT_RETURN
E M7 036 No goods receipt possible for purchase order 5700000855 00010
Can anyone solve this problem??
One more query is this the correct BAPI to do PGR via tcode VL32N??Hi please check this sample code. it creates goods movement using this BAPIits just that its a upload program. you can modify by your requirement.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
col4(30) TYPE c,
col5(30) TYPE c,
col6(30) TYPE c,
col7(30) TYPE c,
col8(30) TYPE c,
col9(30) TYPE c,
col10(30) TYPE c,
col11(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
* At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*** Create batch upload using BAPI_GOODSMVT_CREATE
PERFORM CREATE_BATCH_UPLOAD.
*& Form CREATE_BATCH_UPLOAD
* text
* --> p1 text
* <-- p2 text
FORM CREATE_BATCH_UPLOAD .
DATA : GT_GOODSMVT_HEADER LIKE BAPI2017_GM_HEAD_01.
DATA : GOODSMVT_ITEM TYPE TABLE OF BAPI2017_GM_ITEM_CREATE,
WA_GOODSMVT_ITEM TYPE BAPI2017_GM_ITEM_CREATE,
* L_RETURN LIKE BAPIRET2,
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
TYPES : BEGIN OF ITAB,
MATNR TYPE MATNR,
WERKS TYPE WERKS_D,
CHARG TYPE CHARG_D,
END OF ITAB.
DATA : IT_ITAB TYPE STANDARD TABLE OF ITAB,
WA_ITAB TYPE ITAB.
DATA : MATERIALDOCUMENT TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
* MATDOCUMENTYEAR TYPE BAPI2017_GM_HEAD_RET-DOC_YEAR.
*DATA : GT_GOODSMVT_HEARRET LIKE BAPI2017_GM_HEAD_RET.
DATA : V_LINES TYPE CHAR4,
GOODSMVT_CODE TYPE BAPI2017_GM_CODE VALUE '04'.
GT_GOODSMVT_HEADER-PSTNG_DATE = SY-DATUM.
GT_GOODSMVT_HEADER-DOC_DATE = SY-DATUM.
LOOP AT IT_DATATAB INTO WA_DATATAB.
WA_GOODSMVT_ITEM-MATERIAL = wa_datatab-col7.
WA_GOODSMVT_ITEM-MOVE_BATCH = wa_datatab-col10.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_GOODSMVT_ITEM-MOVE_BATCH
IMPORTING
OUTPUT = WA_GOODSMVT_ITEM-MOVE_BATCH
WA_GOODSMVT_ITEM-PLANT = wa_datatab-col4.
WA_GOODSMVT_ITEM-STGE_LOC = wa_datatab-col5.
WA_GOODSMVT_ITEM-BATCH = wa_datatab-col9.
WA_GOODSMVT_ITEM-MOVE_TYPE = wa_datatab-col3.
WA_GOODSMVT_ITEM-ENTRY_QNT = wa_datatab-col8.
WA_GOODSMVT_ITEM-MOVE_STLOC = wa_datatab-col6.
WA_GOODSMVT_ITEM-ITEM_TEXT = wa_datatab-col11.
APPEND WA_GOODSMVT_ITEM TO GOODSMVT_ITEM.
CLEAR WA_GOODSMVT_ITEM.
ENDLOOP.
select MATNR WERKS CHARG from MCHB into table it_itab for all entries in GOODSMVT_ITEM
where matnr = GOODSMVT_ITEM-MATERIAL and
charg = GOODSMVT_ITEM-MOVE_BATCH. " GOODSMVT_ITEM-MOVE_BATCH.
DESCRIBE TABLE GOODSMVT_ITEM LINES V_LINES.
IF IT_ITAB[] IS INITIAL.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GT_GOODSMVT_HEADER
GOODSMVT_CODE = GOODSMVT_CODE
* TESTRUN = ' '
* GOODSMVT_REF_EWM =
IMPORTING
* GOODSMVT_HEADRET = GT_GOODSMVT_HEARRET
MATERIALDOCUMENT = MATERIALDOCUMENT
* MATDOCUMENTYEAR = MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = GOODSMVT_ITEM
* GOODSMVT_SERIALNUMBER =
RETURN = RETURN
* GOODSMVT_SERV_PART_DATA =
* EXTENSIONIN =
IF RETURN[] IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN = l_return
WRITE : TEXT-001 , MATERIALDOCUMENT.
WRITE : TEXT-005 , V_LINES.
ELSE.
WRITE: TEXT-002 ,
/ RETURN-MESSAGE.
ENDIF.
ELSE.
WRITE : TEXT-003.
ULINE.
Loop at it_itab into wa_itab.
WRITE : TEXT-004 , wa_itab-matnr , wa_itab-charg.
ENDLOOP.
ENDIF.
ENDFORM. " CREATE_BATCH_UPLOAD -
Problem using BAPI--BAPI_GOODSMVT_CREATE
Hi Gurus,
I am trying to use the BAPI--BAPI_GOODSMVT_CREATE for performing goods reciepts but it is giving the Error "No stock posting possible for this material", When i try to use the MIGO for the same the posting is done. Can any one please suggest me what is the problem with the BAPI and how to correct it?
Thanks in advance
AnoopHi Jurgen,
I have done that still it is giving the same error, any other suggestions??
Regards
Anoop -
Call func 'BAPI_GOODSMVT_CREATE' problem
hi
ı have a trouble with 'BAPI_GOODSMVT_CREATE'
in this code its giving error like this "Error in function
Update control of movement type is incorrect (entry 301 X X _ Q)"
ı give manually in migo it says ok
FORM bapi.
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-pr_uname = sy-uname.
gmcode-gm_code = '04'. "01 - MB01 - Goods Receipts for Purchase Order
loop at gt_out.
itab-move_type = '301'.
itab-mvt_ind = 'Q'.
itab-plant = gt_out-werks.
itab-material = gt_out-maktx .
itab-entry_qnt = gt_out-erfmg.
itab-move_stloc = gt_out-tlgort.
itab-stge_loc = gt_out-flgort.
itab-BATCH = gt_out-charg.
itab-WBS_ELEM = gt_out-wbs.
itab-VAL_TYPE = gt_out-charg.
gmhead-pstng_date = gt_out-postd.
gmhead-doc_date = gt_out-doc_d.
* 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.
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.
ENDFORM.problem resolved
change wbs element with code is below
all problems resolved
itab-val_wbs_elem = '00009001'.
*numan p_wbs düzeltme
itab-wbs_elem = '00009001'.
itab-spec_mvmt = 'R'.
*numanitab-val_wbs_elem -->itab-wbs_elem.
* 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.
perform conversion_exit_abpsp_output
changing :
itab-val_wbs_elem.
perform conversion_exit_abpsp_output
changing :
itab-wbs_elem.
form conversion_exit_abpsp_output using p_value.
call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
exporting
input = p_value
importing
output = p_value.
endform. " CONVERSION_EXIT -
BAPI_GOODSMVT_CREATE has problem
经过多次测试处理,发现问题发生之程序是处理库存移转
之BAPI功能程序BAPI_GOODSMVT_CREATE,其中处理清除
数据的功能程序是以物料异动冻结之注记『TCURM-MBEQU』
来判定是否清除数据,而我们使用物料延迟冻结注记为2,
因此影响清除注记『KZRFB』若连续执行则不会清除
INTERNAL TABLE IMCHB、IMCHA、IMCH1等,以致若程序
未离开重复执行相同料号及批次移转过帐,中间又加上执行
MMPV作物料区间变动,就会造成历史资料MCHBH及MARDH
因IMCHB等未清除之数据带入处理造成异常。(请参阅附件)
经查询相关资源发现此物料异动冻结之注记『TCURM-MBEQU』
是由T-CODE『OMJI』处理的,在测试环境将其改为专用冻结,
『TCURM-MBEQU』为空白,则清除注记『KZRFB』=X,
经过测试问题不再发生。(请参阅附件)
专用冻结与延迟专用冻结虽然有说明但实务上有何影响?,
可能须研究一下,是否能请SAP提供解决方案。Hi Chuang,
If you could please post it in English, Then we would be able to help you
(i tried transalting but could not get your problem)
Thanks & Regards
Kishore -
BAPI_GOODSMVT_CREATE Problem
Hi,
I am testing the BAPI_GOODSMVT_CREATE Function Module.
I have provided the values in the item table GOODSMVTITEM, the field MOVE_TYPE is '101'.
I am getting an error like this
Update control of movement type is incorrect(entry 101 X X)
Can anyone suggest what would be the problem.
Vijayanand.Hi,
check this link.... u will get all help from this code..
http://sap4.com/wiki/index.php?title=BAPI_GOODSMVT_CREATE&printable=yes
<b>Reward points</b>
Regards
Maybe you are looking for
-
Get Current Data of the playing media
Hi, I want to make a visualization for my Media Player. I programmed some but these are at the moment no real visualizations, because I need Data from the Player or Processor to make a visualization. My question: How can I get for example current fre
-
Mega 180 - onboard soundcard is gone???
Hello there! I've turned on my Mega 180 this morning,and the Windows couldn't see my onboard soundcard. I've checked in the BIOS,it's turned on. Last night everything was allright. What could be this???
-
ADF 11g: How to implement search form with automatic substring search
We have ADF search form and result table on the same page. Say, VO that this search form is based upon is famous Employee table from HR schema. What we need is a logic when user enters partial employee first name ie: 'jo'...it should return 'john', j
-
Reg : Problem in Importing RedDot Live server .ept files
Dear All, We are trying to import some .ept files into portal using the portal import functionality under Transport Tab.While importing the .ept files we are getting the error. With all .ept files I created .epa file and imported into portal I am get
-
Tengo problemas al sincronizar mi música con mi mac en mi iphone 5
tengo problemas al sincronizar mi música con mi mac en mi iphone 5, desde que lo actualice a la version 7 empezaron los problemas.