BAPI for MIGO
HI frds,
Can any one provide BAPI's for the following scenarios
TC:MIGO
1.Goods receipt
2.Flag all the items of the GR
3.In excise Tab, No excise entry (06) to be released
4.In general Tab, to enter the delivery number
5.Post Document
PART:B
Pass the material document in TC:J1IG
1.Selece excise group based on the receiving plant code
2.Pass GR doc based generated as in the previous step
3.Pass OBD no in J_IEXCHDR & pick the excise invoice no, excise inv date & Plant (Series Group)
4.To open the details & save the doc.
Thanks in Advance
Regards,
Srikanth
HI,
will u pls let me know how to cature excise values while using BAPI_GOODSMVT_CREATE.
murali
Similar Messages
-
BAPI for MIGO with respect to Outbound delivery or Stk trfer pur order
please let me know is there any standard BAPI for MIGO transaction with respect to Outbound delivery or Stock transfer purchase order
try these...
BAPI_OUTB_DELIVERY_CONFIRM_DEC
BAPI_OUTB_DELIVERY_SAVEREPLICA
BAPI_OUTB_DELIVERY_SPLIT_DEC -
Update qty in delivery note through bapi for migo
hi im using bapi for migo upload
my requiremnt is to update QTY IN DELIVERY NOTE in migo.
i got the folowing error if i dont pass the quantity.
qty and/0r delivery indicator or final issue indicator missing
if i pass the quantity field then it is changing quantity in unity of entity and qty in SKU i dnt want to change this field
here is my code,
gmcode-gm_code = '01'.
ls_GOODSMVT_HEADER-pstng_date = tdate . "sy-datum.
ls_GOODSMVT_HEADER-doc_date = sy-datum.
ls_GOODSMVT_HEADER-pr_uname = sy-uname.
loop at itab.
ls_GOODSMVT_HEADER-REF_DOC_NO = itab-LFSNR.
it_goodsmvt-move_type = itab-BWART.
it_goodsmvt-po_number = itab-EBELN.
it_goodsmvt-PO_ITEM = '10'.
it_goodsmvt-STGE_LOC = itab-LGORT.
it_goodsmvt-QUANTITY = itab-LSMNG.
it_goodsmvt-BASE_UOM = 'KG'.
it_goodsmvt-material = 'RC1092'.
it_goodsmvt-entry_qnt = itab-LSMNG.
it_goodsmvt-ENTRY_UOM = 'KG'.
it_goodsmvt-mvt_ind = 'B'.
it_goodsmvt-plant = 'G001'.
it_goodsmvt-NO_MORE_GR = 'X'.
append it_goodsmvt.
clear it_goodsmvt.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = ls_GOODSMVT_HEADER
goodsmvt_code = gmcode-gm_code
TESTRUN = ' '
GOODSMVT_REF_EWM =
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT = lf_MATERIALDOCUMENT
MATDOCUMENTYEAR = lf_MATERIALDOCYEAR
tables
goodsmvt_item = it_goodsmvt
GOODSMVT_SERIALNUMBER =
return = return
GOODSMVT_SERV_PART_DATA =
EXTENSIONIN =
if return-type ca 'EA'.
rollback work.
message id '26' type 'I' number '000'
with return-message.
else.
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
wait up to 5 seconds.
endif.
select * fROM mseg
INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
where mblnr = lf_MATERIALDOCUMENT and
MJAHR = lf_MATERIALDOCYEAR.
LOOP AT IT_MSEG INTO WA_MSEG.
IF WA_MSEG-LSMNG IS INITIAL.
wa_mseg-lsmng = ITab-LSMNG.
UPDATE MSEG from wa_mseg.
commit work.
wait up to 5 seconds.
ENDIF.
ENDLOOP.
ENDLOOP.It is been done by implementing one implicit enhancement in FM: MAP2I_B2017_GM_ITEM_TO_IMSEG
I have added the below functionality at the end of the function module.
Just i have maped the ERFMG i.e ent_qnt(Received quanity) with LSMNG i.e qty.in del note
All best for others.
$$-Start: (1)----
$$
ENHANCEMENT 1 Z_EV_IMP_GOODSMOVEMENT. "active version
Populate the delivery note quantity and UoM
IF IMSEG-ERFMG IS NOT INITIAL.
MOVE IMSEG-ERFMG TO IMSEG-LSMNG.
MOVE IMSEG-ERFME TO IMSEG-LSMEH.
ENDIF.
ENDENHANCEMENT.
Thanks,
Mahesh.Gattu
Edited by: Maheshkumar gattu on Dec 3, 2010 4:35 PM -
Bapi for MIGO that can update freight supplier
dear all
we are presently using ALE_GOODSMVT_CREATE to create a migo document.
the requirement now is to update the frieght supplier too.
this present bapi is not able to update the supplier.
does any one faced this problem before and if yes how did it got overcome ??
regardscheck this link: It may not be exactly what you are looking for but will guide you:
BAPI for MIGO
cheers
Aveek -
i have created a bapi to upload data for MIGO transaction.. (GOODS RECEIPT-->PURCHASE ORDER)
i am getting the error " stock posting is not possible for this material "'.
when i create directly, it is posted.. while uploading through the program it shows the above error.
please suggest if anyone knows....
Thanks in advance,
Dhivya N.*& Report ZR_MIGO_UPLOAD
*& package name : zabap
*& transport request number : MIDK901443
*& program to upload goods movement
REPORT ZR_MIGO_UPLOAD.
***DATA DECLARATION***
type-POOLs: icon.
TYPES: BEGIN OF TY_GR_PO,
EBELN(10) TYPE c , "'PO NUMBEr
EBELP(10) TYPE c, "PO ITEM NUMBER
* LGOBE TYPE LGOBE, "STORAGE LOCATION DESCRIPTION
LGORT(10) TYPE c, "STORAGE LOCATION
XFELD TYPE c, "ITEM OK
GERNR(10) TYPE c, "SERIALNUMBER
END OF TY_GR_PO.
DATA: TA_GR_PO TYPE TABLE OF TY_GR_PO, "TABLE FOR GOODS RECEIPT PURCHASE ORDER
WA_GR_PO TYPE TY_GR_PO.
DATA: BLDAT TYPE BLDAT, "DOCUMENT DATE
BUDAT TYPE BUDAT, "POSTING DATE
WEVER TYPE WEVER. "VERSION FOR PRINTING GR SLIP
***BAPI DECLARATION***
DATA: BEGIN OF GM_HEAD OCCURS 0. "Material Document Header Data
INCLUDE STRUCTURE BAPI2017_GM_HEAD_01.
DATA: END OF GM_HEAD.
DATA: BEGIN OF GM_CODE OCCURS 0.
INCLUDE STRUCTURE BAPI2017_GM_CODE. "Assign Code to Transaction for Goods Movement
DATA: END OF GM_CODE.
DATA: BEGIN OF GM_RET OCCURS 0.
INCLUDE STRUCTURE BAPI2017_GM_HEAD_RET. "Material Document Number/Material Document Year
DATA: END OF GM_RET.
DATA: BEGIN OF GM_ITEM OCCURS 0.
INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE. "Material Document Items
DATA: END OF GM_ITEM.
DATA: BEGIN OF GM_SER OCCURS 0.
INCLUDE STRUCTURE BAPI2017_GM_SERIALNUMBER. "Serial Number
DATA: END OF GM_SER.
data: BEGIN OF ta_bapireturn OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
data: END OF ta_bapireturn.
***declaration of excel file handling table***
FIELD-SYMBOLS: <fs> type any. "field symbol for alsm_excel
DATA: TA_EXCEL TYPE TABLE OF ALSMEX_TABLINE, "table to contain excel sheet values
WA_EXCEL TYPE ALSMEX_TABLINE.
***declaration of other parameters***
data: V_brow type i VALUE 2, "BEGIN OF ROW
V_bcol type i value 1, "BEGIN OF COL
V_erow type i value 65536, "END OF ROW
V_ecol type i value 256. "END OF COLUMN
DATA: V_sear type string,
V_INDEX TYPE i,
V_tabix type sy-tabix, "current line.
v_lines type i. "total number of records
DATA: DATE TYPE DATS.
***SELECTION SCREEN***
***SELECTION SCREEN DESIGN***
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 3.
PARAMETERS: zCODE(2) TYPE C MATCHCODE OBJECT H_T158G,
zrefdoc type REFDOC,
version type WEVER.
SELECTION-SCREEN skip 5.
PARAMETERS: p_file type ibipparms-path.
SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN END OF BLOCK b1.
***SELECTION SCREEN VALUE REQUEST***
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME' "f4 help for file name
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
***SELECTION SCREEN EVENT***
AT SELECTION-SCREEN. "validation
if p_file <> ''.
V_sear = p_file.
SEARCH V_sear for '.xls'.
if sy-subrc <> 0.
message 'please provide excel file. it is not valid' type 'E'.
ENDIF.
ENDIF.
INITIALIZATION.
* DATE = '17.04.14'.
GM_HEAD-PSTNG_DATE = SY-DATUM.
GM_HEAD-DOC_DATE = SY-DATUM.
gm_head-pr_uname = sy-uname.
***START OF SELECTION***
START-OF-SELECTION.
gm_head-REF_DOC_NO = zrefdoc.
gm_head-VER_GR_GI_SLIP = version.
GM_CODE-GM_CODE = zCODE.
PERFORM EXCEL_UPLOAD.
PERFORM EXCEL_CONVERSION.
PERFORM NO_RECORDS.
END-OF-SELECTION.
PERFORM BAPI_ASSIGNMENT.
PERFORM BAPI_FM.
*& Form EXCEL_UPLOAD
* text
* --> p1 text
* <-- p2 text
FORM EXCEL_UPLOAD .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = V_BCOL
I_BEGIN_ROW = V_BROW
I_END_COL = V_ECOL
I_END_ROW = V_EROW
TABLES
INTERN = TA_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
ENDFORM. " EXCEL_UPLOAD
*& Form EXCEL_CONVERSION
* text
* --> p1 text
* <-- p2 text
FORM EXCEL_CONVERSION .
if ta_excel is NOT INITIAL.
sort ta_excel by row col.
clear wa_excel.
clear wa_GR_PO.
LOOP AT ta_excel INTO wa_excel.
move wa_excel-col to v_index.
ASSIGN COMPONENT v_index OF STRUCTURE wa_GR_PO to <fs>.
if sy-subrc = 0.
move wa_excel-value to <fs>.
ENDIF.
at END OF row.
append wa_GR_PO to ta_GR_PO.
clear wa_GR_PO.
ENDAT.
ENDLOOP.
else.
MESSAGE 'no data for conversion' type 'I'.
ENDIF.
ENDFORM. " EXCEL_CONVERSION
*& Form NO_RECORDS
* text
* --> p1 text
* <-- p2 text
FORM NO_RECORDS .
DESCRIBE TABLE ta_GR_PO LINES v_lines.
if v_lines = 0.
MESSAGE 'NO RECORDS TO UPLOAD' TYPE 'E'.
ENDIF.
ENDFORM. " NO_RECORDS
*& Form BAPI_ASSIGNMENT
* text
* --> p1 text
* <-- p2 text
FORM BAPI_ASSIGNMENT .
IF TA_GR_PO IS NOT INITIAL.
LOOP AT TA_GR_PO INTO WA_GR_PO.
gm_item-PO_NUMBER = wa_gr_po-ebeln.
GM_ITEM-STGE_LOC = WA_GR_PO-LGORT.
GM_ITEM-PO_ITEM = WA_GR_PO-EBELP.
GM_ITEM-NO_MORE_GR = 'X'."WA_GR_PO-XFELD'.
* GM_SER-SERIALNO = WA_GR_PO-GERNR.
gm_item-NO_MORE_GR = 1.
gm_item-ENTRY_QNT = 2.
gm_item-MOVE_TYPE = 101.
* gm_item-MVT_IND = 'B'.
gm_item-plant = 'P001'.
gm_item-move_stloc = 'FG01'.
* GM_ITEM-SPEC_STOCK = 'K'.
APPEND GM_ITEM.
APPEND GM_SER.
ENDLOOP.
ELSE.
MESSAGE 'DATA IS NOT UPLOADED' TYPE 'I'.
ENDIF.
ENDFORM. " BAPI_ASSIGNMENT
*& Form BAPI_FM
* text
* --> p1 text
* <-- p2 text
FORM BAPI_FM .
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = gm_head
GOODSMVT_CODE = gm_code
* TESTRUN = ' '
* GOODSMVT_REF_EWM =
IMPORTING
GOODSMVT_HEADRET = gm_ret
* MATERIALDOCUMENT =
* MATDOCUMENTYEAR =
TABLES
GOODSMVT_ITEM = gm_item
GOODSMVT_SERIALNUMBER = gm_ser
RETURN = ta_bapireturn
* GOODSMVT_SERV_PART_DATA =
* EXTENSIONIN =
if ta_bapireturn-type = 'S'.
write:/ icon_green_light as icon,
'success: Material document',gm_ret-mat_doc, 'is created for the GOODS RECEIPT- po number : ', wa_gr_po-ebeln,
/ 'reason:' , ta_bapireturn-message.
ELSEIF ta_bapireturn-type = 'E'.
write:/ icon_red_light as icon,
'error: Material document',gm_ret-mat_doc , 'is not created for the GOOD RECEIPT- po number : ', wa_gr_po-ebeln,
/ 'reason:' , ta_bapireturn-message.
ENDIF.
ENDFORM. " BAPI_FM -
BAPI for MIGO - Movement Type 122 - Return deliveries to vendor
Hi,
I've been reading about bapi's for migo and the most commom was: BAPI_GOODSMVT_CREATE
But I want to do a Movement Type 122, and that is not supported by the BAPI.
Any idea beside Batch Input ?Ildar,
Try this:
GOODSMVT_HEADER:
PSTNG_DATE
DOC_DATE
REF_DOC_NO (mandatory)
GOODSMVT_CODE = 01
GOODSMVT_ITEM
MATERIAL
PLANT
STGE_LOC
MOVE_TYPE = 122
ENTRY_QNT
PO_NUMBER
PO_ITEM
MVT_IND = B (reference to the document that has the request )
MOVE_REAS (mandatory as well)
Let me know if you need any further help.
Francisco Coutinho,
ToInovate -
Hi ,
I want to do Good receipt against the delivery order . This is for Migo .iam using BAPI_GOODSMVT_CREATE . Iam unable to get all the mandatory . iam geting an error saying goods movement is not possible for 101 movement type.
Thanks.hi,
u can use 501 type.
hope it will work .But i am not sure
thnks and rgds,
raghul -
Need BAPI for MIGO to create a Goods Receipt against PO &Outbound Delivery
Hi Friends,
GRNs (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
If PO Number = EKKO-EBELN GR against Purchase Order
= LIKP-VBELN GR against Outbound Delivery
Based on the above condition I need to create a Goods Receipt.
Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
The fields available are with us are...
Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number SLED
Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
Please provide sample code if possible.
Waiting for replies,
Thanks and Regards,
SudhaHi Friends,
GRNs (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
If PO Number = EKKO-EBELN GR against Purchase Order
= LIKP-VBELN GR against Outbound Delivery
Based on the above condition I need to create a Goods Receipt.
Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
The fields available are with us are...
Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number SLED
Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
Please provide sample code if possible.
Waiting for replies,
Thanks and Regards,
Sudha -
Upload data using bapi for migo
dear all,
i 'm faching froblem with migo
my requriment is : if u give one PO,is the input. under one PO we have a 1....N Bom s under one BOM we have a 1...N line items OK but quenty field was chaning accourding to our requriment. we need FOR BOM QNTY and LINE ITEM QNTY was chnging how it is possible or not please give me possiblites to me
i will be waiting for reply.
regards
eswarIssue is Fixed!
-
BAPI for MIGO Transfer Order Posting and STO
Hi
I am trying to post a transfer order thru MIGO using BAPI_GOODSMVT_CREATE. But could not able to identify the following fields :
1) Material Slip or Material Document number
2) Final Plant and storage location
3) Destination plant and storage location
4) Movement Type
Also I am trying to create a STO using BAPI_PO_CREATE1 but could not able to identify "Your Reference and Our Reference fields.
Please share your thoughts.Hi Bakshi ,
see the sample code to pass the material plant storage location nad Movement type..
t_goodsmvt_item-material = t_zciotr-matnr. "Materail
t_goodsmvt_item-plant = w_werks. "Plant
t_goodsmvt_item-stge_loc = w_lgort. "Storage Location
t_goodsmvt_item-move_type = w_bwart. "movement type
t_goodsmvt_item-entry_qnt = t_zciotr-wmeng.
t_goodsmvt_item-orderid = t_zciotr-aufnr.
t_goodsmvt_item-mvt_ind = 'F'.
APPEND t_goodsmvt_item.
t_goodsmvt_slno-matdoc_itm = 1.
t_goodsmvt_slno-serialno = t_zciotr-serialno.
APPEND t_goodsmvt_slno.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = t_goodsmvt_header
goodsmvt_code = t_goodsmvt_code
IMPORTING
goodsmvt_headret = w_docret
materialdocument = w_docno
TABLES
goodsmvt_item = t_goodsmvt_item
goodsmvt_serialnumber = t_goodsmvt_slno
return = t_goodsmvt_ret.
Regards,
Prabhudas -
BAPI for Reversal of Goods Receipt Purchase Order(Transaction : MIGO)
Hi all,
Is there any BAPI for the Reversal of posting the documents Goods receipt Purchase order
(Transaction: MIGO).
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.Hi,
Try this passing material doc and year.
* Cancel the goods movement (creates a reversal document)
CALL FUNCTION 'BAPI_GOODSMVT_CANCEL'
EXPORTING
materialdocument = g_material_doc
matdocumentyear = g_matdoc_year
TABLES
return = i_return.
Edited by: Raj on May 14, 2008 7:46 PM -
BAPI for Goods Issue (MIGO) movement type 351 with reference to PO
Hi,
Is there an BAPI for Goods issue in MIGO with reference to PO movement type 351, i tried using "BAPI_GOODSMVT_CREATE", but there is no PO field in this, is there any other BAPI's available for the same?
Thanks in Advance,
Santoshfor goods mvt type , the available is that itself . for 351 mvt type Po number is not required .
if its a must , create a Z bapi with additional field for PO and make it as reference . -
BAPI for J1IJ depot excise invoice required
Hi All,
Please let me know the BAPI to create depot excise invoice with J1IJ from a delivery.This require to automate the process.
Please let me know the parameters also.
Thanks'
Mukul KumarHi Mukul,
CIN does not support any BAPIs for goods receipts and excise updates.
However, CIN uses MB_MIGO_BADI definition and CIN_PLUG_IN_TO_MIGO implementation. You can create multiple implementations of this BAdI. You can use the same BAdI for single step capture and post of excise invoice in MIGO.
Regards,
Rajasree.. -
BDC for MIGO for GR OutBound Delivery( A01 & R05 ) from Movement Type 107 to 109
Hi,
I am stuck with a very typical situation need all your expertise and advices for a solution.
We are basically trying to create change the movement type from 107 to 109 through MIGO.
I have made a BDC recording for MIGO ( because we would like to track each delivery specifically under shipment , I know that there is a BAPI which is there to do this but it works fine if we do the shipment with Purchase Order as input which dont want in that manner )
Process:
1. Creating Production Order
2. Creating Purchase Order
3. Creating STO
4. Deliveries
5. PGI for Deliveries
6. Shipment for group of outbound Deliveries
I have created a z program where i am passing shipment number in the selection screen.
Then it would take all the deliveries for that shipment and pass each delivery to MIGO and process it and change the status from 107 to 109.
Interesting part here is, the code works absolutely perfect only from my ID. But when I test from other ID it is not executing, so to check where is the problem I have added mess_tab to the CALL TRANSACTION to capture what message is been populated for my ID comparing with others
Message Captured on Others ID's:
MSGID: 00
MSGNR: 344
MSGV1: SAPLMIGO
MSGV2: 1300
Message Captured on MY ID:
MSGID: MIGO
MSGNR: 012
MSGV1: 5000005802
MSGV2: (empty)
This is the problem this program is executing only on MY ID, rest all ID's it is not processing.
We have cross verified with security and basis regarding any authorization issues but nothing came up.
Please help me what could be the issue ( WHY it is processing successfully for my and WHY NOT for other ID's)
Below is the main code :
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL' " Converting Date format to DD/MM/YYYY
EXPORTING
DATE_INTERNAL = sy-datum
IMPORTING
DATE_EXTERNAL = lv_date_external
EXCEPTIONS
DATE_INTERNAL_IS_INVALID = 1
OTHERS = 2.
IF SY-SUBRC <> 0. "#EC NEEDED
* Implement suitable error handling here
ENDIF.
* Validating input shipment number with database table VTTP
SELECT VTTP~TKNUM
VTTP~TPNUM
VTTP~VBELN
FROM VTTP INNER JOIN VTTK
ON VTTP~TKNUM = VTTK~TKNUM
INTO TABLE IT_VTTP
WHERE VTTK~TKNUM = P_TKNUM
AND VTTK~STDIS = 'X'.
IF sy-subrc = 0.
* Validating all deliveries having same Delivery type or not
SELECT * FROM likp INTO TABLE it_likp FOR ALL ENTRIES IN it_vttp WHERE vbeln = it_vttp-vbeln
AND vbtyp = 'J'.
IF sy-subrc = 0.
CLEAR lv_lines.
LOOP AT it_likp INTO wa_likp.
REFRESH:it_vbfa,BDCDATA.
* Validating if Delivery Type = 109 (GR already done), or Delivery Type = 107 (must process for GR )
SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
* AND vbtyp_v = 'J'
AND bwart = '109'.
IF sy-subrc = 0.
lv_flag1 = 'X'.
ELSE.
SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
* AND vbtyp_v = 'J'
AND bwart = '107'.
IF sy-subrc NE 0.
MESSAGE 'No Deliveries with Movement Type "107" ' TYPE 'I'.
ELSE.
lv_flag2 = 'X'.
lv_lines = lv_lines + 1.
** BDC for MIGO
perform bdc_dynpro using 'SAPLMIGO' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=OK_GO'.
perform bdc_field using 'GODYNPRO-ACTION'
'A01'.
perform bdc_field using 'GODYNPRO-REFDOC'
'R05'.
perform bdc_field using 'GODEFAULT_TV-BWART'
'109'.
perform bdc_field using 'BDC_CURSOR'
'GODYNPRO-OUTBOUND_DELIVERY'.
perform bdc_field using 'GODYNPRO-OUTBOUND_DELIVERY'
wa_likp-vbeln. "'80019574'.
perform bdc_field using 'GOHEAD-BLDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-BUDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-WEVER'
'1'.
perform bdc_dynpro using 'SAPLMIGO' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=OK_POST1'.
perform bdc_field using 'GODEFAULT_TV-BWART'
'109'.
perform bdc_field using 'GOHEAD-BLDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-LFSNR'
wa_likp-vbeln. "'0080019574'.
perform bdc_field using 'GOHEAD-BUDAT'
lv_date_external. "'04/29/2015'.
perform bdc_field using 'GOHEAD-WEVER'
'1'.
perform bdc_field using 'GODYNPRO-DETAIL_ZEILE'
' 1'.
perform bdc_field using 'GOITEM-ERFME'
'EA'.
perform bdc_field using 'GOITEM-ERFMG'
'1'.
perform bdc_field using 'GOITEM-LSMNG'
'1'.
perform bdc_field using 'GOITEM-LSMEH'
'EA'.
perform bdc_field using 'GOITEM-MIGO_ELIKZ'
'1'.
perform bdc_field using 'GOITEM-BWART'
'109'.
perform bdc_field using 'GOITEM-LGOBE'
'RX Cross-docking'.
perform bdc_field using 'BDC_CURSOR'
'GODYNPRO-DETAIL_TAKE'.
perform bdc_field using 'GODYNPRO-DETAIL_TAKE'
'X'.
PERFORM bdc_dynpro USING 'SAPLMIGO' '1300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'G_TIP_DONT_SHOW_AGAIN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=OK_TIP_GO'.
PERFORM bdc_field USING 'G_TIP_DONT_SHOW_AGAIN'
'X'.
*& Avoid unncessary screens to populate while processing background.
LV_OPTIONS-DISMODE = 'N'.
LV_OPTIONS-UPDMODE = 'S'.
LV_OPTIONS-NOBINPT = 'X'.
CALL TRANSACTION 'MIGO' USING BDCDATA OPTIONS FROM LV_OPTIONS MESSAGES INTO IT_MESSTAB1 .
WAIT UP TO 1 SECONDS.
DELETE IT_MESSTAB1 WHERE MSGTYP NE 'E'.
IF IT_MESSTAB1[] IS NOT INITIAL.
APPEND LINES OF IT_MESSTAB1 TO IT_MESSTAB.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
MESSAGE 'Shipment Number does not exists Or not Planned' TYPE 'E'.
ENDIF.
ELSE.
MESSAGE 'Please insert Shipment Number' TYPE 'E'.
ENDIF.
IF lv_flag1 = 'X' AND lv_flag2 = 'X'.
MESSAGE 'This shipment is processed with an inconsistent goods receipt' TYPE 'I'.
ELSEIF lv_flag1 = 'X'.
MESSAGE 'Shipment already been processed for these deliveries' TYPE 'I'.
ELSEIF lv_flag2 = 'X'.
lv_lines1 = lv_lines.
CONDENSE lv_lines1 NO-GAPS .
CONCATENATE lv_lines1 'Goods Receipt are posted for the shipment '
INTO lv_message SEPARATED BY space.
MESSAGE lv_message TYPE 'I'.
ENDIF.
* Display Messages from Message TAB.
DELETE ADJACENT DUPLICATES FROM IT_MESSTAB.
DATA:lv_msg TYPE string.
LOOP AT IT_MESSTAB INTO WA_MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_MESSTAB-MSGID
NO = WA_MESSTAB-MSGNR
V1 = WA_MESSTAB-MSGV1
V2 = WA_MESSTAB-MSGV2
V3 = WA_MESSTAB-MSGV3
V4 = WA_MESSTAB-MSGV4
IMPORTING
MSG = lv_msg
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
WRITE:/ lv_msg.
ENDLOOP.
* Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO. "#EC PF_NO_TYPE
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
* Insert field *
FORM BDC_FIELD USING FNAM FVAL. "#EC PF_NO_TYPE
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM.
Thanks,
SriniHi Rob,
Thanks for quick reply.
I have checked the NOTE : 304122
But there in the NOTE it says ( " BAPI, BAPI_GOODSMVT_CANCEL, BAPI_GOODSMVT_CREATE, CNTL_ERROR" )
These BAPI's work perfectly for (purchase order as input type), but here out type is ( A01 & R05 ) we are giving DELIVERY NUMBER as input to MIGO.
So for this scenario we cannot use those BAPI's mentioned in the NOTE.
Also as stated earlier in the message interesting part is
"The code works absolutely perfect only from my ID. But when I test from other ID it is not executing. Code is working exactly as expected ONLY to my ID. When i try to execute the same code from another's ID it is not working"
So what do you think might be the issue? -
Hi Freinds,
I need to trigger the creation of a stock from a BAPI.
So in MIGO i am using movement type 501 and type as Others.
I could see a bapi BAPI_GOODSMVT_CREATE for that .But in the checktable for the tcodes t158g , i could not find MIGO.So i doubt if i can use this BAPI for the creation of a stock.
Please let me know if there is a BAPI for the creation of stocks.
Thanks and Regards,
AnoopHello,
Use the belwo bapi.
BAPI_WHSE_TO_CREATE_STOCK
Reward if helps.
Thanks,
Krishna
Maybe you are looking for
-
Error while executing queries on 0FIGL_M30
Dear Experts From the business content we have installed a multiprovider 0FIGL_M30 and corresponding queries as well, data load was also sucessful but when we tried to execute queries it gives an error first error message is "0ACDOC_CC_P is not a val
-
How to Refresh or TaskFlow from pageFragment button?
Hello im using Jdev 11.1.1.3.0, and i have a task flow with a managed bean with pageFlow scope, this managed bean defines a lot of parameters for my page framents that are on my task flow. I need a custom on this bean to programatically refresh the t
-
How to define a DSN without using a tnsnames.ora on the PC client machine
Hi, Client : Windows XP with Oracle9i ODBC driver Server : Oracle 10 on Solaris I need to define a DSN which does not rely on tnsnames.ora on the client machine. I tried to use a file dsn, but without success, because I don't know the parameters to u
-
HELP: signer info doesn't match info of other classes in the same package
I have several jars which need to be signed. They contain several applications and packages which are split up based on which parts are needed by server vs client code. How do I get rid of this error? I'm signing all the jars using the keytool and ja
-
Embeded flv music in swf?
A client wants a music player that has embedded music, rather than streaming from a separate mp3 file. I explained the file would be much faster loading if we could stream it, but he said something about how that wouldn't work with his .net framework