IDOCSample.docx
《IDOCSample.docx》由会员分享,可在线阅读,更多相关《IDOCSample.docx(11页珍藏版)》请在冰豆网上搜索。
IDOCSample
Portdefinitions
Thisportdefinitionisusedinalltheexamples.
UsetransactioncodeWE21tocreateanewport.
TheportshouldbecreatedastypeFILE
Generaldataandoutboundfile
NOTE:
RemembertoleaveOutboundfileblank
Inboundfile
SalesorderIDOC
Inthisexampleapurchaseiscreated,usingtheSAPstandardfunctionallityforcreatingsalesorders.Whenthesalesorderissaved,andIDOCisautomaticallygenerated.ThenweusetheIDOCtesttooltocreateanorderconfirmationfromthesalesorderIDOC.
CreateVendor
Createcustomer
Createpartnerprofiles
Createpurchaseorder
CreatetheorderconfirmationIDOC
Createvendor
CreatevendorusingtransactioncodeMK01.Youcanalsouseanexistingvendor.
Vendor:
T-BILHFN
Purch.org.:
001
Purchaseorganizationmayvaryfromsystemtosystem.
CreateCustomer
CreateacustomerusingtransactionVD01.Youcouldalsouseanexistingcustomer.
Inthefollwingexamplethevendor3471isused.
Createpartnerprofiles
Createvendorpartnerprofile
Generaldata
Outboundparameters
Inboundparameters
Createcustomerpartnerprofile
Generaldata
Outboundparameters
Imboundparameters
Createpurchaseorder
UsetransactionME21tocreatethepurchaseorder.
TosendanIDOCwhenthedocumentisfinished,gotoHeader->MessagesandchangetheoutputmediumtoEDI.
ThenselectFurtherDataandchangeDispatchTimetoSendimmediately.ThiswillcreatetheIDOCassoonasthepurchaseorderissaved.
Savethedocument.
UsetransactionWE02tocheckthattheIDOChasbeencreatedwithouterrors
CreatetheorderconfirmationIDOC
AsthesystemhasnotbeenconfiguredtohandletheIDOCflow,theIDOCtesttoolisusedtosimulatetheflow.The OrderIDOCisusedasatemplatetocreatetheorderconfirmationIDOC.
Transactioncode:
WE19
TypethenumberoftheOrderIDOCinonthestartscreenandselectmenuIDOC->Createtocreatethetemplate.
Changethecontrolrecord
NotethatthenameoftheportSAPTSTmayvaryfromsystemtosystem.ThenamecanbeseenintheSenderportoftheIDOC
CreatenewE1DK02segment
TheE1DK02Documentheaderreferencedatasegmentincludesreferencestootherdocuments.
ThenewE1DK02segmentshouldbecreatedasacopyoftheexistingE1DK02,andatthesamelevel.
Changethefollowingfieldsoftherecord:
Qualifier:
002
Documentitem:
10
Qualifier=IDOCqualifierreferencedocument=002=Vendororder
Documentitem=:
Itemnumber,seetheitemnumberonthepurchasingdocument
CreateE1EDP02segment
TheE1EDP02DocumentItemReferencedataincludesreferencestootherdocuments.
CreateE1EDP02assubelementofE1EDP01DocumentitemGeneralData
Qualifier:
001
Document:
4500010757
Documentitem:
10
Qualifier:
IDOCqualifierreferencedocument001=Customerpurchaseorder
Document:
Documentnumber–Thenumberofthepurchaseorder
Documentitem:
Itemnumber,seetheitemnumberonthepurchasingdocument
ChangingtheACTIONfieldatheaderoritemlevel
Ifyouareworkingwithoutaconfirmationcontrolkey,theIDocmusthaveaprocessableactioncodeateitherheaderoritemlevel:
Atheaderlevel,thesegmentfieldACTIONofsegmentE1EDK01mustbefilledwiththevalue'000'ifthecompletepurchaseorderistobeconfirmed.
Atitemlevel,thesegmentfieldACTIONofsegmentE1EDP01mustbefilledwiththevalue'000'or'004'ifthePOitemistobeconfirmed.
TestIDOC
Afterthechangeshavebeenmade,presstheStandardInboundbuttontogeneratetheIDOC.
IfnoerrorsoccursgototransactionWE02tocheckiftheIDOChasbeenprocessedwithouterrors.
IftheIDOChasbeenprocessedwithouterrors,thendisplaythePurchaseorder(TransactionME23).displaytheitemdataanddouble-clickontheitemline.Ifallwentwell,youwillnowsethatthefieldAcknowl.no.hasbeenfilledout.