2013 Mar 06 12:35 PM
Hello Experts,
I'm writing a Batch Program where in it has P_File & P_Printer (File Path and Printer path with names).
I want to check if the provided value for P_PRINTER (the Printer name) exists or not. For example, we check for the File names exists.
I searched in SCN, but couldn't find a relevant thread. Is GET_PRINT_PARAMETERS FM used ti check? If yes, how?
Is there any Function Module to check if the Printer (input given in Selection-screen) exists or not?
Awaiting reply..
Thanks in advance.
Best Regards,
Sowmya
2013 Mar 06 1:30 PM
You will just need to check table tsp03d.
SELECT COUNT(*)
FROM tsp03d
WHERE name = p_printer
AND padisabled = abap_false.
IF sy-subrc = 0. "Printer exists and is not locked
"Do something
ENDIF.
2013 Mar 06 1:08 PM
Hello.
Check the table TSP03D, that table contains the name of the Printers on SAP.
Regards
2013 Mar 06 1:11 PM
Hi Sowmya,
Check the following tables:
TSP03 - Printer Declaration
TSP03A - Device Description
TSP03C - Device Description Extension
TSP03D - Device Description (New Format)
TSP0A - Device Types
TSP01 - Assignment of printers to terminals
This might help.
Thanks
Siva
2013 Mar 06 1:30 PM
You will just need to check table tsp03d.
SELECT COUNT(*)
FROM tsp03d
WHERE name = p_printer
AND padisabled = abap_false.
IF sy-subrc = 0. "Printer exists and is not locked
"Do something
ENDIF.
2013 Mar 06 1:41 PM
Hi,
I am not sure of any standard FM to validate the printer name but table TSP03 can certainly be used to validate the printer . Thanks.
Regards,
Kumud
2013 Mar 06 4:53 PM
2013 Mar 06 3:01 PM
2013 Mar 06 3:27 PM
Hi,
By using the table TSP03 you can know whether a printer exits or not.
Regards,
Vineesh.
2013 Mar 07 3:18 AM
Hi Sowmya,
Check this " RSPO_DEVICE_GET" FM , Just Pass "Output Device Name " in NAME like 'LP01'.
you got Printer Name with Path from this field "S_PAPROSNAME" , you can cross check with SPAD T-code -->Access Method Tab--> Host Printer filed name .
Also Check in SE37 " RSPO* " and press F4 you got Some FMs
OR Check this Piece of Code .
TABLES: TSP03D.
PARAMETERS :
S_DEVICE(30) OBLIGATORY LOWER CASE DEFAULT 'LP01'. "Output Devices like LP01,LOCL
*
FORMAT INTENSIFIED OFF.
SELECT SINGLE * FROM TSP03D WHERE
NAME = S_DEVICE.
IF SY-SUBRC EQ 0.
WRITE : / TSP03D-NAME COLOR COL_HEADING INVERSE.
WRITE : / TSP03D-PADEST, '<< short name !'.
WRITE : /6 TSP03D-PASTANDORT.
WRITE : /41 TSP03D-PATYPE.
WRITE : /52 TSP03D-PAMSSERVER.
WRITE : /61 TSP03D-PAPROSNAME.
WRITE : /72 TSP03D-PALPDHOST.
Regard's
Smruti
2014 Sep 18 8:27 AM
I've got similar requirement recently.
Declaring parameter like following should solve the issue.
Parameters:
p_prntr TYPE SYPDEST.
Conversion routing 'SPDEV' does all the necessary checks.