# Creating EDI large documents

**URL:** <https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [January 31, 2003, 1:34am UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942 "2003-01-31T01:34:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rupinder](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rupinder](https://techcommunity.softwareag.com/u/rupinder)\
**Post date:** [January 31, 2003, 1:34am UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942/1 "2003-01-31T01:34:41Z")

</div>

I have a question that is related to creating an EDI document in webMethods IS and sending it out through TN.

I have a service that pulls data from a database and then needs to format the records into an EDI 867 document. My concern is that the number of records I get from the database could get very large. So instead of getting all of them at the same time, I would like to read them one at a time, convert each record into some edi string using convertToString.

Can somebody tell me a way to do this ? I dont think I can call convertToString in a loop concatenating the results from each call and still end up with a valid edi document as some segments and control numbers get duplicated.

Is there a way to achieve this ?

---

<div class="post-metadata">

**Author:** ![uday\_insolexen](https://avatars.discourse-cdn.com/v4/letter/u/71c47a/32.png) [@uday\_insolexen](https://techcommunity.softwareag.com/u/uday_insolexen)\
**Post date:** [January 31, 2003, 7:34pm UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942/2 "2003-01-31T19:34:57Z")

</div>

Hey Rupinder

You can call the converttoString in a Loop, for more details/help check the Service Tutorial.XMLtoEDI:processXMLSource under EDI Samples package.

HTH

Uday

---

<div class="post-metadata">

**Author:** ![rupinder](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rupinder](https://techcommunity.softwareag.com/u/rupinder)\
**Post date:** [January 31, 2003, 11:23pm UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942/3 "2003-01-31T23:23:52Z")

</div>

Thanks Uday,

But the sample is not sufficient for my needs. Instead of creating individual documents from each row I want to be able to create one EDI document from all rows. And I dont have the rows in a list.

So what I want to do is something like this :

1. REPEAT  
1a. Get the next record from database  
1b. Add it to the EDI document

2. create group for EDI document

3. Create envelope for EDI document

4. Send document

---

<div class="post-metadata">

**Author:** ![uday\_insolexen](https://avatars.discourse-cdn.com/v4/letter/u/71c47a/32.png) [@uday\_insolexen](https://techcommunity.softwareag.com/u/uday_insolexen)\
**Post date:** [February 3, 2003, 2:52pm UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942/4 "2003-02-03T14:52:30Z")

</div>

Rupiner,

What kind of this rows are? Are they records of IDOC or any other RDBMS record or XML records?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/creating-edi-large-documents/107942/5 "2021-04-02T15:04:59Z")

</div>


