webMethods 4.6 step by step EDI To Flat File
TASK: EDI To Flat File
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).
Ã 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.