I have a request that at the end of the PCR workflow, to email the PCR as PDF to a person.
Our PCR is created in Webdynpro, which triggers a workflow.
In the method for closing the PCR, I am calling a function module with the import parameters from the Webdynpro context. This function module in return is calling a smartform to which is passing the same import parameters (from the function module). It is then creating OTF data, which I am converting to binary data and then this is emailed as PDF to a person. Everything works good in the sense that it is sending the email with the PDF from the smartform attached and it's also triggering the workflow...except for one problem...in Webdynpro it is generating one dump:
Attached is the code of the function module I created (FM ZHR.txt).
In the Webdynpro I am calling the function module like that:
CALL FUNCTION 'ZHR_PCR_PDF_EMAIL'
EXPORTING I_PERNR = LS_PATD-PERNR "which is retrieved from the context of Webdynpro
If I take out the import parameter output_options from l_functionmodule, I don't get any dump, but then it doesn't send the email....
I know the error is caused by the fact that is calling GUI screen, but I don't know what I need to change in the structure ls_outputoptions.
Can anyone help with this?