@Mohamed Umair Mohamed Anhar Thanks for posting your question in Microsoft Q&A.
You can refer to this article for create a B2B workflow for sending messages with AS2 Encode and Decode.
Also, the below documentation, can help you to create AS2 encode in logic apps.
- Exchange AS2 Messages in logic apps.
- Setting up Trading partners in integration account to encode and decode AS2 messages.
Hope this helps, let me know if you are still facing any issues.