BAPI_GOODSMVT_CREATE for 415Q transfer posting
Can someone comment on using this BAPI for a 415 movement type? I am able to post a 411 and a 412 which achieves the same net effect when I want to move stock from one WBS element to another.
However, our WM system requires a single transfer order as if we posted 415Q via transaction MB1B.
Thanks for suggestions or code snippets if you have them.
>Ray Mannion
Well, it's 9:30 at night and I managed to figure it out so I thought the least I could do is to post it to the group here.
In this code, PWA_MAIN is my main work area and lwa_items has the structure asked for in BAPI_GOODSMVT_CREATE.
lwa_items-move_mat =
lwa_items-material = pwa_main-matnr.
lwa_items-move_plant =
lwa_items-plant = pwa_main-werks.
lwa_items-move_stloc =
lwa_items-stge_loc = pwa_main-lgort.
lwa_items-move_batch =
lwa_items-batch = pwa_main-charg.
lwa_items-move_type = '415'.
lwa_items-spec_stock = c_q.
The key is knowing how to populate the WBS elements. In this case, I have the "old" or "from" WBS as PAPSPNR1 and the "new" or "to" WBS as PAPSPNR2.
lwa_items-wbs_elem = papspnr2. lwa_items-val_wbs_elem = papspnr1.
lwa_items-entry_qnt = pwa_main-verme.
lwa_items-entry_uom = pwa_main-meins.
We use a combination of T333 and T320 to determine the storage type and storage bin. (stge_type_pc, stge_bin_pc)
Incidently, I tried using XSTOB = 'X' which added a 416 movement record.
I recommend playing with it in SE37 and creating test variants until you get it right before trying to add the call to your program!
Cheers,
Ray
Similar Messages
-
Output Determination Configuration Setting for GoodsIssue(Transfer Posting)
Hello Gurus,
Can any one give the details for Output Determination Configuration Setting for Goods Issue(Transfer Posting).
Thanks N Regards,
Venu MGhi,
PRINT OUT OF MATERIAL DOCUMENT AT GI/Transfer posting:
1. Maintain the Printer Name in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Printer Setting
2. Ensured in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Item Print Indicator, 1 stands for Matl Doc print out
3. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Print Version, maintain Print Version 2
4. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Maintain Print Indicator for GI/Transfer Posting Documents
5. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Maintain Output Types, for the Output types WE01, WE02 and WE03, ensure the foll:
a. Default Values: Dispatch Time is 3 or 4 as per reqmt. and Tr medium is 1
b. Print Parameter is 7
6. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Printer Det->Pr Det by Pl/StoLoc, maintain the Output device for all your Plants
7. In MN21, for Tr Type WE, Print Version 3, maintain Print Item as 1.(Condition records)
8. While doing MIGO, ensured that in General Tab, you get "3 Collective Slip" beside the Print Indicator and you tick mark the field.
Now go to MB90 entered the output type as WE01, Tr m as 1, Sort or. 01, Pro.mode as 01, and executed. Sytem outputted all the material documents that has to be taken print out.
Regards
Priyanka.P -
BAPI_GOODSMVT_CREATE error - Duplicate Transfer Posting
Hello,
I'm using BAPI_GOODSMVT_CREATE for transfer posting with GM Code 04 and Movement Type 311.
But the posted material document is incorrect. Instead of 2 lines only, the line items becomes 4.
Could anyone please help me?
Thanks in advance!Hi Gold Yap,
I have done the Transfer posting by using BAPI_GOODSMVT_CREATE.
Below i added my sample code. Please go through.
Report XYZ.
TABLES : mslb , mchb .
DATA : BEGIN OF i_stock OCCURS 0 ,
matnr LIKE mslb-matnr ,
werks LIKE mslb-werks ,
charg LIKE mslb-charg ,
sobkz LIKE mslb-sobkz,
lifnr LIKE mslb-lifnr ,
lblab LIKE mslb-lblab ,
END OF i_stock .
DATA : BEGIN OF i_batch OCCURS 0 ,
matnr LIKE mchb-matnr ,
werks LIKE mchb-werks ,
lgort LIKE mchb-lgort ,
charg LIKE mchb-charg ,
clabs LIKE mchb-clabs ,
END OF i_batch .
DATA: BEGIN OF it_mess OCCURS 10,
charg LIKE mslb-charg ,
lgort LIKE mchb-lgort,
lifnr LIKE mslb-lifnr,
err LIKE bapiret2-message,
flag,
END OF it_mess.
DATA match.
DATA : header LIKE bapi2017_gm_head_01 . "OCCURS 0 WITH HEADER LINE .
DATA : code LIKE bapi2017_gm_code . " OCCURS 0 WITH HEADER LINE .
DATA : item LIKE bapi2017_gm_item_create OCCURS 0 WITH HEADER LINE.
DATA : i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE .
DATA : matdoc LIKE bapi2017_gm_head_ret .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .
SELECT-OPTIONS : s_matnr FOR mslb-matnr .
PARAMETERS : p_werks LIKE mslb-werks DEFAULT 'TPFB' .
SELECTION-SCREEN END OF BLOCK b1 .
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN .
IF screen-name = 'P_WERKS' .
screen-input = '0' .
MODIFY SCREEN .
CLEAR screen .
ENDIF.
ENDLOOP .
START-OF-SELECTION .
CLEAR: i_stock[],i_stock.
CLEAR: it_mess[],it_mess.
CLEAR: i_batch[],i_batch.
SELECT matnr werks charg sobkz lifnr lblab
FROM mslb INTO TABLE i_stock
WHERE matnr IN s_matnr
AND werks = p_werks.
DELETE i_stock WHERE sobkz <> 'O'.
DELETE i_stock WHERE lblab <= '0.000'.
IF i_stock[] IS INITIAL .
MESSAGE 'NO Data Available In MSLB Table' TYPE 'S' .
ELSE.
DELETE i_stock WHERE charg = 'COMMON' .
IF i_stock[] IS INITIAL .
MESSAGE 'Already Transfer Posting to Common Batch' TYPE 'S' .
ENDIF.
ENDIF .
SELECT matnr werks lgort charg clabs
FROM mchb
INTO TABLE i_batch
WHERE matnr IN s_matnr
AND werks = p_werks .
DELETE i_batch WHERE clabs <= '0.000'.
IF i_batch[] IS INITIAL .
MESSAGE 'NO Data Available In MCHB Table' TYPE 'S' .
ELSE .
DELETE i_batch WHERE charg = 'COMMON' .
IF i_batch[] IS INITIAL .
MESSAGE 'Already Transfer Posting to Common Batch' TYPE 'S' .
ENDIF.
ENDIF .
CLEAR : header,code,matdoc .
header-pstng_date = sy-datum.
header-doc_date = sy-datum.
header-pr_uname = sy-uname.
header-header_txt = 'Transfer Posting'.
code-gm_code = '04'.
SORT i_batch BY matnr werks charg.
LOOP AT i_batch.
CLEAR: item[],item.
item-material = i_batch-matnr.
item-plant = i_batch-werks.
item-batch = i_batch-charg.
item-entry_qnt = i_batch-clabs .
item-stge_loc = i_batch-lgort .
item-move_type = '309'.
item-move_batch = 'COMMON'.
APPEND item .
CLEAR item .
match = 'X'.
PERFORM bapi_run USING match.
ENDLOOP.
LOOP AT i_stock .
CLEAR: item[],item.
item-material = i_stock-matnr.
item-plant = i_stock-werks.
item-batch = i_stock-charg.
item-vendor = i_stock-lifnr .
item-entry_qnt = i_stock-lblab .
item-move_type = '309'.
item-spec_stock = 'O'.
item-move_batch = 'COMMON'.
APPEND item .
CLEAR item .
match = 'Y'.
PERFORM bapi_run USING match.
ENDLOOP.
IF i_stock[] IS NOT INITIAL OR i_batch[] IS NOT INITIAL .
IF it_mess[] IS INITIAL.
MESSAGE 'Transfer Posted Successfully' TYPE 'S' .
ELSE.
SORT it_mess BY charg err.
WRITE:/2 'Batch',11'Location',20'Vendor'.
LOOP AT it_mess.
AT NEW charg.
SKIP.
ENDAT.
IF it_mess-flag = 'X'.
WRITE: /2 it_mess-charg COLOR 6, it_mess-lgort COLOR 3
INTENSIFIED OFF,it_mess-lifnr COLOR 2 INTENSIFIED OFF.
ENDIF.
WRITE: /10 it_mess-err.
ENDLOOP.
ENDIF.
ENDIF .
*& Form bapi_run
text
--> p1 text
<-- p2 text
FORM bapi_run USING match .
CLEAR: i_return[],i_return.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = header
goodsmvt_code = code
TABLES
goodsmvt_item = item
return = i_return.
IF i_return[] IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ELSEIF i_return[] IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
LOOP AT i_return WHERE type = 'E'.
it_mess-charg = i_stock-charg.
IF match = 'X'.
it_mess-lgort = i_batch-lgort.
ELSEIF match = 'Y'.
it_mess-lifnr = i_stock-lifnr.
ENDIF.
it_mess-err = i_return-message.
IF sy-tabix = 1.
it_mess-flag = 'X'.
ENDIF.
APPEND it_mess.
CLEAR it_mess.
ENDLOOP.
ENDIF.
ENDFORM. " bapi_run
Regards,
S.C.K -
Create a subsequent Goods Movement for a transfer posting
Hi Team,
I have a scenario where the users will create a Good Movement document for transfer posting. The Stock of Material "A" is transferred to stock of Material "B" using the movement types 561 etc. Now the quantity is reduced from unrestricted stock of "A" and posted to "Stock in Transfer/Transit" of "B". The requirement is to create another Goods Movement document immediately after the above transfer posting is completed and use movement type 101 to post the same quantity to unrestricted of "B".
I tried searching for use exits and could not find a relevant one "After Save" for goods movement online transaction. I found the MB_GOODS_MOVEMENT_UPDATE Badi but don't know how to create another goods movement document while in the update task. I'm concerned that if I call a BAPI or BDC inside the update task, it might conflict with the current transaction (transfer posting). Looking for your guidance.Hi Deepali,
You can use the userexit ' ZXMCBU02 ' to write your own code. This user exit gets triggered for almost all the goods movement transaction.
There is also a very similar BADI which you can use which gets triggered for every goods movement transaction.
I would like to know the BADI feel free to let me know. I think the above user exit should server your purpose.
Hope this is useful for you.
Cheers
VJ -
User Exit for MIGO(Transfer Posting)
Is there any user exit for transfer posting by MIGO?
if so plz give the names of user exits related to it.....
Awaiting for ur reply..............USER EXIT
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.sap-img.com/ab038.htm
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
Transaction Code - MIGO Goods Movement
Exit Name Description
MBCF0002 Customer function exit: Segment text in material doc. item
MBCF0005 Material document item for goods receipt/issue slip
MBCF0006 Customer function for WBS element
MBCF0007 Customer function exit: Updating a reservation
MBCF0009 Filling the storage location field
MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1
MBCF0011 Read from RESB and RKPF for print list in MB26
MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.
No of Exits: 8
Rewards if useful.........
Minal -
BAPI_GOODSMVT_CREATE: move 309 for transfer posting - change of sales order
Hello Experts,
I'm trying to use BAPI_GOODSMVT_CREATE to transfer the material from one sales order to another.
But that doesn't seem to work.
ls_goodsmvt_header-pstng_date = sy-datum.
ls_goodsmvt_header-doc_date = sy-datum.
ls_goodsmvt_code-gm_code = '04'.
ls_goodsmvt_item-material = ls_outtab_l-matnr.
ls_goodsmvt_item-plant = ls_outtab_l-werks.
ls_goodsmvt_item-stge_loc = ls_outtab_l-lgort.
ls_goodsmvt_item-move_mat = ls_outtab_l-matnr.
ls_goodsmvt_item-move_plant = ls_outtab_l-werks.
ls_goodsmvt_item-move_stloc = ls_outtab_l-lgort.
ls_goodsmvt_item-move_type = '309'.
ls_goodsmvt_item-mvt_ind = ''.
ls_goodsmvt_item-entry_qnt = ls_outtab_l-kalab.
ls_goodsmvt_item-entry_uom = 'EA'.
ls_goodsmvt_item-spec_stock = 'E'.
ls_goodsmvt_item-val_sales_ord = ls_outtab_l-vbeln.
ls_goodsmvt_item-val_s_ord_item = ls_outtab_l-posnr.
ls_goodsmvt_item-sales_ord = ls_outtab_r-vbeln.
ls_goodsmvt_item-s_ord_item = ls_outtab_r-posnr.
" ls_goodsmvt_item-sched_line = '000'.
APPEND ls_goodsmvt_item TO lt_goodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = ls_goodsmvt_header
goodsmvt_code = ls_goodsmvt_code
testrun = ''
IMPORTING
goodsmvt_headret = ls_goodsmvt_headret
materialdocument = lv_materialdocument
matdocumentyear = lv_matdocumentyear
TABLES
goodsmvt_item = lt_goodsmvt_item
return = lt_return.
Right now i supply val_sales_ord with destination order number, and sales_ord with source. But I'm not really sure about that, which is the destination, and which is source sales order number parameter in itemline, val_sales_ord or sales_ord? Or maybe it doesnt work like that?
Thanks for any help,So after some time i found out where the flow of bapi and migo differ, this is also, where the field KDAUF gets reseted, and the cause of not posting material document correctly:
Starts in line 59 of MM07MFU0_UMLAGERUNG_PRUEFEN:
* The old fieldselection (T156B) is not valid for a transfer posting
* from MIGO
IF NOT vm07m-xstor = zwei AND xmigo <> x.
IF dm07m-fausw+55(1) = minus.
CLEAR mseg-ummat.
ENDIF.
IF dm07m-fausw+56(1) = minus.
CLEAR mseg-umwrk.
ENDIF.
IF dm07m-fausw+57(1) = minus.
CLEAR mseg-umlgo.
ENDIF.
IF dm07m-fausw+64(1) = minus.
CLEAR mseg-umcha.
ENDIF.
IF NOT vm07m-kzbwa = kzbwa-01 AND
NOT vm07m-kzbwa = kzbwa-05 AND
NOT vm07m-kzbwa = kzbwa-07.
CLEAR: mseg-umbar.
ENDIF.
" the condition below is the source of my problems
IF dm07m-fausw+60(1) = minus.
CLEAR: mseg-kdauf, mseg-kdpos.
ENDIF.
IF dm07m-fausw+62(1) = minus.
CLEAR mseg-ps_psp_pnr.
ENDIF.
ENDIF.
I changed the value minus '-' of dm07m-fausw+60(1) to a dot '.', and the bapi worked like a charm. I am just not sure if I can change the records of T156B just like that, I guess not a good idea.
Still i have no solution... -
How to use the BAPI_GOODSMVT_CREATE for Transfer posting Sales order
Hi Friends,
How to use the Bapi BAPI_GOODSMVT_CREATE for transfer posting sales order to sales order.
pls, send the list of parameteres to pass to the bapi, if program avail please send it to me.
Thanks in advance
ShankarYou have to pass Header and GM code as the INput parameters for uing this BAPI....GM code would be structure.
Also you have to pass the INternal table Item for the goods mvt cxreate which will contains
BATCH.
MOVE_TYPE.
ENTRY_QNT.
MOVE_PLANT.
MOVE_STLOC.
MOVE_BATCH.
MOVE_REAS
these parameters.
Regards,
Sushil. -
Batch input for BAPI_GOODSMVT_CREATE - Transfer posting
Hi all,
I'm now trying to do a batch input in this program for transfer posting of stocks.
Am i able to upload the input through an external source for example, Excel spreadsheet?
May i know how do i indicate in the program the source of my batch input?Hello Calibertto,
You can upload excel file for batch input or bapi.
Firstly : Upload to excel file.
Secondly : Append itab from excel file.
Thirdly : Make loop at itab.
Finally : Fill batch input/bapi for every itab record.
Best regards. -
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? -
Estimated,
I have to make a move between storage location of material that is blocked with status (movement 325). For that I'm trying on the Bapi MB_CREATE_GOODS_MOVEMENT and run with the same parameters as when I review the transaction MIGO_TR, but the structure EMSEG gives me the message number M7096 "Goods movement not possible with mvmt type 325". What could be wrong? and tried doing the Bapi commit, but still gives me error. It also showed the Bapi BAPI_GOODSMVT_CREATE and throws me the same message. Please I am desperate.
Thanks.Hi,
You can't use function module MB_CREATE_GOODS_MOVEMENT for movement 325, since that function module is used for Goods Issue for delivery.
You should use bapi "BAPI_GOODSMVT_CREATE" for this movement 325 instead.
Passing GOODSMVT_CODE = 04 (for Transfer Posting)
The following thread has a sample code of above BAPI, then do adjustment accordingly as per your requirement.
Re: i want to Stock upload with movement 561 and t code is mb1c
Cheers, -
BAPI_GOODSMVT_CREATE + Transfer posting
Hi All,
I have to move the goods from storage location 110D to 116D.
For that Iu2019m using BAPI: BAPI_GOODSMVT_CREATE with GM_CODE = 4 (Transfer posting)
After executing the BAPI, Iu2019m checking the RETURN value, if there is no error message, Then Iu2019m committing using BAPI_TRANSACTION_COMMIT.
Result of my program:
Before the BAPI is called, the storage location stge_loc is 110D and move_stloc = 116D. Which is correct.
I can see that expected result in MB51 transaction where goods is moved from storage location 110D to 116D, which is correct. But when I runned IW32 with that order, Iu2019m seeing the goods moved to different location, which is incorrect.
Using MB51, when i checked, the storage location from(110D) and to(116D), both are showing correctly and it is correctly updated in MSEG table. But in RESB table, it is still showing 110D
So, could you pls suggest me where I went wrong and suggest me any other logic.
Thanks & Regards,
Harsha Ramaiah
Edited by: Harsha Ramaiah on Jun 30, 2010 8:11 AMHi,
Data in RESB is Reservation data(Tcode:MB21/22/23), it has no actual effect on storage(means that the movement is not actually happened), so in your case , maybe you need to change the reservation , not to do transfer posting.
regards,
Pole -
Transfer Posting for Line Items between Reconciliation Account
HI,
My customer want to transfer costing the line items between a old Reconciliation Account and a New Reconciliaton Account.
For example, i have a Account Group Vendor with a old Reconciliation Account " Vendor CEE".
This reconciliation account has the line items concern differents Vendors.
Edit a new Account Group calling ( CEE) to replace a Old Account Group.
After changing in Vendor Master data the Reconciliation account, we need to transfer posting the line items in the new account reconciliation
In Sap system is there a report can do it? Can you help me?
RegardsHi,
Thank you for the answer.
I did that, and exactly:
- In Trx Obbw insert the reconciliation account and Adjustement account.
- and execute the trx FAGLF101 in test but the sap system give me the following error:
" Account determination for transaction A00 is missing for account 0205016001 ZM P001 "
Message no. FR005
Can you help me?
Regards
Edited by: Marika De Cesare on Oct 18, 2011 1:06 PM -
Transfer posting (OASV) issue for the existing Intangible Assets
Hi SAP Experts,
In our system the APC and Acc. Dep. for ord. dep. has maintained the same G/L Account (A090) so due to this in Fin. Statement it shows the Net Book Value. Now, our client wants to migrate to IFRS, as per this it has to show like ( Intangible Assets - Acc. amortization - Acc. Impairment Loss). Now, I have created new account i.e. 'Accumulated Amortization for Intangible Assets A/c and removed the old G/L A/c (the one which is same for both APC and Acc. Dep.). Now, the old G/L has the APC and Acc. Dep. values so I need to transfer the Acc. Dep. from old G/L to New G/L A/c by using OASV (Transfer posting).
If I make the transfer posting like (the both G/L Accounts are Recon. A/cs)*
Debit Old G/L A/c - xx,xx,xxx
Credit New G/L A/c - xx,xx,xxx
Is it any impact on the values (Intangible Assets) Dep. Area wise? Since, APC and Acc. Dep. already posted to old A/c up to this point of time. Another doubt is, while posting the above entry shall I need to switch off (Reset) Recon. A/c for this Intangible Assets? OR without Reset Recon. A/c can I post this transfer posting? Is this correct procedure or other than this is there any other alternative?
we have 9 Dep. Areas out of which 3 Dep. Areas have posting indicator as '1'. In that out of 3 Dep. Areas one Dep. Area namely 'Impairment Loss' is there but there are no positings till now. After config. change it should allow ABIF tr. that we completed already.
Could anyone explain why this 'Investment Support' Dep. Area (Impairment Loss) doesn't allow APC values by default?
Thanks in advance.
Best Regards,
Sri.Hi Sri,
Let me clarify your points individually.
1) From system the prospective, it does not make any diff in functionality for a tangable asset or an intangable asset.
2) Add the new GL account in the respective account dtermination as a balance sheet account for accum dep. (while adding, the GL account should be as recon account)
3) Please switch off the recon account indicator in the both GL accounts with OAMK.
For Ex: Lets say you have already posted APC value 10000 Dr and Accum dep 2000 Cr to the old GL account, so the net book value will be 8000 Dr.
In this case Please find out the total value of line items (2000 Cr as per the above example) for accum dep, that was already posted to the old GL account.
4) Post a journal voucher through F-02 like
Old G/L A/c Dr - 2000
New G/L A/c Cr - 2000
So after passing this entry you will find account balance as 8000 Dr in old GL account and 2000 Cr in new GL account.
5) after passing the above entry you need to switch on the recon account for both the GL accounts
Hope this will help.
Thanks,
Srinu -
BAPI_GOODSMVT_CREATE for GRN posting
Hi Experts,
I am using BAPI_GOODSMVT_CREATE for posting GRN against Purchase Order.
I want to post Quantity in Delivery note(LSMNG) and Unit of Measure From Delivery Note(LSMEH) also.
I used itab-QUANTITY = '1'.
itab-BASE_UOM = 'L'.
but it is not getting updated properly.
I am getting document number and GRN has been done against Purchase Order using this BAPI.All other fields are properly getting updated except these 2 fields Qty in delivery note and unit of delivery note. Can i pass these 2 field values using this BAPI or do I need to use any other BAPI. Is there any BAPI for MIGO instead of MB01?
Can any one help me to pass these values through BAPI
Regards,
SamHi,
you can update LSMNG quantity using EXTENSIONIN structures of BAPI_GOODSMVT_CREATE.
The steps are the following:
Add LSMNG field in BAPI_TE_XMSEG structure create an appending structure (char field)
By SE19 transaction create the Enhancement Spot starting from MB_GOODSMOVEMENT
Define the Badi Implementation choosing MB_BAPI_GOODSMVT_CREATE Badi Definition implementing a new customer class.
Remember to choose to copy the class with the source code of methods.
In The method IF_EX_MB_Hi, you can update LSMNG quantity using EXTENSIONIN structures of BAPI_GOODSMVT_CREATE. The steps are the following: Add LSMNG field in BAPI_TE_XMSEG structure create an appending structure (char field) By SE19 transaction create the Enhancement Spot starting from MB_GOODSMOVEMENT Define the Badi Implementation choosing MB_BAPI_GOODSMVT_CREATE Badi Definition implementing a new customer class.
Remember to choose to copy the class with the source code of methods.
In the method IF_EX_MB_BAPI_GOODSMVT_CREATE~EXTENSIONIN_TO_MATDOC you will find the following source code:
DATA: c_lenstruc TYPE i VALUE 30,
wa_bapi_mb_header TYPE bapi_te_xmkpf,
wa_bapi_mb_item TYPE bapi_te_xmseg,
wa_extension_in TYPE bapiparex.
FIELD-SYMBOLS: TYPE imseg.
CHECK NOT extension_in[] IS INITIAL.
* Analyze IMSEG for document structure and assign LINE_IDs if necessary
CALL METHOD cl_mmim_line_id_manager=>analyze_mb_create
CHANGING ct_imseg = ct_imseg[]
EXCEPTIONS duplicate_line_id = 1
OTHERS = 2.
LOOP AT extension_in INTO wa_extension_in.
CASE wa_extension_in-structure.
* extension of MKPF
WHEN 'BAPI_TE_XMKPF'.
MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_header.
MOVE-CORRESPONDING wa_bapi_mb_header TO cs_imkpf.
* extension of MSEG
WHEN 'BAPI_TE_XMSEG'.
MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_item.
READ TABLE ct_imseg WITH KEY line_id = wa_bapi_mb_item-matdoc_itm ASSIGNING <fs_imseg>.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING wa_bapi_mb_item TO <fs_imseg>.
ENDIF.
ENDCASE.
ENDLOOP.
Then you have to call BAPI_GOODSMVT_CREATE using extensionin in the following way:
* Fill goodsmvt_header structures
goodsmvt_header-........
* Fill goodsmvt_item-position
Loop at it_position.
goodsmvt_item-..........
wf_line_id = wf_line_id + 1.
goodsmvt_item-line_id = wf_line_id.
APPEND goodsmvt_item.
CLEAR extensionin.
MOVE 'BAPI_TE_XMSEG' TO extensionin-structure.
MOVE wf_line_id+2(4) TO extensionin-valuepart1+14(4).
MOVE LSMNG TO extensionin-valuepart1+18(16).
APPEND extensionin.
endloop.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = goodsmvt_header
goodsmvt_code = goodsmvt_code
* TESTRUN = ' '
goodsmvt_ref_ewm = goodsmvt_ref_ewm
IMPORTING
* GOODSMVT_HEADRET =
materialdocument = materialdocument
matdocumentyear = matdocumentyear
TABLES
goodsmvt_item = goodsmvt_item
* GOODSMVT_SERIALNUMBER =
return = return
extensionin = extensionin.
Hope it helps
Lorenzo -
Dynamic Availability Check for Goods Issue,Transfer Posting
Dear All,
Can anyone explain the Dynamic Availability Check??
I mean the relevance on setting this indicator for a mov.type?
In OMCM & OMCP I have defined a Checking Rule & also assigned the same to a Mov.type as well the transaction code?
whether the Dynamic Availability Check concept is same in case of sales ie Say I have a Stock of 100 qtys for a material in a plant & in the availability Scope of Check I have ticked the include safety stock.
In my material master I have a safety stock of 500 qtys.
So when I do a transfer posting for this material with Qty as 200, System should allow me do proceed as in my availability check I have enabled the safety stock option.
But this is not happening & I am getting an error message as deficit of stock 100 nos. Also what is use of setting the dynamic availability check indicator for my mov.type as A - Warning message , B - Error Message etc..
Kindly suggest valuable inputs.
Thanks & Regards,For e.g. there is Available Stock = 1000 qty and safety stock in material master = 500 qty then system will allow you to use 1000 qty only not 1500 qty
This is only used for availability check purpose whether system it should be considered or not?
And following indicators means;
A W mess. only issued in the case of non-availability
B E mess. only issued in the case of non-availability
E Message in any case: W mess. for non-avail., otherw. S mess.
F Message in any case: E mess. for non-avail., otherw. S mess.
S Availability check only with simulation
The above indicators indicate whether the system is to check for existing material requirements.
Award appropriately once the thread is answered.
Maybe you are looking for
-
Can I move my "Favorites" from my MSN account to my Bookmarks in Firefox?
I had been using MSNhotmail to access my email. Now I am using Firefox. Is there a way to move items from my Favorites into my Bookmarks so I don't have to start over creating them in my Bookmarks. I have a Dell Inspiron E1505with Windows XP.
-
Reading a string containing special character from a result set
My Code.... PrintStream p = new PrintStream(fout); if (connection == null) connection = getConnection(); CallableStatement proc = connection.prepareCall("{call testing_read()}"); rs = proc.executeQuery(); while ( rs.next() ) String page2 = rs.getStri
-
Selling MBP - how do I remove all personal info but leave apps?
Sorry for the newbie question. I just bought a new MBP and sold my old one. I want to leave the installed apps on my old MBP (running 10.5.7) but make sure that all of my personal info, data, etc. is gone. I'm not familiar enough with accounts on a M
-
Hi All, I am trying to create a simple program to edit and activate some channels in ID. The environment is PI 7.11 SP 6. I tried to import the WSDL directly from WSNavigator and tried to create a Java proxy client. The wizard would not complete and
-
PLaying dvd with enternainment center ( vista versio
Hello I've got this error when I want to play a dvd with creative enternainement center "format not support or something like that " ? http://img52.imageshack.us/img52/9246/dvdco5.jpg Someone know how to resolve this problem ? I don't have problem if