BAPIGOODSMVTCREATE.docx
《BAPIGOODSMVTCREATE.docx》由会员分享,可在线阅读,更多相关《BAPIGOODSMVTCREATE.docx(11页珍藏版)》请在冰豆网上搜索。
BAPIGOODSMVTCREATE
FUBAPI_GOODSMVT_CREATE GOODSMVT_CODE
____________________________________________________
ShortText
AssignCodetoTransactionforGoodsMovement
Description
ThisparametertransfersthenewkeyassignmentoftheGM_CODEtotherelevanttransactionsinInventoryManagement.
Formoreinformationontheindividualparameterfields,seethedataelementdocumentationintheABAPDictionary.
FunctionModule
BAPI_GOODSMVT_CREATE
PostgoodsmovementswithMB_CREATE_GOODS_MOVEMENT
Functionality
Youcanusethismethodtocreateamaterialdocumentforagoodsmovement.
Youcanonlycreateonematerialdocumenteachtimeyoucallupthemethod.
Youcanuseasimulationfunctionbeforepostingthegoodsmovementtocheckhowthedataisupdatedinthedatabase.Thestandardsystemisconfiguredsothatthegoodsmovementispostedimmediately,withoutpriorsimulation.
Ensurethatyoutransferthedatainthesamewayasitismanagedinthedatabase.Forexample:
∙Materialnumber18-characterwithleadingzeros
∙Batcheswithuppercaseletters
Ensurethattheheaderdataofthematerialdocumentincludesthepostingdateforalltransactions/eventslistedbelow.PopulatethePSTNG_DATEfield(importstructureGOODSMVT_HEADER)intheinterfaceBAPI2017_GM_HEAD_01forthispurpose.
Notes
FromReleaseERP2005onwards,itispossibletopopulatecustomers'ownfieldsindatabasetablesusingtheBAPI,withoutcarryingoutamodification.
TheenhancementsarepassedontotheBAPIinacontainerandcanbeprocessedwithintheBAPIfunctionmodule.
Technically,thisisrealizedviaanextensionparameter(ExtensionIn)(seebelowortabpage'Tables->LongText').
Authorizationcheckcheck
IntheMMInventoryManagementcomponent,themethoddoesnotperformanyauthorizationchecks.
Notethatthesystemcanalsocheckauthorizationobjectsofotherapplicationsduringthepostingofagoodsmovement,dependingonthebusinesstransaction.
Transfer
Thefollowinginformationaboutthematerialdocumentthatistobecreatedispassedontothemethod:
∙Astructurewiththeheaderdata
∙Astructurewiththecodeforthemovement
∙Atablewiththeitemdata
∙Atablewiththeserialnumbers
ThepostingismadebythefunctionmoduleMB_CREATE_GOODS_MOVEMENT.
Confirmations
MessagesarereturnedintheReturnparameter.Theparameterdocumentationshowsthereturncodesandtheirmeanings.
Furtherinformation
ThemethodcanonlyperformyourfunctionifnoerrormessagesweregeneratedintheReturntable.Thisisthecaseiftheheaderdataandalltheitemswereprocessedsuccessfully.
Transactioncontrolisnotimplemented.ThecallingprogramthereforehastoexecutetheCommitWorkitselfafterthismethodhasbeensuccessfullyinvoked(inotherwords,ifnoerrorswerereportedintheReturnparameter).
Whichfieldsmustbepopulatedduringthevarioustransactions/events?
Thefollowingexamplescenariosillustratewhichfieldshavetobepopulatedforwhichbusinesstransactions/events(code).
Therearethefollowingtypesoftransactions/events:
1.GM_Code01:
Goodsreceiptforpurchaseorder
2.GM_Code02:
Goodsreceiptforproductionorder
3.GM_Code03:
Goodsissue
4.GM_Code04:
Transferposting
5.GM_Code05:
Othergoodsreceipt
6.GM_Code06:
Reversalofgoodsmovements
7.GM_Code07:
Subsequentadjustmentwithregardtoasubcontractorder
Enteringthemovementindicator
Dependingonthetransaction,youmustenterthefollowinginthemovementindicatorfield:
∙GM_Code01(Goodsreceiptforpurchaseorder):
B
∙GM_Code02(Goodsreceiptforproductionorder):
F
∙Forallothertransactions,leavethefieldblank.
For1:
GM_Code01:
Goodsreceiptforpurchaseorder
∙Purchaseorderknown
Thefollowingfieldsmustbepopulated:
oPurchaseorder
oPurchaseorderitem
oMovementtype
oMovementindicator
oQuantityinunitofentry
oISOcodeunitofmeasurementforunitofentryor
quantityproposal
Thefollowingfieldsmayhavetobepopulated(thisisnotacompletelist):
oMinimumshelflifeexpirationdate(ifsetupinthesystem)
oReasonformovement(ifsetupinthesystem)
oBatch(ifthematerialishandledinbatchesandnoautomaticbatchassignmenthasbeensetup)
oStoragelocation(ifnostoragelocationusspecifiedinthepurchaseorderitem)
Thefollowingfieldscanbepopulated(thisisnotacompletelist):
oStocktype
oItemtext
oUnloadingpoint
oDeliverycompletedindicator
Thefollowingfieldsmustnotbepopulated(thisisnotacompletelist):
oAccountassignmentfields(theaccountassignmentisadoptedfromthepurchaseorder)
oReservation
oReceiving/issuingmaterial
oReceiving/issuingplant
oReceiving/issuingstoragelocation
Inthecaseofapurchaseorderitemwiththeitemcategory"subcontracting",onlytheGRitemistobepassedonintheinterface.TheGIitemsaredeterminedautomaticallyinthesystem.
∙Purchaseorderunknown:
Shippingnotificationknown
Thefollowingfieldsmustbepopulated:
oDelivery
oDeliveryitem
oMovementtype
Otherfieldsasunder"Purchaseorderknown".Thesystemdeterminestherelevantpurchaseorderitemviathedelivery/deliveryitem.
∙Purchaseorderunknown:
Purchaseorderistobecreatedautomatically
Thefollowingfieldsmustbepopulated:
oMaterialnumber
oPlant
oStoragelocation
oVendor
oMovementtype
oMovementindicator
oQuantityinunitofentry
oISOcodeunitofmeasurementforunitofentry
Thefollowingfieldsmayhavetobepopulated(thisisnotacompletelist):
oMinimumshelflifeexpirationdate(ifsetupinthesystem)
oReasonformovement(ifsetupinthesystem)
oBatch(ifthematerialishandledinbatchesandbatchesarenotassignedautomatically)
Thefollowingfieldscanbepopulated(thisisnotacompletelist):
oStocktype
oItemtext
oUnloadingpoint
Youcannotpopulatethefollowingfields(thisisnotacompletelist):
oAccountassignmentfields(automaticcreationofpurchaseorderitemswithaccountassignmentisnotsupported)
oReservation
oReceiving/issuingmaterial
oReceiving/issuingplant
oReceiving/issuingstoragelocation
∙Purchaseorderunknown:
Apurchaseorderisnottobecreated
Thefollowingfieldsmustbepopulated:
oMaterialnumber
oPlant
oStoragelocation
oVendor
oMovementtype
oMovementindicator
oQuantityinunitofentry
oISOcodeunitofmeasurementforunitofentry
Thefollowingfieldsmayhavetobepopulatedinsomecases(thisisnotacompletelist)
oMinimumshelflifeexpirationdate(ifsetupinthesystem)
oReasonformovement(ifsetupinthesystem)
oBatch(ifthematerialishandledinbatchesandautomaticassignmentofbatchnumbersisnotset)
Thefollowingfieldscanbepopulated(thisisnotacompletelist)
oSpecialstockindicator
oItemtext
oUnloadingpoint
oGoodsrecipient
Thefollowingfieldscannotbepopulated(thisisnotacompletelist)
oAccountassignmentfields(automaticcreationofpurchaseorderitemswithaccountassignmentisnotsupported)
oReservation
oReceiving/issuingmaterial
oReceiving/issuingplant
oReceiving/issuingstoragelocation
oReceiving/issuingbatch
TheinputcombinationslistedabovefortheGM_CODE01canbecombinedwithinaninputtablesothattheycanbepostedinamaterialdocument.Itemscanalsobepostedfordifferentpurchaseorders,providedthatallthepurchaseordersrelatetothesamevendor.
∙Transferofsubcontractingcomponents
Whentheendproduct(orderedmaterialofasubcontractorder)ispostedusingmovementtype101,thepopulateduniqueidentificationofthedocumentline(LINE_ID)isadditionallyneededforthetransferofthesubcontractingcomponents.
MoreinformationonLINE_IDandPARENT_ID
Thefollowingfieldsmustbepopulatedforthecomponents:
oUniqueidentificationofthedocumentline
oIdentificationoftheimmediatelysuperordinateline
oMaterialnumber
oPlant
oStoragelocation
oQuantityinunitofentry
Thefollowingfieldscanbefilledforthecomponents:
oAllotherfieldsinthemethodthatareincludedinthislist.
Thefollowingfieldscannotbepopulatedforthecomponents:
oAllfieldsthatarenotincludedinthelistabove.Themovementindicatormustbeinitial.
∙Additionalfieldsingoods-receipt-basedinvoiceverification
Whenyoupostagoodsreceipttopurchaseorderwithmovementtype102,anissuewithreferencetoapreviouslypostedgoodsissue,thefollowingfieldsmustalsobetransferred:
oREF_DOC_IT(LFPOS):
Itemofareferencedocument
oREF_DOC(LFBNR):
Documentnumberofareferencedocument
oREF_DOC_YR(LFBJA):
Fiscalyearofareferencedocument
Onlyifyoutransferthesefieldscanyoubesurethatthelinktotheoriginalgoodsmovementisretained.
For2GM_Code02:
Goodsreceiptforproductionorder
Thefollowingfieldshavetobepopulated:
oOrder
oMovementtype
oMovementindicator
oQuantityinunitofentry
oISOcodeunitofmeasurementforunitofentryor
quantityproposal
Thefollowingfieldsmayhavetobepopulatedinsomecases(thisisnotacompletelist):
oMinimumshelflifeexpirationdate(ifsetupinthesystem)
oReasonformovement(ifsetupinthesystem)
oBatch(ifthematerialishandledinbatchesandautomaticbatchnumberassignmentisnotset)
oStoragelocation(ifstoragelocationhasnotbeenspecifiedintheorder)
Thefollowingfieldscanbepopulated(thisisnotacompletelist):
oOrderitem(co-product)
oStocktype
oItemtext
oUnloadingpoint
o"Deliverycompleted"indicator
Thefollowingfieldscannotbepopulated(thisisnotacompletelist):
oAccountassignmentfields(theaccountassignmentsareadoptedfromthepurchaseorder)
oReservation
oRe