Dear Ambika,
Is the trading partner for 3rd party blank or it populates with the customer number then in bex alone its not possible to achieve
Have 2 separate reports (one for 3rd party and other for the intercompany with the trading partner included ) in a single web template for this.
Regards
Gajesh