Hi Pujarini Patra,
Why don't you do these things in print program itself. better to check the condition and pass to SAP SCRIPT from print program.
we have other option, use subroutine in SAP SCRIPT and get required data and print in single line.
Regards,
Venkat.