Define a text element in your script & pass this in your wirte_form between loops.
Refer old post of SDN :http://scn.sap.com/thread/3412533
Define a text element in your script & pass this in your wirte_form between loops.
Refer old post of SDN :http://scn.sap.com/thread/3412533