‎2009 Aug 24 5:42 PM
Hello,
I get data for a personel's trip in an internal table in a internal table with data formatted properly. I want the data from this internal table to be converted into pdf form. How can I do this ?
DATA: pernr LIKE ptrv_head-pernr,
tripno LIKE ptrv_head-reinr.
DATA: i_tripform LIKE bapitrform OCCURS 0 WITH HEADER LINE,
return LIKE bapireturn.
pernr = '1000'.
tripno = '2600281'.
CALL FUNCTION 'BAPI_TRIP_GET_FORM'
EXPORTING
employeenumber = pernr
tripnumber = tripno
"SET_PRINT_FLAG = ' '
"display_form = 'X'
IMPORTING
return = return
TABLES
tripform = i_tripform.Edited by: Rajesh Thomas on Aug 24, 2009 6:42 PM
‎2009 Aug 24 5:53 PM
Hi, write the data to a spoolfile and use a function module to convert it to PDF eg. CONVERT_ABAPSPOOLJOB_2_PDF.
Succes
‎2009 Aug 24 6:03 PM
There are 3 common ways by which you can get this data in PDF format.
1) Send mail using function module SO_NEW_DOCUMENT_ATT_SEND_API1
2) Write the data in ABAP list and convert the spool to PDF using CONVERT_ABAPSPOOLJOB_2_PDF
3) Write data using SCript or Smartform and get OTF data and convert to spool using CONVERT_OTF_2_PDF
‎2009 Aug 24 6:05 PM
But how can I create spool file from internal table data ?
Edited by: Rajesh Thomas on Aug 24, 2009 7:05 PM
‎2009 Aug 24 6:59 PM
if the process is taken place in background just loop the table data and use write: wa_itab-f1.....fn and pick the spool number using system variable sy-SPONO convert the spool to OTF and OTF to PDF.