{"id":632,"date":"2015-11-09T14:49:43","date_gmt":"2015-11-09T14:49:43","guid":{"rendered":"http:\/\/www.se80.co.uk\/training-education\/?p=632"},"modified":"2019-10-28T05:31:21","modified_gmt":"2019-10-28T05:31:21","slug":"email-alv-pdf","status":"publish","type":"post","link":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/","title":{"rendered":"Email ALV PDF using ABAP report of pernrs then email output as attachment"},"content":{"rendered":"<p>Useful ABAP code example to demonstrate how to display an SAP ALV report which displays alist of PERNR details and then automatically allows the user to email ALV PDF as a document attchement. The code covers the following SAP ABAP report functionality:<\/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 background<\/li>\n<li>ABAP report submits itself in background to create spool<\/li>\n<li>Pass parameter and select option to report submit<\/li>\n<li>Delete SAP spool request<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.se80.co.uk\/abap-by-example\/zrep\/zrep_email_alv_spool.htm\" target=\"_blank\">REPORT ZREP_EMAIL_ALV_SPOOL&#8230;.<\/a><\/p>\n<p><a href=\"http:\/\/www.se80.co.uk\/abap-by-example\/zrep\/zrep_email_alv_spool.htm\">Click here for ABAP code and more info<\/a><br \/>\n<br \/><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2015\/11\/email_alv_spool.png\" alt=\"email alv spool\" width=\"549\" height=\"166\" class=\"aligncenter size-full wp-image-1268\" srcset=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2015\/11\/email_alv_spool.png 549w, https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2015\/11\/email_alv_spool-300x91.png 300w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/p>\n<h2>ABAP code to send ALV report as PDF<\/h2>\n<pre>\r\n<span class=\"abapLineComment\">*&amp; TITLE: Display ABAP report of pernrs and email output as PDF<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; Report  ZREP_EMAIL_ALV_SPOOL<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp;<\/span>\r\n<span class=\"abapLineComment\">*&amp; SAP ABAP report functionality used<\/span>\r\n<span class=\"abapLineComment\">*&amp; **********************************<\/span>\r\n<span class=\"abapLineComment\">*&amp; Email address input selection screen fields<\/span>\r\n<span class=\"abapLineComment\">*&amp; Display ALV report using Objects cl_salv_table<\/span>\r\n<span class=\"abapLineComment\">*&amp; Add custom ALV column header<\/span>\r\n<span class=\"abapLineComment\">*&amp; Change colour of ALV rows based on user start year<\/span>\r\n<span class=\"abapLineComment\">*&amp; Get ALV Spool from background execution<\/span>\r\n<span class=\"abapLineComment\">*&amp; Convert Spool to PDF and send as Email<\/span>\r\n<span class=\"abapLineComment\">*&amp; Submit an ABAP report in background<\/span>\r\n<span class=\"abapLineComment\">*&amp; ABAP report submits itself in background to create spool<\/span>\r\n<span class=\"abapLineComment\">*&amp; Pass parameter and select option to report submit<\/span>\r\n<span class=\"abapLineComment\">*&amp; Delete SAP spool request<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\nREPORT ZREP_EMAIL_ALV_SPOOL.\r\n\r\nTABLES:  <a href=\"http:\/\/www.se80.co.uk\/saptables\/p\/pa00\/pa0001.htm\">PA0001<\/a>, <a href=\"http:\/\/www.se80.co.uk\/saptables\/p\/pa00\/pa0000.htm\">PA0000<\/a>.\r\n\r\nSELECTION-SCREEN BEGIN OF block block1 WITH FRAME title text-001.\r\n  SELECT-OPTIONS:   so_pernr for pa0001-pernr.\r\n  Parameters:       p_keydat type datum DEFAULT sy-datum.\r\n  Parameters:       p_email  type AD_SMTPADR default 'myemail@<span class=\"skimlinks-unlinked\">mydomain.com<\/span>'.\r\n<span class=\"abapLineComment\">* Ensure you always declare your email parameters using AD_SMTPADR. On one occasion<\/span>\r\n<span class=\"abapLineComment\">* when using somlreci1-receiver I found that the entered default resulted in a different<\/span>\r\n<span class=\"abapLineComment\">* underlying hexedecimal value which SAP did not recognise as a valid email address.<\/span>\r\n<span class=\"abapLineComment\">* For example during runtime take a look at the values contained in gd_email2 and<\/span>\r\n<span class=\"abapLineComment\">* gd_email3. You may notice that the hex values are different from p_email. Just<\/span>\r\n<span class=\"abapLineComment\">* somthing to think about if your email are not getting sent and SO_DOCUMENT_SEND_API1<\/span>\r\n<span class=\"abapLineComment\">* is returning an x_error.<\/span>\r\n\r\nSELECTION-SCREEN END OF block block1.\r\n\r\n<span class=\"abapLineComment\">*Data Declaration<\/span>\r\n<span class=\"abapLineComment\">*----------------<\/span>\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, <span class=\"abapComment\">\"table for cell colouring<\/span>\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:  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<span class=\"abapLineComment\">* Spool to PDF conversions<\/span>\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<span class=\"abapLineComment\">* Spool IDs<\/span>\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<span class=\"abapLineComment\">* Binary store for PDF<\/span>\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,  <span class=\"abapComment\">\"just for test\/demo<\/span>\r\n      gd_email3 type AD_SMTPADR.          <span class=\"abapComment\">\"just for test\/demo<\/span>\r\n\r\ndata: wa_addreess type sx_address.\r\n\r\n<span class=\"abapLineComment\">************************************************************************<\/span>\r\n<span class=\"abapLineComment\">* START-OF-SELECTION<\/span>\r\nSTART-OF-SELECTION.\r\n  gd_email = p_email.\r\n  gd_email2 = '#myemail@<span class=\"skimlinks-unlinked\">mydomain.com<\/span>'.\r\n  gd_email3 = '#myemail@<span class=\"skimlinks-unlinked\">mydomain.com<\/span>'.\r\n\r\n  PERFORM data_retrieval.\r\n  PERFORM display_settings.\r\n  perform set_row_colors.\r\n\r\n<span class=\"abapLineComment\">************************************************************************<\/span>\r\n<span class=\"abapLineComment\">* END-OF-SELECTION<\/span>\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_email_rep.\r\n    PERFORM delete_spool.\r\n  ELSE.\r\n    perform submit_report_in_background.\r\n  endif.\r\n\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM data_retrieval.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\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 <a href=\"http:\/\/www.se80.co.uk\/saptables\/p\/pa00\/pa0000.htm\">PA0000<\/a> 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   <span class=\"abapComment\">\"for ALL ENTRIES IN it_emps<\/span>\r\n   where <span class=\"abapComment\">\"a~pernr eq it_emps-pernr<\/span>\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.                    <span class=\"abapComment\">\" DATA_RETRIEVAL<\/span>\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM display_settings.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\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=&gt;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-&gt;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<span class=\"abapLineComment\">*   Add error processing<\/span>\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM display_alv_report.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\nFORM display_alv_report.\r\n<span class=\"abapLineComment\">* set_optimize will set columns optimised based on data and will remove<\/span>\r\n<span class=\"abapLineComment\">* any width specification setup within build_fieldcatalog column setup<\/span>\r\n<span class=\"abapLineComment\">*  it_columns-&gt;set_optimize( ).<\/span>\r\n\r\n  alv_table-&gt;display( ).\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM build_layout.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\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-&gt;get_layout( ).\r\n\r\n  layout_key-report = sy-repid.\r\n  layout-&gt;set_key( layout_key ).\r\n\r\n  layout-&gt;set_save_restriction( if_salv_c_layout=&gt;restrict_none ).\r\nENDFORM.                    <span class=\"abapComment\">\"BUILD_LAYOUT<\/span>\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM hide_columns.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\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-&gt;get_column( 'VORNA' ).\r\n      single_column-&gt;set_visible( if_salv_c_bool_sap=&gt;false ).\r\n      single_column = alv_columns-&gt;get_column( 'NACHN' ).\r\n      single_column-&gt;set_visible( if_salv_c_bool_sap=&gt;false ).\r\n\r\n    CATCH cx_salv_not_found INTO err_notfound.\r\n<span class=\"abapLineComment\">*   Add error processing<\/span>\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM build_fieldcatalog.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*  Your ALV report should get texts from the internal table used but you<\/span>\r\n<span class=\"abapLineComment\">*  overwrite them here if you require<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\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-&gt;get_column( 'BEGDA' ).\r\n      single_column-&gt;set_short_text( 'Start Date' ).  <span class=\"abapComment\">\"Will cause syntax error if text is too long<\/span>\r\n      single_column-&gt;set_medium_text( 'Start Date' ).\r\n      single_column-&gt;set_long_text( 'Employee Start Date' ).\r\n      single_column-&gt;SET_OUTPUT_LENGTH( '10' ). <span class=\"abapComment\">\"Force column to be wider to accomodate heading<\/span>\r\n\r\n    CATCH cx_salv_not_found INTO err_notfound.\r\n<span class=\"abapLineComment\">*   Add error processing<\/span>\r\n  ENDTRY.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM build_toolbar.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*  The code below simply displays all available functions but you can<\/span>\r\n<span class=\"abapLineComment\">*  restrict this if you require<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\nFORM build_toolbar.\r\n  DATA: toolbar_functions TYPE REF TO cl_salv_functions_list.\r\n\r\n  toolbar_functions = alv_table-&gt;get_functions( ).\r\n  toolbar_functions-&gt;set_all( ).\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp; FORM report_settings.<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\nFORM report_settings.\r\n  DATA: report_settings TYPE REF TO cl_salv_display_settings.\r\n\r\n  report_settings = alv_table-&gt;get_display_settings( ).\r\n  report_settings-&gt;set_striped_pattern( if_salv_c_bool_sap=&gt;true ).\r\n  report_settings-&gt;set_list_header( 'Demo SAP ALV Report and PDF email' ).\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp;      Form  SET_ROW_COLORS<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       text<\/span>\r\n<span class=\"abapLineComment\">*----------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*  --&gt;  p1        text<\/span>\r\n<span class=\"abapLineComment\">*  &lt;--  p2        text<\/span>\r\n<span class=\"abapLineComment\">*----------------------------------------------------------------------*<\/span>\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.    <span class=\"abapComment\">\" Colors strucutre<\/span>\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<span class=\"abapLineComment\">*   get Columns object<\/span>\r\n  lo_cols_tab = alv_table-&gt;get_columns( ).\r\n\r\n<span class=\"abapLineComment\">*Set column colour<\/span>\r\n<span class=\"abapLineComment\">*    TRY.<\/span>\r\n<span class=\"abapLineComment\">*        lo_col_tab ?= lo_cols_tab-&gt;get_column( 'PERNR' ).<\/span>\r\n<span class=\"abapLineComment\">*        ls_color-col = col_total.<\/span>\r\n<span class=\"abapLineComment\">*        lo_col_tab-&gt;set_color( ls_color ).<\/span>\r\n<span class=\"abapLineComment\">*      CATCH cx_salv_not_found.<\/span>\r\n<span class=\"abapLineComment\">*    ENDTRY.<\/span>\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). <span class=\"abapComment\">\"this year.<\/span>\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.<span class=\"abapComment\">\" eq other year<\/span>\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<span class=\"abapLineComment\">*   We will set this COLOR table field name of the internal table to<\/span>\r\n<span class=\"abapLineComment\">*   COLUMNS tab reference for the specific colors<\/span>\r\n  TRY.\r\n      lo_cols_tab-&gt;set_color_column( 'COLOR' ).\r\n    CATCH cx_salv_data_error.                           <span class=\"abapComment\">\"#EC NO_HANDLER<\/span>\r\n  ENDTRY.\r\nENDFORM.                    <span class=\"abapComment\">\" SET_ROW_COLORS<\/span>\r\n\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       FORM get_job_details                                          *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\nFORM get_job_details.\r\n<span class=\"abapLineComment\">* Get current job details<\/span>\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/g\/get_\/get_job_runtime_info.htm\">'GET_JOB_RUNTIME_INFO'<\/a>\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<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       FORM obtain_spool_id                                          *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\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  <a href=\"http:\/\/www.se80.co.uk\/saptables\/t\/tbtc\/tbtcp.htm\">TBTCP<\/a>\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   &lt;&gt; '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<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       FORM convert_spool_to_pdf                                     *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\nFORM convert_spool_to_pdf.\r\n\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/c\/conv\/convert_abapspooljob_2_pdf.htm\">'CONVERT_ABAPSPOOLJOB_2_PDF'<\/a>\r\n    EXPORTING\r\n      src_spoolid              = gd_spool_nr\r\n      no_dialog                = ' '\r\n      dst_device               = 'LOCL'\r\n    IMPORTING\r\n      pdf_bytecount            = gd_bytecount\r\n    TABLES\r\n      pdf                      = it_pdf_output\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  CHECK sy-subrc = 0.\r\n\r\n<span class=\"abapLineComment\">* Transfer the 132-long strings to 255-long strings<\/span>\r\n  LOOP AT it_pdf_output.\r\n    TRANSLATE it_pdf_output USING ' ~'.\r\n    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.\r\n  ENDLOOP.\r\n\r\n  TRANSLATE gd_buffer USING '~ '.\r\n\r\n  DO.\r\n    it_mess_att = gd_buffer.\r\n    APPEND it_mess_att.\r\n    SHIFT gd_buffer LEFT BY 255 PLACES.\r\n    IF gd_buffer IS INITIAL.\r\n      EXIT.\r\n    ENDIF.\r\n  ENDDO.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       FORM send_email                                               *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*  --&gt;  p_email                                                       *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\nFORM send_email_rep.\r\n  data: ld_sender type somlreci1-receiver.\r\n\r\n\r\n  DESCRIBE TABLE it_mess_att LINES gd_recsize.\r\n  CHECK gd_recsize &gt; 0.\r\n\r\n  CHECK NOT ( gd_email IS INITIAL ).\r\n\r\n  ld_sender = gd_email.\r\n\r\n  REFRESH it_mess_bod.\r\n\r\n<span class=\"abapLineComment\">* Default subject matter<\/span>\r\n  gd_subject         = 'Subject'.\r\n  gd_attachment_desc = 'Attachname'.\r\n<span class=\"abapLineComment\">*  CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.<\/span>\r\n  it_mess_bod        = 'Email Message Body text, line 1'.\r\n  APPEND it_mess_bod.\r\n  it_mess_bod        = 'Email message Body text, line 2...'.\r\n  APPEND it_mess_bod.\r\n\r\n<span class=\"abapLineComment\">* If no sender specified - default blank<\/span>\r\n  IF ld_sender EQ space.\r\n    gd_sender_type  = space.\r\n  ELSE.\r\n    gd_sender_type  = 'INT'.\r\n  ENDIF.\r\n\r\n\r\n<span class=\"abapLineComment\">* Send file by email as .pdf attachment<\/span>\r\n  PERFORM send_file_as_email_attachment\r\n                               TABLES IT_MESS_BOD\r\n                                      it_mess_att\r\n                                using gd_email\r\n                                      'Example pdf document email attachment'\r\n                                      'PDF'\r\n                                      gd_attachment_name\r\n                                      gd_attachment_desc\r\n                                      ld_sender\r\n                                      gd_sender_type\r\n                             changing gd_error\r\n                                      gd_reciever.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp;      Form  SEND_FILE_AS_EMAIL_ATTACHMENT<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       Send email<\/span>\r\n<span class=\"abapLineComment\">*----------------------------------------------------------------------*<\/span>\r\nFORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES IT_MESSAGE\r\n                                          it_attach\r\n                                    using p_email\r\n                                          p_mtitle\r\n                                          p_format\r\n                                          p_filename\r\n                                          p_attdescription\r\n                                          p_sender_address\r\n                                          p_sender_addres_type\r\n                                 changing p_error\r\n                                          p_reciever.\r\n\r\n\r\n  DATA: ld_error               TYPE sy-subrc,\r\n        ld_reciever            TYPE sy-subrc,\r\n        ld_mtitle              LIKE sodocchgi1-obj_descr,\r\n        ld_email               LIKE  somlreci1-receiver,\r\n        ld_format              TYPE  so_obj_tp,\r\n        ld_attdescription      TYPE  so_obj_nam,\r\n        ld_attfilename         TYPE  so_obj_des,\r\n        ld_sender_address      LIKE  soextreci1-receiver,\r\n        ld_sender_address_type LIKE  soextreci1-adr_typ,\r\n        ld_receiver            LIKE  sy-subrc.\r\n\r\n  data:   t_packing_list  like sopcklsti1 occurs 0 with header line,\r\n          t_contents      like solisti1 occurs 0 with header line,\r\n          t_receivers     like somlreci1 occurs 0 with header line,\r\n          t_attachment    like solisti1 occurs 0 with header line,\r\n          t_object_header like solisti1 occurs 0 with header line,\r\n          w_cnt           type i,\r\n          w_sent_all(1)   type c,\r\n          w_doc_data      like sodocchgi1.\r\n\r\n\r\n  ld_email   = p_email.\r\n  ld_mtitle = p_mtitle.\r\n  ld_format              = p_format.\r\n  ld_attdescription      = p_attdescription.\r\n  ld_attfilename         = p_filename.\r\n  ld_sender_address      = p_sender_address.\r\n  ld_sender_address_type = p_sender_addres_type.\r\n\r\n\r\n<span class=\"abapLineComment\">* Fill the document data.<\/span>\r\n  w_doc_data-doc_size = 1.\r\n\r\n<span class=\"abapLineComment\">* Populate the subject\/generic message attributes<\/span>\r\n  w_doc_data-obj_langu = sy-langu.\r\n  w_doc_data-obj_name  = 'SAPRPT'.\r\n  w_doc_data-obj_descr = ld_mtitle .\r\n  w_doc_data-sensitivty = 'F'.\r\n\r\n<span class=\"abapLineComment\">* Fill the document data and get size of attachment<\/span>\r\n  CLEAR w_doc_data.\r\n  READ TABLE it_attach INDEX w_cnt.\r\n  w_doc_data-doc_size =\r\n     ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).\r\n  w_doc_data-obj_langu  = sy-langu.\r\n  w_doc_data-obj_name   = 'SAPRPT'.\r\n  w_doc_data-obj_descr  = ld_mtitle.\r\n  w_doc_data-sensitivty = 'F'.\r\n  CLEAR t_attachment.\r\n  REFRESH t_attachment.\r\n  t_attachment[] = it_attach[].\r\n\r\n<span class=\"abapLineComment\">* Describe the body of the message<\/span>\r\n  CLEAR t_packing_list.\r\n  REFRESH t_packing_list.\r\n  t_packing_list-transf_bin = space.\r\n  t_packing_list-head_start = 1.\r\n  t_packing_list-head_num = 0.\r\n  t_packing_list-body_start = 1.\r\n  DESCRIBE TABLE it_message LINES t_packing_list-body_num.\r\n  t_packing_list-doc_type = 'RAW'.\r\n  APPEND t_packing_list.\r\n\r\n<span class=\"abapLineComment\">* Create attachment notification<\/span>\r\n  t_packing_list-transf_bin = 'X'.\r\n  t_packing_list-head_start = 1.\r\n  t_packing_list-head_num   = 1.\r\n  t_packing_list-body_start = 1.\r\n\r\n  DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.\r\n  t_packing_list-doc_type   =  ld_format.\r\n  t_packing_list-obj_descr  =  ld_attdescription.\r\n  t_packing_list-obj_name   =  ld_attfilename.\r\n  t_packing_list-doc_size   =  t_packing_list-body_num * 255.\r\n  APPEND t_packing_list.\r\n\r\n<span class=\"abapLineComment\">* Add the recipients email address<\/span>\r\n  CLEAR t_receivers.\r\n  REFRESH t_receivers.\r\n  t_receivers-receiver = ld_email.\r\n  t_receivers-rec_type = 'U'.\r\n  t_receivers-com_type = 'INT'.\r\n  t_receivers-notif_del = 'X'.\r\n  t_receivers-notif_ndel = 'X'.\r\n  APPEND t_receivers.\r\n\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/s\/so_d\/so_document_send_api1.htm\">'SO_DOCUMENT_SEND_API1'<\/a>\r\n    EXPORTING\r\n      document_data              = w_doc_data\r\n      put_in_outbox              = 'X'\r\n      sender_address             = ld_sender_address\r\n      sender_address_type        = ld_sender_address_type\r\n      commit_work                = 'X'\r\n    IMPORTING\r\n      sent_to_all                = w_sent_all\r\n    TABLES\r\n      packing_list               = t_packing_list\r\n      contents_bin               = t_attachment\r\n      contents_txt               = it_message\r\n      receivers                  = t_receivers\r\n    EXCEPTIONS\r\n      too_many_receivers         = 1\r\n      document_not_sent          = 2\r\n      document_type_not_exist    = 3\r\n      operation_no_authorization = 4\r\n      parameter_error            = 5\r\n      x_error                    = 6\r\n      enqueue_error              = 7\r\n      OTHERS                     = 8.\r\n\r\n<span class=\"abapLineComment\">* Populate zerror return code<\/span>\r\n  ld_error = sy-subrc.\r\n\r\n<span class=\"abapLineComment\">* Populate zreceiver return code<\/span>\r\n  LOOP AT t_receivers.\r\n    ld_receiver = t_receivers-retrn_code.\r\n  ENDLOOP.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       FORM delete_spool                                             *<\/span>\r\n<span class=\"abapLineComment\">*---------------------------------------------------------------------*<\/span>\r\nFORM delete_spool.\r\n  DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.\r\n\r\n  ld_spool_nr = gd_spool_nr.\r\n  check not ld_spool_nr is initial.\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/r\/rspo\/rspo_r_rdelete_spoolreq.htm\">'RSPO_R_RDELETE_SPOOLREQ'<\/a>\r\n    EXPORTING\r\n      spoolid = ld_spool_nr.\r\nENDFORM.\r\n\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*&amp;      Form  SUBMIT_REPORT_IN_BACKGROUND<\/span>\r\n<span class=\"abapLineComment\">*&amp;-------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*       text<\/span>\r\n<span class=\"abapLineComment\">*----------------------------------------------------------------------*<\/span>\r\n<span class=\"abapLineComment\">*  --&gt;  p1        text<\/span>\r\n<span class=\"abapLineComment\">*  &lt;--  p2        text<\/span>\r\n<span class=\"abapLineComment\">*----------------------------------------------------------------------*<\/span>\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<span class=\"abapLineComment\">* Job open<\/span>\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/j\/job_\/job_open.htm\">'JOB_OPEN'<\/a>\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    <span class=\"abapComment\">\"error processing<\/span>\r\n  endif.\r\n\r\n  submit (sy-CPROG) and return   <span class=\"abapComment\">\"<\/span>\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<span class=\"abapLineComment\">*    SKIP.<\/span>\r\n<span class=\"abapLineComment\">*    WRITE:\/ 'Program must be executed in background in-order for spool',<\/span>\r\n<span class=\"abapLineComment\">*            'request to be created.'.<\/span>\r\n\r\n<span class=\"abapLineComment\">* Close job<\/span>\r\n  starttime-sdlstrtdt = sy-datum + 1.\r\n  starttime-sdlstrttm = '220000'.\r\nCALL FUNCTION <a href=\"http:\/\/www.se80.co.uk\/sapfms\/j\/job_\/job_close.htm\">'JOB_CLOSE'<\/a>\r\n    exporting\r\n      <span class=\"abapComment\">\"            event_id             = starttime-eventid<\/span>\r\n      <span class=\"abapComment\">\"            event_param          = starttime-eventparm<\/span>\r\n      <span class=\"abapComment\">\"            event_periodic       = starttime-periodic<\/span>\r\n      jobcount             = jobcount\r\n      jobname              = jobname\r\n<span class=\"abapComment\">\"     laststrtdt           = starttime-laststrtdt<\/span>\r\n<span class=\"abapComment\">\"     laststrttm           = starttime-laststrttm<\/span>\r\n<span class=\"abapComment\">\"     prddays              = 1<\/span>\r\n<span class=\"abapComment\">\"     prdhours             = 0<\/span>\r\n<span class=\"abapComment\">\"     prdmins              = 0<\/span>\r\n<span class=\"abapComment\">\"     prdmonths            = 0<\/span>\r\n<span class=\"abapComment\">\"     prdweeks             = 0<\/span>\r\n<span class=\"abapComment\">\"     sdlstrtdt            = starttime-sdlstrtdt<\/span>\r\n<span class=\"abapComment\">\"     sdlstrttm            = starttime-sdlstrttm<\/span>\r\n      strtimmed            = starttimeimmediate\r\n<span class=\"abapComment\">\"     targetsystem         = host<\/span>\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    <span class=\"abapComment\">\"error processing<\/span>\r\n  endif.\r\n\r\nENDFORM.                    <span class=\"abapComment\">\" SUBMIT_REPORT_IN_BACKGROUND<\/span><\/pre>\n<h2>Text pool values<span id=\"ezoic-pub-ad-placeholder-136\" class=\"ezoic-adpicker-ad\"><\/span><\/h2>\n<div class=\"pattern\">Selection Text: P_ADMAIL = Admin Email<br \/>Selection Text: P_KEYDAT = Key date<br \/>Selection Text: SO_PERNR = Personnel Selection<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Useful ABAP code example to demonstrate how to display an SAP ALV report which displays alist of PERNR details and then automatically allows the user to email ALV PDF as a document attchement. The code covers the following SAP ABAP report functionality: Email address input selection screen fields Display ALV report using Objects cl_salv_table Add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Email ALV PDF using ABAP report of pernrs then email output as PDF<\/title>\n<meta name=\"description\" content=\"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document 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-alv-pdf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Email ALV PDF using ABAP report of pernrs then email output as PDF\" \/>\n<meta property=\"og:description\" content=\"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document attachment\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/\" \/>\n<meta property=\"og:site_name\" content=\"SAP Help, Training and Education\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-09T14:49:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-28T05:31:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2015\/11\/email_alv_spool.png\" \/>\n\t<meta property=\"og:image:width\" content=\"549\" \/>\n\t<meta property=\"og:image:height\" content=\"166\" \/>\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=\"14 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-alv-pdf\/\",\"url\":\"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/\",\"name\":\"Email ALV PDF using ABAP report of pernrs then email output as PDF\",\"isPartOf\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#website\"},\"datePublished\":\"2015-11-09T14:49:43+00:00\",\"dateModified\":\"2019-10-28T05:31:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511\"},\"description\":\"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document attachment\",\"breadcrumb\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.se80.co.uk\/training-education\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email ALV PDF using ABAP report of pernrs then email output as attachment\"}]},{\"@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 ALV PDF using ABAP report of pernrs then email output as PDF","description":"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document 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-alv-pdf\/","og_locale":"en_US","og_type":"article","og_title":"Email ALV PDF using ABAP report of pernrs then email output as PDF","og_description":"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document attachment","og_url":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/","og_site_name":"SAP Help, Training and Education","article_published_time":"2015-11-09T14:49:43+00:00","article_modified_time":"2019-10-28T05:31:21+00:00","og_image":[{"width":549,"height":166,"url":"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2015\/11\/email_alv_spool.png","type":"image\/png"}],"author":"se80","twitter_card":"summary_large_image","twitter_misc":{"Written by":"se80","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/","url":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/","name":"Email ALV PDF using ABAP report of pernrs then email output as PDF","isPartOf":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#website"},"datePublished":"2015-11-09T14:49:43+00:00","dateModified":"2019-10-28T05:31:21+00:00","author":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511"},"description":"Full ABAP code example to display PERNR report using standard ALV functionality and then sned the output as an email ALV PDF document attachment","breadcrumb":{"@id":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.se80.co.uk\/training-education\/email-alv-pdf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.se80.co.uk\/training-education\/"},{"@type":"ListItem","position":2,"name":"Email ALV PDF using ABAP report of pernrs then email output as attachment"}]},{"@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\/2015\/11\/email_alv_spool.png","_links":{"self":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/632"}],"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=632"}],"version-history":[{"count":8,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/632\/revisions"}],"predecessor-version":[{"id":2526,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/632\/revisions\/2526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media\/1268"}],"wp:attachment":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media?parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/categories?post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/tags?post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}