cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow - add Travel Expense as PDF to email

razvan_sodoleanu
Explorer
0 Kudos

Hi,

I'm trying to attach the travel expense form as PDF to an e-mail notification in the expense form approval flow.

I am generating the expense form with the BUS20891 "GENERATEEXPENSEFORM" method, but I don't know how to convert it to PDF or how to add it to "_attachment_objects" in the email step.

Could anyone help, please?

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi there,

it's refreshing to see a distinct and tangible question for once 🙂

Your approach won't work for your requirement because the Method GetExpenseForm of BUS2089 (assuming it's a typo in your opening post and we're talking about the same thing here) ultimately executes RPRTEF00 which returns the old ABAP List only - no ADS involved here whatsoever. There is no "officially supported for end customers"-FM that I know of, but there is, of course a way with internal standard-means. You can use the following snippet to get a PDF form for a REINR in BLOB format:

CALL FUNCTION 'PTRM_WEB_FORM_PDF_GET'
EXPORTING
i_employeenumber = <pernr>
i_tripnumber = <reinr>
i_periodnumber = <perionr>
i_trip_component = ' '
i_trip_data_source = 'DB'
i_display_form = ' '
IMPORTING
e_pdf_form = <pdf_form_content>
TABLES
et_return = <et_return>.


Move the result to an xstring variable, the conversion works internally; that's your pdf.

If I understood correctly, you apparently want to attach that PDF to an Email within a workflow. You might want to do a bit research in the direction of interface IF_SWF_IFS_WORKITEM_EXIT, since this part of your requirement is basic workflow knowlegde and can be derived from the official documentation. 😉

Cheers, Lukas