Hi Shweta,
based on your requirement please check this,
lets say
it_final -> having all the data for your PO
it_final1-> having uniuqe PO
it_final2 -> having unique material
Now when you will pick unique material, in that internal table you may not have all the PO's values.
LOOP AT it_final2 INTO wa_final2.
READ TABLE it_final1 INDEX 1.
LOOP AT it_final INTO wa_final WHERE ebeln = it_final1-ebeln
matnr = wa_final2-matnr.
IF sy-subrc = 0
wa_final2-ebeln = wa_final-ebeln.
*
*
*
put all your data in wa_final as same as i have done for ebeln.
Modify it_final2 FROM wa_final2 TRANSPORTING ebeln............
ENDIF.
ENDLOOP.
ENDLOOP.
Do it for all index upto your internal table and pass it to your smartform ,