04-03-2009 2:57 PM
Hi Guys,
In my selection screen I want a option to select the Printer to which I want to print my output.
In my selection screen I have a push button with name some Print.
When I click this my logic will run and Print the output to where I have selected my printer.
My requirement is:-
1) How can I put a selection for Printer in selection screen.
2) And how should I make the output to print immedialtely when I press my Push Button from the selection Screen.
Thanks in Advance,
Prasad.
04-03-2009 3:01 PM
HI,
Refer this Field TSP01_SP0R-RQDESTL to declare field on the selection screen you will get the F4 help.
While passing print_params pass 'X' to PRIMM field will help the printting immediately.
04-03-2009 3:01 PM
HI,
Refer this Field TSP01_SP0R-RQDESTL to declare field on the selection screen you will get the F4 help.
While passing print_params pass 'X' to PRIMM field will help the printting immediately.
04-03-2009 3:15 PM
Hi Avinash,
TSP01_SP0R-RQDESTL.
Does this table exist.
I checked TSP01 but there is no field with name RQDESTL.
Thanks,
Prasad.
04-03-2009 3:20 PM
Hi,
TSP01_SP0R is the structure and it has the field RQDESTL or you can use the SYST-PDEST .
PARAMETER : S_PRINTER TYPE TSP01_SP0R-RQDESTL..
OR
PARAMETER : S_PRINTER TYPE SYST-PDEST
The above both declaration can provide F4 help on the screen.
04-03-2009 3:29 PM
Thanks for your response Avinash.
I have done with this.
I have a small doubt .
As I send when I press the Push Button.. should I call my logic first or the function module.
So if I call the FM directly will my output be printed directly.
Thanks,
Prasad.
04-03-2009 3:34 PM
TABLES: sscrfields.
PARAMETER : s_pri TYPE tsp01_sp0r-rqdestl.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 10(10) push USER-COMMAND clic.
SELECTION-SCREEN END OF LINE.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = ' '
MODE = 'BATCH'
NO_DIALOG = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
LINE_SIZE = SY-LINSZ
LIST_NAME = 'NAME'
LIST_TEXT = 'Text name'
IMPORTING
OUT_PARAMETERS = PARAMS
VALID = VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
04-03-2009 3:36 PM
HI,
You need to call FM by passing the required parameter and the need to use the exporting parameter OUT_PARAMETERS .
Let me know what are you printing smartform Sapscript or list.
04-03-2009 3:44 PM
Hi Avinash I am printing Hirerchical List.
This uses two ITABS for Header & Item
How to pass this two ITABS.
Thanks,
Prasad.
04-03-2009 3:05 PM
Hi,
In addition to the selection field above;
Logic:
1) Use the FM: GET_PRINT_PARAMETERS to fetch the printer parameters
2) Use the FM: JOB_OPEN :Open Job Scheduling Without Dialog (Including COMMIT WORK)
3) Use the FM: JOB_SUBMIT: Insert Background Task in Background Request With COMMIT WORK
4) Use the FM:JOB_CLOSE: Close Background Request With COMMIT WORK
Hope this helps you
Regards
Shiva
04-03-2009 3:06 PM