{"id":2156,"date":"2019-02-27T05:29:39","date_gmt":"2019-02-27T05:29:39","guid":{"rendered":"https:\/\/www.se80.co.uk\/training-education\/?p=2156"},"modified":"2019-10-28T00:14:52","modified_gmt":"2019-10-28T00:14:52","slug":"email-abap-report-pdf","status":"publish","type":"post","link":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/","title":{"rendered":"Email ABAP report PDF"},"content":{"rendered":"<p>\nThe below code to demonstrates how to email ABAP report PDF. It generates an ALV output of personal numbers (PERNRS) and then converts this to a PDF document. Its then sends an external email with the PDF as an attachment\n<\/p>\n<p> SAP ABAP report functionality used by this report<\/p>\n<ul>\n<li>Email address input selection screen fields<\/li>\n<li>Display ALV report using Objects cl_salv_table<\/li>\n<li>Add custom ALV column header<\/li>\n<li>Change colour of ALV rows based on user start year<\/li>\n<li>Get ALV Spool from background execution<\/li>\n<li>Convert Spool to PDF and send as Email<\/li>\n<li>Submit an ABAP report in the background<\/li>\n<li>ABAP report submits itself in the background to create spool<\/li>\n<li>Pass parameter and select options to report submit ABAP statement<\/li>\n<\/ul>\n<p><pre>\r\n*&-------------------------------*\r\nREPORT zrep_email_alv_spool.\r\n\r\nTABLES:  pa0001, pa0000.\r\n\r\nSELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.\r\nSELECT-OPTIONS:   so_pernr FOR pa0001-pernr.\r\nPARAMETERS:       p_keydat TYPE datum DEFAULT sy-datum.\r\nPARAMETERS:       p_email  TYPE ad_smtpadr DEFAULT 'myemail@mydomain.com'.\r\n\r\nSELECTION-SCREEN END OF BLOCK block1.\r\n\r\n*Data Declaration\r\n*----------------\r\nDATA: r_objid TYPE RANGE OF hrp1001-objid.\r\nDATA: wa_objid LIKE LINE OF r_objid.\r\n\r\nTYPES: BEGIN OF t_report,\r\n         pernr       TYPE p0000-pernr,\r\n         vorna       TYPE p0002-vorna,\r\n         nachn       TYPE p0002-nachn,\r\n         ename       TYPE p0001-ename,\r\n         begda       TYPE p0000-begda,\r\n         orgeh       TYPE p0001-orgeh,\r\n         details(20) TYPE c,\r\n         color       TYPE lvc_t_scol, \"table for cell colouring\r\n       END OF t_report.\r\nDATA: it_report TYPE STANDARD TABLE OF t_report INITIAL SIZE 0,\r\n      wa_report TYPE                   t_report.\r\n\r\nDATA alv_table TYPE REF TO cl_salv_table.\r\nDATA alv_columns TYPE REF TO cl_salv_columns_table.\r\nDATA single_column TYPE REF TO cl_salv_column.\r\n\r\nDATA: objec_tab TYPE STANDARD TABLE OF objec,\r\n      it_dept   TYPE STANDARD TABLE OF objec,\r\n      wa_objtab LIKE LINE OF           objec_tab,\r\n      struc_tab TYPE STANDARD TABLE OF struc,\r\n      wa_struc  LIKE LINE OF           struc_tab,\r\n      ld_orgeh  TYPE                   orgeh.\r\n\r\nDATA: gd_recsize TYPE i.\r\n\r\nDATA: gd_eventid                 LIKE tbtcm-eventid,\r\n      gd_eventparm               LIKE tbtcm-eventparm,\r\n      gd_external_program_active LIKE tbtcm-xpgactive,\r\n      gd_jobcount                LIKE tbtcm-jobcount,\r\n      gd_jobname                 LIKE tbtcm-jobname,\r\n      gd_stepcount               LIKE tbtcm-stepcount,\r\n      gd_error                   TYPE sy-subrc,\r\n      gd_reciever                TYPE sy-subrc.\r\n\r\nDATA send_request TYPE REF TO cl_bcs.\r\nDATA document TYPE REF TO cl_document_bcs.\r\nDATA recipient TYPE REF TO if_recipient_bcs.\r\nDATA bcs_exception TYPE REF TO cx_bcs.\r\nDATA sent_to_all TYPE os_boolean.\r\nDATA: pdf_content TYPE solix_tab.\r\nDATA: pdf_xstring TYPE xstring.\r\nDATA: bin_size TYPE i.\r\nDATA pdf_size TYPE so_obj_len.\r\n\r\n\r\nDATA:  w_recsize TYPE i.\r\n\r\nDATA: gd_subject         LIKE sodocchgi1-obj_descr,\r\n      it_mess_bod        LIKE solisti1 OCCURS 0 WITH HEADER LINE,\r\n      it_mess_att        LIKE solisti1 OCCURS 0 WITH HEADER LINE,\r\n      gd_sender_type     LIKE soextreci1-adr_typ,\r\n      gd_attachment_desc TYPE so_obj_nam,\r\n      gd_attachment_name TYPE so_obj_des.\r\n\r\n* Spool to PDF conversions\r\nDATA: gd_spool_nr    LIKE tsp01-rqident,\r\n      gd_destination LIKE rlgrap-filename,\r\n      gd_bytecount   LIKE tst01-dsize,\r\n      gd_buffer      TYPE string.\r\n\r\n* Spool IDs\r\nTYPES: BEGIN OF t_tbtcp.\r\n        INCLUDE STRUCTURE tbtcp.\r\nTYPES: END OF t_tbtcp.\r\nDATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,\r\n      wa_tbtcp TYPE                   t_tbtcp.\r\n\r\n* Binary store for PDF\r\nDATA: BEGIN OF it_pdf_output OCCURS 0.\r\n        INCLUDE STRUCTURE tline.\r\nDATA: END OF it_pdf_output.\r\n\r\nDATA: seltab    TYPE TABLE OF rsparams,\r\n      seltab_wa LIKE LINE OF  seltab.\r\n\r\nDATA: gd_email  TYPE somlreci1-receiver,\r\n      gd_email2 TYPE somlreci1-receiver,  \"just for test\/demo\r\n      gd_email3 TYPE ad_smtpadr.          \"just for test\/demo\r\n\r\nDATA: wa_addreess TYPE sx_address.\r\n\r\n************************************************************************\r\n* START-OF-SELECTION\r\nSTART-OF-SELECTION.\r\n  gd_email = p_email.\r\n  gd_email2 = '#myemail@mydomain.com'.\r\n  gd_email3 = '#myemail@mydomain.com'.\r\n\r\n  PERFORM data_retrieval.\r\n  PERFORM display_settings.\r\n  PERFORM set_row_colors.\r\n\r\n************************************************************************\r\n* END-OF-SELECTION\r\nEND-OF-SELECTION.\r\n  PERFORM display_alv_report.\r\n\r\n  IF sy-batch EQ 'X'.\r\n    PERFORM get_job_details.\r\n    PERFORM obtain_spool_id.\r\n    PERFORM convert_spool_to_pdf.\r\n    PERFORM send.\r\n\r\n  ELSE.\r\n    PERFORM submit_report_in_background.\r\n  ENDIF.\r\n\r\n\r\n*&-------------------------------*\r\n*& FORM data_retrieval.\r\n*&-------------------------------*\r\nFORM data_retrieval.\r\n  DATA: ld_deptlines TYPE i.\r\n\r\n  SELECT a~pernr a~begda b~vorna b~nachn c~ename  c~orgeh\r\n    FROM pa0000 AS a INNER JOIN pa0002 AS b\r\n      ON b~pernr EQ a~pernr\r\n     INNER JOIN pa0001 AS c\r\n    ON c~pernr EQ b~pernr\r\n    INTO CORRESPONDING FIELDS OF TABLE it_report\r\n   \"for ALL ENTRIES IN it_emps\r\n   WHERE \"a~pernr eq it_emps-pernr\r\n       a~pernr IN so_pernr\r\n     AND a~begda LE p_keydat\r\n     AND a~endda GE p_keydat\r\n     AND b~begda LE p_keydat\r\n     AND b~endda GE p_keydat\r\n     AND c~begda LE p_keydat\r\n     AND c~endda GE p_keydat.\r\nENDFORM.                    \" DATA_RETRIEVAL\r\n\r\n*&-------------------------------*\r\n*& FORM display_settings.\r\n*&-------------------------------*\r\nFORM display_settings.\r\n  DATA: err_message TYPE REF TO cx_salv_msg.\r\n\r\n  TRY.\r\n      cl_salv_table=>factory(\r\n      IMPORTING\r\n        r_salv_table = alv_table\r\n      CHANGING\r\n        t_table      = it_report ).\r\n\r\n      alv_columns = alv_table->get_columns( ).\r\n\r\n      PERFORM build_layout.\r\n      PERFORM build_fieldcatalog.\r\n      PERFORM build_toolbar.\r\n      PERFORM hide_columns.\r\n      PERFORM report_settings.\r\n\r\n    CATCH cx_salv_msg INTO err_message.\r\n*   Add error processing\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*& FORM display_alv_report.\r\n*&-------------------------------*\r\nFORM display_alv_report.\r\n  alv_table->display( ).\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*& FORM build_layout.\r\n*&-------------------------------*\r\nFORM build_layout.\r\n  DATA: layout TYPE REF TO cl_salv_layout.\r\n  DATA: layout_key TYPE salv_s_layout_key.\r\n\r\n  layout = alv_table->get_layout( ).\r\n\r\n  layout_key-report = sy-repid.\r\n  layout->set_key( layout_key ).\r\n\r\n  layout->set_save_restriction( if_salv_c_layout=>restrict_none ).\r\nENDFORM.                    \"BUILD_LAYOUT\r\n\r\n*&-------------------------------*\r\n*& FORM hide_columns.\r\n*&-------------------------------*\r\nFORM hide_columns.\r\n  DATA: err_notfound TYPE REF TO cx_salv_not_found.\r\n\r\n  TRY.\r\n      single_column = alv_columns->get_column( 'VORNA' ).\r\n      single_column->set_visible( if_salv_c_bool_sap=>false ).\r\n      single_column = alv_columns->get_column( 'NACHN' ).\r\n      single_column->set_visible( if_salv_c_bool_sap=>false ).\r\n\r\n    CATCH cx_salv_not_found INTO err_notfound.\r\n*   Add error processing\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*& FORM build_fieldcatalog.\r\n*&-------------------------------*\r\n*  Your ALV report should get texts from the internal table used but you\r\n*  overwrite them here if you require\r\n*&-------------------------------*\r\nFORM build_fieldcatalog.\r\n  DATA: err_notfound TYPE REF TO cx_salv_not_found.\r\n\r\n  TRY.\r\n      single_column = alv_columns->get_column( 'BEGDA' ).\r\n      single_column->set_short_text( 'Start Date' ).  \"Will cause syntax error if text is too long\r\n      single_column->set_medium_text( 'Start Date' ).\r\n      single_column->set_long_text( 'Employee Start Date' ).\r\n      single_column->set_output_length( '10' ). \"Force column to be wider to accomodate heading\r\n\r\n    CATCH cx_salv_not_found INTO err_notfound.\r\n*   Add error processing\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*& FORM build_toolbar.\r\n*&-------------------------------*\r\nFORM build_toolbar.\r\n  DATA: toolbar_functions TYPE REF TO cl_salv_functions_list.\r\n\r\n  toolbar_functions = alv_table->get_functions( ).\r\n  toolbar_functions->set_all( ).\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*& FORM report_settings.\r\n*&-------------------------------*\r\nFORM report_settings.\r\n  DATA: report_settings TYPE REF TO cl_salv_display_settings.\r\n\r\n  report_settings = alv_table->get_display_settings( ).\r\n  report_settings->set_striped_pattern( if_salv_c_bool_sap=>true ).\r\n  report_settings->set_list_header( 'Demo SAP ALV Report and PDF email' ).\r\nENDFORM.\r\n\r\n*&-------------------------------*\r\n*&      Form  SET_ROW_COLORS\r\n*&-------------------------------*\r\n*       text\r\n*----------------------------------------------------------------------*\r\nFORM set_row_colors .\r\n  DATA: lo_cols_tab TYPE REF TO cl_salv_columns_table,\r\n        lo_col_tab  TYPE REF TO cl_salv_column_table.\r\n  DATA: ls_color TYPE lvc_s_colo.    \" Colors strucutre\r\n\r\n  DATA: lt_s_color TYPE lvc_t_scol,\r\n        ls_s_color TYPE lvc_s_scol,\r\n        ld_tabix   TYPE sy-tabix.\r\n\r\n  lo_cols_tab = alv_table->get_columns( ).\r\n\r\n\r\n  LOOP AT it_report INTO wa_report.\r\n    ld_tabix = sy-tabix.\r\n\r\n    IF wa_report-begda(4) EQ sy-datum(4). \"this year.\r\n      ls_s_color-color-col = col_negative.\r\n      ls_s_color-color-int = 1.\r\n      ls_s_color-color-inv = 0.\r\n      APPEND ls_s_color TO lt_s_color.\r\n      CLEAR  ls_s_color.\r\n    ELSE.\" eq other year\r\n      ls_s_color-color-col =  7.\r\n      ls_s_color-color-int = 1.\r\n      ls_s_color-color-inv = 0.\r\n      APPEND ls_s_color TO lt_s_color.\r\n      CLEAR  ls_s_color.\r\n    ENDIF.\r\n\r\n    wa_report-color = lt_s_color.\r\n    MODIFY it_report FROM wa_report INDEX ld_tabix.\r\n\r\n    CLEAR  lt_s_color.\r\n  ENDLOOP.\r\n\r\n  TRY.\r\n      lo_cols_tab->set_color_column( 'COLOR' ).\r\n    CATCH cx_salv_data_error.                           \"#EC NO_HANDLER\r\n  ENDTRY.\r\nENDFORM.                    \" SET_ROW_COLORS\r\n\r\n*---------------------------------------------------------------------*\r\n*       FORM get_job_details                                          *\r\n*---------------------------------------------------------------------*\r\nFORM get_job_details.\r\n* Get current job details\r\n  CALL FUNCTION 'GET_JOB_RUNTIME_INFO'\r\n    IMPORTING\r\n      eventid                 = gd_eventid\r\n      eventparm               = gd_eventparm\r\n      external_program_active = gd_external_program_active\r\n      jobcount                = gd_jobcount\r\n      jobname                 = gd_jobname\r\n      stepcount               = gd_stepcount\r\n    EXCEPTIONS\r\n      no_runtime_info         = 1\r\n      OTHERS                  = 2.\r\nENDFORM.\r\n\r\n*---------------------------------------------------------------------*\r\n*       FORM obtain_spool_id                                          *\r\n*---------------------------------------------------------------------*\r\nFORM obtain_spool_id.\r\n  CHECK NOT ( gd_jobname IS INITIAL ).\r\n  CHECK NOT ( gd_jobcount IS INITIAL ).\r\n\r\n  SELECT * FROM  tbtcp\r\n                 INTO TABLE it_tbtcp\r\n                 WHERE      jobname     = gd_jobname\r\n                 AND        jobcount    = gd_jobcount\r\n                 AND        stepcount   = gd_stepcount\r\n                 AND        listident  = '0000000000'\r\n                 ORDER BY   jobname\r\n                            jobcount\r\n                            stepcount.\r\n\r\n  READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.\r\n  IF sy-subrc = 0.\r\n    gd_spool_nr = wa_tbtcp-listident.\r\n    MESSAGE s004(zdd) WITH gd_spool_nr.\r\n  ELSE.\r\n    MESSAGE s005(zdd).\r\n  ENDIF.\r\nENDFORM.\r\n\r\n\r\n*---------------------------------------------------------------------*\r\n*       FORM convert_spool_to_pdf                                     *\r\n*---------------------------------------------------------------------*\r\nFORM convert_spool_to_pdf.\r\n\r\n  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'\r\n    EXPORTING\r\n      src_spoolid              = gd_spool_nr\r\n      no_dialog                = 'X'\r\n      pdf_destination          = 'X'\r\n      no_background            = 'X'\r\n    IMPORTING\r\n      pdf_bytecount            = bin_size\r\n      bin_file                 = pdf_xstring\r\n    EXCEPTIONS\r\n      err_no_abap_spooljob     = 1\r\n      err_no_spooljob          = 2\r\n      err_no_permission        = 3\r\n      err_conv_not_possible    = 4\r\n      err_bad_destdevice       = 5\r\n      user_cancelled           = 6\r\n      err_spoolerror           = 7\r\n      err_temseerror           = 8\r\n      err_btcjob_open_failed   = 9\r\n      err_btcjob_submit_failed = 10\r\n      err_btcjob_close_failed  = 11\r\n      OTHERS                   = 12.\r\n\r\n  pdf_size = bin_size.\r\n\r\nENDFORM.\r\n\r\n*---------------------------------------------------------------------*\r\n*       FORM send_email                                               *\r\n*---------------------------------------------------------------------*\r\n*  -->  p_email                                                       *\r\n*---------------------------------------------------------------------*\r\nFORM send.\r\n  DATA: it_contents TYPE STANDARD TABLE OF soli,\r\n        wa_contents TYPE                   soli,\r\n        ld_subject  TYPE                   so_obj_des.\r\n\r\n  TRY.\r\n      CONCATENATE 'Please fine attached the output report' ''\r\n                       INTO wa_contents-line.\r\n      APPEND wa_contents TO it_contents.\r\n\r\n      ld_subject  = |Output report |.\r\n\r\n*     -------- create persistent send request ------------------------\r\n      send_request = cl_bcs=>create_persistent( ).\r\n\r\n*     -------- create and set document -------------------------------\r\n      pdf_content = cl_document_bcs=>xstring_to_solix( pdf_xstring ).\r\n\r\n      document = cl_document_bcs=>create_document(\r\n            i_type    = 'PDF'\r\n            i_hex     = pdf_content\r\n            i_length  = pdf_size\r\n            i_subject = ld_subject\r\n            i_text    = it_contents ).                      \"#EC NOTEXT\r\n\r\n*     add document object to send request\r\n      send_request->set_document( document ).\r\n\r\n*     --------- add recipient (e-mail address) -----------------------\r\n*     create recipient object\r\n      recipient = cl_cam_address_bcs=>create_internet_address( p_email ).\r\n\r\n*     add recipient object to send request\r\n      send_request->add_recipient( recipient ).\r\n\r\n*     ---------- send document ---------------------------------------\r\n      sent_to_all = send_request->send( i_with_error_screen = 'X' ).\r\n\r\n      COMMIT WORK.\r\n\r\n      IF sent_to_all IS INITIAL.\r\n        MESSAGE i500(sbcoms) WITH p_email.\r\n      ELSE.\r\n        MESSAGE s022(so).\r\n      ENDIF.\r\n\r\n*   ------------ exception handling ----------------------------------\r\n*   replace this rudimentary exception handling with your own one !!!\r\n    CATCH cx_bcs INTO bcs_exception.\r\n      MESSAGE i865(so) WITH bcs_exception->error_type.\r\n  ENDTRY.\r\n\r\nENDFORM.\r\n\r\n\r\n\r\n*&-------------------------------*\r\n*&      Form  SUBMIT_REPORT_IN_BACKGROUND\r\n*&-------------------------------*\r\n*       text\r\n*----------------------------------------------------------------------*\r\n*  -->  p1        text\r\n*  <--  p2        text\r\n*----------------------------------------------------------------------*\r\nFORM submit_report_in_background .\r\n  DATA: jobname LIKE tbtcjob-jobname VALUE\r\n                             'TRANSFER DATA'.\r\n  DATA: jobcount LIKE tbtcjob-jobcount,\r\n        host     LIKE msxxlist-host.\r\n  DATA: BEGIN OF starttime.\r\n          INCLUDE STRUCTURE tbtcstrt.\r\n  DATA: END OF starttime.\r\n  DATA: starttimeimmediate LIKE btch0000-char1 VALUE 'X'.\r\n\r\n  DATA: wa_pernr LIKE LINE OF so_pernr.\r\n\r\n  REFRESH: seltab.\r\n\r\n  seltab_wa-selname = 'SO_PERNR'.\r\n\r\n  LOOP AT so_pernr INTO wa_pernr.\r\n    seltab_wa-sign    = wa_pernr-sign.\r\n    seltab_wa-option  = wa_pernr-option.\r\n    seltab_wa-low    = wa_pernr-low.\r\n    seltab_wa-high    = wa_pernr-high.\r\n    APPEND seltab_wa TO seltab.\r\n  ENDLOOP.\r\n\r\n* Job open\r\n  CALL FUNCTION 'JOB_OPEN'\r\n    EXPORTING\r\n      delanfrep        = ' '\r\n      jobgroup         = ' '\r\n      jobname          = jobname\r\n      sdlstrtdt        = sy-datum\r\n      sdlstrttm        = sy-uzeit\r\n    IMPORTING\r\n      jobcount         = jobcount\r\n    EXCEPTIONS\r\n      cant_create_job  = 01\r\n      invalid_job_data = 02\r\n      jobname_missing  = 03.\r\n  IF sy-subrc NE 0.\r\n    \"error processing\r\n  ENDIF.\r\n\r\n  SUBMIT (sy-cprog) AND RETURN   \"\r\n    WITH SELECTION-TABLE seltab\r\n    WITH p_keydat = p_keydat\r\n    WITH p_sendto = gd_email\r\n    USER sy-uname\r\n    VIA JOB jobname\r\n    NUMBER jobcount.\r\n\r\n*    SKIP.\r\n*    WRITE:\/ 'Program must be executed in background in-order for spool',\r\n*            'request to be created.'.\r\n\r\n* Close job\r\n  starttime-sdlstrtdt = sy-datum + 1.\r\n  starttime-sdlstrttm = '220000'.\r\n  CALL FUNCTION 'JOB_CLOSE'\r\n    EXPORTING\r\n      \"            event_id             = starttime-eventid\r\n      \"            event_param          = starttime-eventparm\r\n      \"            event_periodic       = starttime-periodic\r\n      jobcount             = jobcount\r\n      jobname              = jobname\r\n\"     laststrtdt           = starttime-laststrtdt\r\n\"     laststrttm           = starttime-laststrttm\r\n\"     prddays              = 1\r\n\"     prdhours             = 0\r\n\"     prdmins              = 0\r\n\"     prdmonths            = 0\r\n\"     prdweeks             = 0\r\n\"     sdlstrtdt            = starttime-sdlstrtdt\r\n\"     sdlstrttm            = starttime-sdlstrttm\r\n      strtimmed            = starttimeimmediate\r\n\"     targetsystem         = host\r\n    EXCEPTIONS\r\n      cant_start_immediate = 01\r\n      invalid_startdate    = 02\r\n      jobname_missing      = 03\r\n      job_close_failed     = 04\r\n      job_nosteps          = 05\r\n      job_notex            = 06\r\n      lock_failed          = 07\r\n      OTHERS               = 99.\r\n  IF sy-subrc EQ 0.\r\n    \"error processing\r\n  ENDIF.\r\n\r\nENDFORM.                    \" SUBMIT_REPORT_IN_BACKGROUND\r\n<\/pre>\n<\/p>\n<h2>Text pool values<\/h2>\n<p>\nSelection Text: P_ADMAIL = Admin Email<br \/>\nSelection Text: P_KEYDAT = Key date<br \/>\nSelection Text: SO_PERNR = Personnel Selection<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The below code to demonstrates how to email ABAP report PDF. It generates an ALV output of personal numbers (PERNRS) and then converts this to a PDF document. Its then sends an external email with the PDF as an attachment SAP ABAP report functionality used by this report Email address input selection screen fields Display [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2186,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Email ABAP report PDF - Display ABAP report of pernrs and email as PDF<\/title>\n<meta name=\"description\" content=\"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Email ABAP report PDF - Display ABAP report of pernrs and email as PDF\" \/>\n<meta property=\"og:description\" content=\"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/\" \/>\n<meta property=\"og:site_name\" content=\"SAP Help, Training and Education\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-27T05:29:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-28T00:14:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/convert-spool-pdf.png\" \/>\n\t<meta property=\"og:image:width\" content=\"331\" \/>\n\t<meta property=\"og:image:height\" content=\"234\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"se80\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"se80\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/\",\"url\":\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/\",\"name\":\"Email ABAP report PDF - Display ABAP report of pernrs and email as PDF\",\"isPartOf\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#website\"},\"datePublished\":\"2019-02-27T05:29:39+00:00\",\"dateModified\":\"2019-10-28T00:14:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511\"},\"description\":\"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment\",\"breadcrumb\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.se80.co.uk\/training-education\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email ABAP report PDF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#website\",\"url\":\"https:\/\/www.se80.co.uk\/training-education\/\",\"name\":\"SAP Help, Training and Education\",\"description\":\"Learn SAP\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.se80.co.uk\/training-education\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511\",\"name\":\"se80\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g\",\"caption\":\"se80\"},\"url\":\"https:\/\/www.se80.co.uk\/training-education\/author\/se80\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Email ABAP report PDF - Display ABAP report of pernrs and email as PDF","description":"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/","og_locale":"en_US","og_type":"article","og_title":"Email ABAP report PDF - Display ABAP report of pernrs and email as PDF","og_description":"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment","og_url":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/","og_site_name":"SAP Help, Training and Education","article_published_time":"2019-02-27T05:29:39+00:00","article_modified_time":"2019-10-28T00:14:52+00:00","og_image":[{"width":331,"height":234,"url":"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/convert-spool-pdf.png","type":"image\/png"}],"author":"se80","twitter_card":"summary_large_image","twitter_misc":{"Written by":"se80","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/","url":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/","name":"Email ABAP report PDF - Display ABAP report of pernrs and email as PDF","isPartOf":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#website"},"datePublished":"2019-02-27T05:29:39+00:00","dateModified":"2019-10-28T00:14:52+00:00","author":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511"},"description":"Email report as PDF - Example ABAP code to display an output report of pernrs and then convert this to a PDF document and send email with attachment","breadcrumb":{"@id":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.se80.co.uk\/training-education\/email-abap-report-pdf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.se80.co.uk\/training-education\/"},{"@type":"ListItem","position":2,"name":"Email ABAP report PDF"}]},{"@type":"WebSite","@id":"https:\/\/www.se80.co.uk\/training-education\/#website","url":"https:\/\/www.se80.co.uk\/training-education\/","name":"SAP Help, Training and Education","description":"Learn SAP","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.se80.co.uk\/training-education\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511","name":"se80","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g","caption":"se80"},"url":"https:\/\/www.se80.co.uk\/training-education\/author\/se80\/"}]}},"jetpack_featured_media_url":"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/convert-spool-pdf.png","_links":{"self":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2156"}],"collection":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":13,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2156\/revisions"}],"predecessor-version":[{"id":2525,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2156\/revisions\/2525"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media\/2186"}],"wp:attachment":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media?parent=2156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/categories?post=2156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/tags?post=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}