Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Printing the Screen Shot

Former Member
0 Kudos

Hi Guys,

I have a screen displaying various screen elements. I would like to print the screen to the output device when the "print" button is pressed on the standard toolbar. I would like to know whether there is any standard routine which I could call on the button pressed event.

Thanks in advance.

Prabs.

10 REPLIES 10

Former Member
0 Kudos

Hi,


form display_alv_report.
  gd_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
            i_callback_user_command = 'USER_COMMAND'
*            i_grid_title           = outtext
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
*            it_special_groups       = gd_tabgroup
            it_events               = gt_events  
<b>            is_print                = gd_prntparams </b> 
            i_save                  = 'X'
*            is_variant              = z_template
       tables
            t_outtab                = it_ekko
       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.
  endif.
endform.                    " DISPLAY_ALV_REPORT

Check this link for the whole code.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

Also if u r using


CALL METHOD o_alvgrid->set_table_for_first_display
     EXPORTING
       is_variant                    = w_variant
       i_save                        = c_a
       is_layout                     = p_layout
       it_special_groups             = p_groups[]
       it_toolbar_excluding          = p_exclude[]
    CHANGING
       it_outtab                     = p_output[]
       it_fieldcatalog               = p_fieldcat[]
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       OTHERS                        = 4.

  IF sy-subrc <> 0.
*    MESSAGE i278.
    LEAVE LIST-PROCESSING.
  ENDIF.

ENDFORM.                    " f9500_display_data

Here also if u call the method in the program u will get the print option is_print make it as X

Hope this helps u.

athavanraja
Active Contributor
0 Kudos

i guess you wanted HARD copy of the screen shot? right

if yes

click <b>alt+f12</b> and then click on <b>hard copy</b>.

Regards

Raja

0 Kudos

Just pressing the Print button and the specify the printer name. Print button is the std thing & the screen elements displayed in screen can be taken in the form print out when it is pressed.

regds

gv

0 Kudos

Thanks, This is what I want to do. But the same should happen when the "Print" button is pressed.

The default implementation of the Print button gives Error saying "This function is not possible here."

Is there any code which I can call when the print button is pressed to simulate the effect of pressing Alt+F12 and then selection Hard Copy.

0 Kudos

you can do ALT+F12 - >Hard Copy thru ABAP.

Regards

Raja

0 Kudos

Do you have any sample code for this.

Thanks,

Prabs.

0 Kudos

sorry what i wanted to say was

you <b>cannot</b> do ALT+F12 - >Hard Copy thru ABAP.

sorry, again, i was typing in a hurry.

Regards

Raja

0 Kudos

Hi Guys,

Can anyone please let me know how this can be done, I want to print the screen shot when i press the print button on the standard toolbar.

Its really very urgent for me please.

thanks,

Prabs.

0 Kudos

If you can figure out what code is being executed on the frontend when you do it manually, I guess its possible to call it.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Kindly close the thread if ur problem got solved or revert back with queries.