Sonia,
This could be one option - You can supress the dialog by submitting the program in back ground using JOB_OPEN and JOB_CLOSE function modules.
Call FM: JOB_OPEN --> get the job number.
SUBMIT /1pyxxfo/ybprh_payslip_prnt TO SAP-SPOOL
SPOOL PARAMETERS params
WITHOUT SPOOL DYNPRO AND RETURN
VIA JOB <name> NUMBER <number>
WITH pnptimed = '2'
WITH pnpxabkr = p_area_proc
WITH pnppabrp = p_mes_proc
WITH pnppabrj = p_ano_proc
WITH pnppernr-low = pernr
WITH p_plang = p_plang
WITH p_nostat = 'X'.
CALL FM: JOB_CLOSE
Wait for few seconds for the job to finish.
Query table tbtc_spoolid to get the spool id - using job name and number. ( you can also use FM:BP_JOB_READ)
Convert spool id/OTF to pdf.
hope this helps,
Thanks,
VM.