Hello Shweta-
The simpler way which I feel is to build a final internal table with details like below:
IT_FINAL:
Material PO1 PO2 PO3
ABC 123 234 345
ABC 456 567
In your driver program or in smartform initialization build above table based on your material and PO table details.
Then you can loop over this final internal table and you can fetch details from material and PO tables and display them accordingly.
-Venkat