Receiving an EDI file and generating a 997 acknowledgement is a common scenario which we have used in BizTalk. 
Suppose we want to receive the 997 functional acknowledgements in an asynchronous fashion i.e., via a one way receive port you would have come across this error message
“517:message part 997 is not allowed as part of agreement”

At first the error message sounds like there is no acknowledgement configured for the agreement and I ended up checking if 997 acknowledgement is enabled for the agreement.

For example: let us have two trading partner Fabrikam and Contoso who are having business relationship. Fabrikam is hosting the BizTalk server.
I am using here an X12 encoding protocol similar setting applies for EDIFACT as well.
Fabrikam is sending an 810 message to contoso and expecting a 997 ack.
After receiving the error message you would check in the fabrikam->contoso agreement if we have enabled the 997 acknowledgement.

But the error message is because the 997 is not listed in the transaction list of the contoso->fabrikam agreement.

Now the edi receive treat this a new edi message/ transactions and allows only the messages that is part of the transaction list present in the contoso-> Fabrikam agreement.
To achieve receiving 997, I thought of adding the 997 in the transaction set list but since it is a functional acknowledgement , it is not present in the dropdown list.

So the only option of achieving such a scenario is by enabling the exclude transaction sets from the list and selecting none of the transaction set. It is equivalent of selecting all the transactions set.

There is not much documentation on how to receiving the 997 message into the BizTalk layer. So thought of sharing this issue that I faced. Which might be helpful.

  Written by 
   Shashidharan Krishnan

Reviewed by 
   Shailesh Agre

Microsoft GTSC