12-13-2006 11:02 AM
Hi Friends,
We have to create a Goods Receipt against an Outbound Delivery ( movement type "101" ) using the BAPI <b>BAPI_GOODSMVT_CREATE</b>.
In online the user is using <b>MIGO</b> transaction for the same. There he will choose the GOODS RECEIPT for OUTBOUND DELIVERY and enters the delivery number. The movement type "101" is used.
Could you please tell me the GM code and the required fields to be passed for the above scenario.
I have gone through the example program in the link...
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
<b>but unable to find how to use this BAPI for simulating MIGO transaction.</b>
<b>The fields available are with us are...</b>
Delivery. No. --- Doc. Date - Posting Date-Quantity-Storage Location-
Reason for movement-External qty-External qty unit-Goods recipient-Excise Selection
Are these fields sufficient for doing MIGO with this BAPI or do we require more fields???
Thanks and Regards,
Bharat
12-13-2006 3:45 PM
check the documention for purchase order unkown when the CODE is 01. Clearly explains the parameters to be passed when shipping info is available but purchase order is unkown.
Purchase order unknown: Shipping notification known
The following fields have to be filled:
Delivery
Delivery item
Movement type
Other fields, such as those under "Purchase order known". The system determines the relevant purchase order item via the delivery/delivery item.
12-13-2006 11:20 AM
PSTNG_DATE
DOC_DATE
REF_DOC_NO
<b>GM_CODE = '01'.</b>MOVE_TYPE = '101'
ENTRY_QNT
ENTRY_UOM_ISO = IT-UOM.
PO_NUMBER = PA_EBELN.
PO_ITEM = IT-ITEM.
<b>MVT_IND = 'B'.</b>
this r the fileds required for the BAPI_GOODSMVT_CREATE Bapi..
regards
aswin
12-13-2006 11:44 AM
Hi,
Thank you for the replies.
But we don't have PO number and PO item number to pass.
In MIGO we directly give delivery number but not he purchase order while creating a GR against an OUTBOUND DELIVERY.
Waiting for more replies...
Regards,
Bharat.
12-13-2006 11:24 AM
see the following code. it may be useful.
LOOP AT I_TAB.
count = sy-tabix.
SELECT SINGLE * FROM ZMM_GR_UPLOAD1
WHERE SOLOMON_GR = I_TAB-SOLOMON_GR AND
SOLOMON_GRDAT = I_TAB-SOLOMON_GRDAT.
IF SY-SUBRC = 0.
I_TAB-FLAG = 'C'.
modify i_tab index count.
concatenate 'File Name : ' name into i_msg1.
append i_msg1.
CONCATENATE 'ERROR PO : ' I_TAB-SOL_PONO
' WAS ALREADY UPLOADED' INTO I_MSG1.
APPEND I_MSG1.
CLEAR I_TAB-FLAG.
CONTINUE.
ELSE.
REFRESH I_ITEMS.
CLEAR I_ITEMS.
CONCATENATE I_MAIN-SOLOMON_GRDAT+4(4)
I_MAIN-SOLOMON_GRDAT+2(2)
I_MAIN-SOLOMON_GRDAT+0(2) INTO G_DATE.
gmhead-pstng_date = G_DATE.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
"01 - MB01 - Goods Receipts for Purchase Order
gmcode-gm_code = '01'.
refresh itab.
clear itab.
SORT I_MAIN BY SOLOMON_GR.
LOOP AT I_MAIN WHERE SOLOMON_GR = I_TAB-SOLOMON_GR.
itab-move_type = '101'.
itab-mvt_ind = 'B'.
itab-plant = I_MAIN-WERKS.
itab-material = I_MAIN-MATNR.
itab-entry_qnt = I_MAIN-ERFMG.
itab-stge_loc = 'OMR1'.
itab-move_stloc = pcitab-recv_loc.
itab-REF_DOC = 'exnum123'.
itab-NO_MORE_GR = 'X'.
itab-WITHDRAWN = ''.
itab-stge_loc = I_MAIN-LGOBE.
itab-po_number = I_MAIN-EBELN.
itab-po_item = I_MAIN-EBELP.
itab-unload_pt = I_MAIN-ABLAD2.
append itab.
ENDLOOP.
if not itab[] is initial.
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 sy-tabix = 1.
concatenate 'File Name : ' name into i_msg1.
append i_msg1.
concatenate 'Sol PO : ' I_TAB-SOL_PONO ' '
I_TAB-SOL_PODT into i_msg1.
append i_msg1.
endif.
if errmsg-type eq 'E'.
write:/'Error in function', errmsg-message.
errflag = 'X'.
else.
write:/ errmsg-message.
endif.
move errmsg-message to i_msg1.
append i_msg1.
endloop.
if errflag is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
.
commit work and wait.
if sy-subrc ne 0.
write:/ 'Error in updating'.
exit.
else.
concatenate 'File Name : ' name into i_msg1.
append i_msg1.
concatenate 'Sol PO : ' I_TAB-SOL_PONO ' '
I_TAB-SOL_PODT into i_msg1.
append i_msg1.
write:/ mthead-mat_doc, mthead-doc_year.
ZMM_GR_UPLOAD1-SOLOMON_GR = I_TAB-SOLOMON_GR.
CONCATENATE I_TAB-SOLOMON_GRDAT+4(4)
I_TAB-SOLOMON_GRDAT+2(2)
I_TAB-SOLOMON_GRDAT+0(2) INTO
ZMM_GR_UPLOAD1-SOLOMON_GRDAT.
ZMM_GR_UPLOAD1-SOLOMON_GRDAT = I_TAB-SOLOMON_GRDAT.
INSERT ZMM_GR_UPLOAD1.
COMMIT WORK.
I_TAB-FLAG = 'C'.
MODIFY I_TAB INDEX COUNT.
CONCATENATE mthead-mat_doc mthead-doc_year
into i_msg1.
append i_msg1.
perform upd_sta.
endif.
endif.
endif.
ENDIF.
ENDLOOP.
12-13-2006 3:45 PM
check the documention for purchase order unkown when the CODE is 01. Clearly explains the parameters to be passed when shipping info is available but purchase order is unkown.
Purchase order unknown: Shipping notification known
The following fields have to be filled:
Delivery
Delivery item
Movement type
Other fields, such as those under "Purchase order known". The system determines the relevant purchase order item via the delivery/delivery item.
12-15-2006 4:14 AM
Hi,
For this option we have to give GM_CODE as '01' and movement indicator as 'B' as per the documentation.
If we fill the movement indicator as 'B' an error message is appearing 'ENTER PURCHASE ORDER NUMBER'.
For purchase order unknown where delivery number is available,
We are passing
GM_CODE = '01'.
MOVEMENT_INDICATOR = 'B'.
DELIVERY NUMBER
DELIVERY ITEM NUMBER
QUANTIY IN ENTRY UNIT
UOM
ISO UNIT
If movement_indicator is B then it is asking for PO number.
If we pass it as space the it is giving an error message like
"Goods movement not possible with mvmt type &"
Waiting for replies,
Bharat.
02-06-2008 10:29 AM
Did you find out how to do this ?
We need to do the same thing.....
Thx
Phil
05-06-2010 8:40 AM
GOODSMVT_HEADER
PSTNG_DATE
DOC_DATE
REF_DOC_NO -
DN number
GOODSMVT_CODE -
'01'
GOODSMVT_ITEM
MOVE_TYPE----
'101'
ENTRY_QNT----
GR quantity
NO_MORE_GR----
if GR quantity = DN quantity then input 'X' else leave blank
MVT_IND----
'B'
-
for search relevant information
DELIV_NUMB_TO_SEARCH-------DN number
DELIV_ITEM_TO_SEARCH----
DN Item
-
DELIV_NUMB----
DN unmber
DELIV_ITEM----
DN Item
05-07-2010 12:29 PM
Hi ,
I hope the FM documentation will clear ur Doubt better.
Regards,
Rajesh S
12-28-2011 7:34 PM
How can I use this with ISU equipment receiveing? It's has subscreen for Inpection lot input.
Regards,
Andy nguyen
12-28-2011 8:37 PM
you have asked 4 questions in various forums, and you always asked these questions on other peoples threads. Do you really think it is good practice to hijack other peoples threads?
Do you have a problem in creating own threads and need some help?