Saturday, December 18, 2010
We can print alv report without displaying on screen by passing print parameters through function module REUSE_ALV_LIST_DISPLAY or REUSE_ALV_GRID_DISPLAY.
Steps to print ALV Output
- define print parameters structure
" Workareas data: w_print type slis_print_alv.
- build w_print structure. double click on slis_print_alv structure, u will come to know what are the parameters u can pass using that structure.
w_print-print = 'X'.
- Pass w_print structure through REUSE_ALV_GRID_DISPLAY. Print parameters screen popup is displayed, Once press continue output is written to spool, after REUSE_ALV_GRID_DISPLAY function module call, we can find the spool number in sy-spono
data: l_program type sy-repid. l_program = sy-repid. call function 'REUSE_ALV_GRID_DISPLAY' exporting i_callback_program = l_program is_layout = w_layout it_fieldcat = i_fieldcat it_events = i_events is_print = w_print tables t_outtab = i_t001 exceptions program_error = 1 others = 2. if sy-subrc 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. elseif sy-subrc = 0. "sy-spono gives u spool no.. endif.
- Once u know the spool no .. u can get the spool using the below function module
"Variables data: l_no_of_bytes type i, l_pdf_spoolid like tsp01-rqident, l_jobname like tbtcjob-jobname, l_jobcount like tbtcjob-jobcount. call function 'CONVERT_ABAPSPOOLJOB_2_PDF' exporting src_spoolid = g_spool_no no_dialog = ' ' importing pdf_bytecount = l_no_of_bytes pdf_spoolid = l_pdf_spoolid btc_jobname = l_jobname btc_jobcount = l_jobcount tables pdf = i_pdf exceptions err_no_abap_spooljob = 1 err_no_spooljob = 2 err_no_permission = 3 err_conv_not_possible = 4 err_bad_destdevice = 5 user_cancelled = 6 err_spoolerror = 7 err_temseerror = 8 err_btcjob_open_failed = 9 err_btcjob_submit_failed = 10 err_btcjob_close_failed = 11 others = 12.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.