webMethods 4.6 step by step EDI To Flat File
TASK: EDI To Flat File
OS: WindowsOS
Platform: webMethods 4.6/SAP BC
To convert an edi document to flat file we have to follow the below procedure. Firstly,
Create a Dictionary:
To create a Dictionary we have to use SEFParse Java Service (WmEDI-wm.b2b.edi: SEFParse). This service is used for generating Flat File dictionaries and schemas.
In SEFParser Service assign the following values in Service In under Pipeline Tab.
à SEFFileName:webMethods6IntegrationServerpackagesWmEDIpubSEFSX124010.sef (Here we parsing 4010 version EDI so we have to give 4010.sef).
à EDIDocName: Since we are parsing a 210 EDI we have to give the name asâ210â.
à Version: Its an optional filed here we can give version as â4010â.
à TargetSchema: Give the path of Schema where you want to create it (Example: EDI_Parse: T210).
à TargetPackage: Give the package name (Ex: Default).
à TargetDictionary: Create an empty dictionary and give its path in this filed (Example: EDI_Parse: D210).
Now run the Parser service and refresh the server then automatically schema will be generated and dictionary will be filled with fields.
Create a Document Type:
à Select Schema in the Navigation Panel (Ex: T210)
à Now Click on Flat File Structure tab and click on document symbol then a document type will be created (EDI_Parse: T210DT).
Parsing Service:
à Now create a service (example ParseEDI) for parsing an EDI file.
First take the envelope process for validating the EDI file (WmEDIsamples-sampleServices: X12Values).
à Now click on âenvelope processâ service and double click on âedidataâ under pipeline tab and assign the edi 210 file.
à Assign the path of the schema in âEDIffSchemaâ field (Ex: EDI_ParseT210).
à Take the Reference Document Type of EDI in pipeline out (Ex: T210DT).
à Now map EDIValues to the Reference Document Type.
à Insert a map step and map the required fields from EDI Reference Doc to another Flat File Document type (Ex: FlatSchemaDT).
à While mapping from multiple document to single document we have to convert multiple document to a single document by using a loop step and then map the fields.
à While mapping to a multiple document use âappendToDocumentListâ service.
Using appendToDocumentList Service:
à Copy all fields from multiple documents.
à Take a single document and append all fields under that document.
à Now map the required fields to single document and assign null values to remaining fields.
à Now use appendToDocumentList Service as shown above.
à Take multiple document list in âPipeline Inâ under âPipelineâ tab (Ex: SingleDocList).
à Now map Single document to âfromItemâ and multiple document to âtoListâ(Ex:SingleDoc to fromItem and SingleDocLIst to toList).
à Now map toList in âService Outâ to SingleDocList in PipeLine Out.
à Now map this SingleDocList to main Multiple document list.
à Now insert convertToString Service (WmFlatFile-pub.flatFile: convertToString) and map Flat file Document type to ffValues.
à Give Flat file Schema by double clicking ffSchema Ex: EDI_Parse: FlatSchema).
à We will get Flat File String as output.
