I was seeing a weird behavior where I thought BizTalk 2006 R2 was sending a 997 in response to a received 997. The real reason was because I had a send port filter that looked like the following:
You’ll notice that I’m subscribing to a receive port where general X12 documents are received, including 850s and 997s. The Trading Partner is set up to generate a 997. The real gotcha here is that there are two types of 997s, ones generated from the EDI receive pipeline known as EDI.IsSystemGeneratedAck promoted context property and ones received from your trading partner.
If you don’t set another filter to look like the following, you’ll be sending your trading partner’s 997s back to them.