05-23-2006 3:38 PM
Hi,
I created a custom screen for my users, and I would like to give them the option of printing a hard copy of the information on the screen. I basically want to create a button that, when pushed, will perform the exact same function as when you go to the layout menu and select "hard copy". My users don't use the layout menu, so I'd like to make this easier by giving them a button right on the screen. What code do I need to use when my button's function is called to get the hard copy to print? I know how to set up the button, just not how to code for the print.
Thanks,
April King
05-23-2006 5:09 PM
I think what you mean is the hardcopy of sapgui options menu. This is a pure SAPGUI frontend function. I have no idea if this can be triggered from SAP program running on server.
But a solution is welcome!
regards,
Clemens
05-23-2006 3:44 PM
Create a PF status for your screen and define your buttons in your pf status.
you can use the syntax:
set pf-status 'XYZ'.
double click on the XYZ to create a pf status.
YOu can define your buttons on the application tool bar and attach a function code to the button.
In the pai section, you should handle your f-code to do what has to be done on the button click.
Regards,
ravi
05-23-2006 4:04 PM
Hi,
when you click that Button you need to do some thing like this...
write this code when you handle the Button,
this opens popup to give print prameters like printer name etc. if you don't want that then pass no_dialog = ' '.
Just check it. it depends on how you want to show the content, here i am just showing the values.
you can design it using write statements....
call function 'GET_PRINT_PARAMETERS'
exporting
immediately = 'X'
line_size = 220
release = 'X'
mode = 'CURRENT'
<b> no_dialog = 'X' </b>
importing
* OUT_ARCHIVE_PARAMETERS =
out_parameters = l_params
valid = l_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
new-page print on parameters l_params no dialog.
write 😕 field1,
field2,
field3.
new-page print off.
Regards
vijay
05-23-2006 5:09 PM
I think what you mean is the hardcopy of sapgui options menu. This is a pure SAPGUI frontend function. I have no idea if this can be triggered from SAP program running on server.
But a solution is welcome!
regards,
Clemens
05-23-2006 7:24 PM
Clemens,
Yes, this is what I meant. I already know how to set up the button on my screen, just not how to trigger the hardcopy print. For now I've decided to just pass my parameters to a basic program that will print a one-page report with all of the same information. The report will have the fields set up in the same positions on the page as they are on the screen. When the user clicks on the button on my screen, the report is submitted. I'll just stick with that for now, until someone can tell me how to trigger the hardcopy print.
Thanks,
April
05-23-2006 7:25 PM
I dont think you can execute the HARD copy functionality from program.
09-20-2007 8:00 PM
Thanks for your responses. We decided to just develop a simple report to print off the information in a user-friendly format (very similar to the screen itself). This report program is submitted when a button is pushed on the screen.
- April