Default Printer name in Smartforms
Hi Experts,
When I am displaying Smart forms, an automatic popus is getting displayed which asks for current Printer.I am using LP01 as default printer.Can I hide this popup so while the user executes the program,he can directly view the Report screen.
regds,
Sam.
DATA : LF_FORMNAME TYPE TDSFNAME , " Smart Forms: Form Name
LF_FM_NAME TYPE RS38L_FNAM. " Name of Function Module
data : WA_CPARAM TYPE SSFCTRLOP,
WA_OUTPUT TYPE SSFCOMPOP.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = LF_FORMNAME
IMPORTING
FM_NAME = LF_FM_NAME.
WA_CPARAM-PREVIEW = 'X'.
WA_CPARAM-NO_DIALOG = 'X'.
WA_CPARAM-DEVICE = 'PRINTER'.
WA_OUTPUT-TDNOPRINT = 'X'. "No printing from print preview
WA_OUTPUT-TDDEST = 'LOCA'. "or 'LP01'. "Spool: Output device
CALL FUNCTION LF_FM_NAME
EXPORTING
CONTROL_PARAMETERS = WA_CPARAM
OUTPUT_OPTIONS = WA_OUTPUT
USER_SETTINGS = SPACE.
Similar Messages
-
How to find windows default printer name
Hi Experts,
I have one requirement.....smartform should print in local default printer.
you might be known in windows we can set default printer name .
Suppose when the user executes my program, smartform should print in the default windows printer. not sap default printer. I tried by giving printer name as LOCL. In that case it is displaying pop-window by showing printer name. I don't want to see that pop-up window.
If I pass printer name in the smartform function module.. it is not displaying pop-up window and printing directly.
For this we need to findout what is the default printer of that particular system.
I think ... there will be method / FM to findout the front end default printer name...
Pls help me..
Thanks in advance
Raghu
Edited by: r badveli on Apr 17, 2009 4:46 AMHi Raghu,
Check the following tables to fetch the printer settings of a user.
TSPUSRSEL - Spool: User-Specific Settings
TSP03D Spool: Device Description (New Format)
So that you can use this detail and can fill the printer name.
Hope this will be useful.
Thanks,
Rajesh. -
How to provide printer from programme if some condition fulfilled else ask use to enter printer name?
How to implement above logic?Hi Sandeep,
Following is the logic you need to implement in your driver program -
PARAMETERS: p_tddest TYPE recptddest OBLIGATORY.
And in your function module calling teh smartform pass ont he printer as shown below:
if (Ur condition ) is true -
g_ctrl_op-no_dialog = c_x
g_output_options-tddest = p_tddest. " printer
else.
g_ctrl_op-no_dialog = ' '.
Try this out.
Hope this helps.
Cheers,
Varna -
LookupPrintservices() gives default printer name alone...
Hello,
There are four printers in the network..operating system is LINUX ..when i run the program its showing only the default printer.
If i restart the cups service ,then its showing all the options.Why is it
so....
So each time when i open the application ,i have to restart the cups..Is this is right way?
Is there is any other optimistic way to show the printer options.
Following code
public static void main(String arg[])
PrintService[] services = PrinterJob.lookupPrintServices();
for(int i = 0 ;i < services.length;i++) {
System.out.println(i+":"+services.getName());
PrinterJob printerJob = PrinterJob.getPrinterJob();
if (printerJob.printDialog())
System.out.println("Printer is There... ");
PrintService service = printerJob.getPrintService();
System.out.println("printer Name = " +printerJob.getPrintService().getName());
Please help me to solve this....Urgent!!!!!!!!!!!!!!!
Message was edited by:
rithi_megaaOK now it really doesn't make sense. Your code is exporting which has nothing to do with printing from the viewer...
So, create your own Print Button and handle the file name yourself then you can call it anything you want and it gets printed from the export file name. If that third party PDF printer driver has an API available then you could populate the name there.
Use your line of code: FileDest.DiskFileName = TextBox2.Text.ToString + " - Postage Report.pdf"
to set the file name for that PDF Printer.
Sorry it's really not clear what you are trying to do...
Don -
Lf_fm_name error if default printer space
hı all
l want send smartform like pdf with mail but if default printer name space send_error or INTERNAL_ERROR in lf_fm_name function and ı dont write default printer . how can ı solved no write default printer name . you can see my code below .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSEFER_DETAY'
VARIANT = ' '"
DIRECT_CALL = ' '"
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*W_CTRLOP-no_open = 'X'.
**W_CTRLOP-no_close = 'X'.
W_CTRLOP-device = 'LP01'.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION lf_fm_name
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
gt_1003 = zsd_st09_01
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
TABLES
GT_1002 = GT_102
GT_1001 = gt_1001
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.hı madruha
W_CTRLOP-device = 'LP01'.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
*W_COMPOP-tdprinter = 'LP01'.
W_COMPOP-tdnewid = 'X'.
*W_COMPOP-TDNOARCH = 'X'.
*W_COMPOP-tddest = 'LP01'.
comm_val-adsmtp-smtp_addr = ismtp-smtp .
call function 'CONVERT_COMM_TYPE_DATA'
exporting
pi_comm_type = 'INT'
pi_comm_values = comm_val
importing
pe_device = w_ctrlop-device
pe_mail_recipient = mail_recipient.
CALL FUNCTION lf_fm_name
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
*OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
*mail_recipient = mail_recipient
gt_1003 = zsd_st09_01
yukleyen = yukle
sofor1 = sofor1
not1 = not1
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
TABLES
GT_1002 = GT_102
GT_1001 = gt_1001
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
okey applaying your solving but error sy-subrc 3 .
regard sinan . -
Set Default Printer based on user setting using Powershell script
Hi
I would like to create a script that runs on user log off and captures the default printer (set manually by the user) and then another script to reapply the settings (saved upon log off) when the user logs back in.
This is because local printers are set as default printer (PDF Creator Programs) when we all use Network Printers so this means a user has to set default printer to the network printer all the time.
I have found this script to start with:
$Printer = Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select name | out-file C:\temp\Printer.txt
But the out file looks like this:
name
\\PrinterserverName\Accounts01
Which I dont see how it can be used on another script plus there are spaces after\Account01
Any Ideas please?
M
MaelitoHi Maelito,
According to your description, you want to export the default printer name to text file, then read this printer name from text file and set the default printer via Powershell:
#save printer name to text file
Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select -ExpandProperty name | out-file C:\temp\Printer.txt
# read printer name from text file and set default printer
$name=get-content C:\temp\Printer.txt
(Get-WmiObject -Class Win32_Printer -Filter "Name='$name'").SetDefaultPrinter()
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
How to change the printer name in the User profile in the run time.
Hi
I am in need to change the printer name in the run time.
Do any one hav idea about this?
Thanks
KarthikThe user default settings can be changed using funtion module SUSR_USER_DEFAULTS_PUT.
Import parameter USER_DEFAULTS-SPLD will hold the default printer name. -
Mapping default printer based on AD attribute
Hi all !
Sorry for my english, i'll try to be clear... :)
I need to run a VBscript on TSE 2008 R2 servers to set computer's
default printer (not user). For this, I need to use the ClientName var.
The default printer name is written in the computer's description attribute in Active Directory.
I'm a beginner in VBscripting. I have parts of scripts working, but not everything.
Here is my script (my comments are written with ''''''''''''''''''''''''''''''''''''''''''''):
'find clientname
strComputer = "."
Const ForAppending = 8
Set oNetwork = wscript.CreateObject("wscript.network") 'Create network object
Set objShell = Wscript.CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
strUserName = oNetwork.userName
strComputerName = oNetwork.computerName
strClientName = objShell.ExpandEnvironmentStrings("%clientname%")
ExecuteSearch = SearchDistinguishedName(strClientName)
Public Function SearchDistinguishedName(ByVal vSAN)
Const ADS_SCOPE_SUBTREE = 2
Dim oRootDSE, oConnection, oCommand, oRecordSet
Set oRootDSE = GetObject("LDAP://rootDSE")
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = oConnection
ldstring = "'LDAP://" & oRootDSE.get("defaultNamingContext") & "'"
objCommand.CommandText = "Select Name, distinguishedName from "& ldstring & " where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
If lcase(objRecordSet.Fields("Name").Value) = lcase(vSan) Then
Wscript.Echo "Client Name: " & objRecordSet.Fields("Name").Value & vbCrLf _
& "Location: " & objRecordSet.Fields("distinguishedName").Value
'Wscript.Quit
End If
objRecordSet.MoveNext
Loop
End Function
' find canonical name
On Error Resume Next
ADSRoot = "DC=domain,DC=fr"
Const ADS_SCOPE_SUBTREE = 2
Set objConnection2 = CreateObject("ADODB.Connection")
Set objCommand2 = CreateObject("ADODB.Command")
objConnection2.Provider = "ADsDSOObject"
objConnection2.Open "Active Directory Provider"
Set objCommand2.ActiveConnection = objConnection2
objCommand2.Properties("Page Size") = 1000
objCommand2.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand2.CommandText = _
"SELECT * FROM 'LDAP://" & ADSRoot & "' WHERE objectCategory='user' OR objectCategory='computer'"
''''''''''''''''''''''''''''''''''''Here, I use a input box to enter the clientname, cause I don't know how to re-use the clientname found in the lasts vars.
srchTrm = LCase(InputBox("Please enter your search term.", "Active Directory Search"))
WScript.Echo srchTrm
i = 0
If Len(srchTrm) < 4 or Instr(srchTrm, "=") Then
WScript.Echo "Please enter a search term in excess of 3 characters. Don't use ""="""
WScript.Quit
End If
Set objRecordSet2 = objCommand2.Execute
objRecordSet2.MoveFirst
Do Until objRecordSet2.EOF
strADPath = LCase(objRecordSet2.Fields("adsPath").Value)
If InStr(strADPath, srchTrm) Then
Set objUser = GetObject(objRecordSet2.Fields("adsPath").Value)
Select Case objUser.Class
Case "user"
strMsg = "Type: Person" & VbCrLf
strMsg = strMsg & "Name: " & objUser.DisplayName & VbCrLf
strMsg = strMsg & "Email: " & objUser.mail & VbCrLf
strMsg = strMsg & "Telephone: " & objUser.telephoneNumber & VbCrLf
strMsg = strMsg & "Department: " & objUser.department & VbCrLf
strMsg = strMsg & "Title: " & objUser.title & VbCrLf
Case "computer"
strMsg = "Type: Computer" & VbCrLf
strMsg = strMsg & "Name: " & objUser.Get("name") & VbCrLf
strMsg = strMsg & "OS: " & objUser.operatingSystem & VbCrLf
Case Else
strMsg = "Unidentified" & VbCrLf
End Select
'strMsg = strMsg & "LDAP: " & objUser.adsPath & VbCrLf
objUser.GetInfoEx Array("canonicalName"), 0
strMsg = strMsg & "AD Path: " & objUser.canonicalName & VbCrLf
objUser.GetInfoEx Array("description"), 0
strMsg = strMsg & "Imprimante: " & objUser.description
WScript.Echo strMsg & VbCrLf
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Here I want to use the "objuser.description" to set default printer
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.SetDefaultPrinter "\\SRV-PRINT.domain.fr\" & objUser.description
i = i + 1
End If
objRecordSet2.MoveNext
Loop
If Not i > 0 Then
WScript.Echo "No results found."
End If
I think there's a most simple way to do this, but for the moment, I Don't know how to do.
Any help would be grateful.Hello.
We need to do this because each computer in the office as a network printer (or nearly each computer). I can't do a Group Policy for each computer in my domain. We cannot work with users accounts, only computers .
My problem is that if the user1 is connected on Comp1, he must have the printer near computer 1 as default printer.
If user1 is connected on computer 2, at the other side of the office, he must have the printer near computer 2. So I cannot imagine a group policy to do this :).
We had the idea to use the descprition attribute in Active Directory to indicate the default printer to map.
We must now make a script to get clientname on the TSE session, look for the computer account in Active Directory, read its description's attibute and map the default printer.
For example, my computer is COMP01. I use a TSE environment on SRVTSE01.
The script need to determine which computer (COMP01) is connected to the SRVTSE01 server (clientname var), search Active Directory computer account of COMP01, read the account's description attribute (for example PRINT01) and set \\SRV-PRINT\PRINT01 as the
default printer on COMP01.
Hope it's better with this example... -
How to Get Default Printer from ITS
Hi all,
I want to get the default printer name when i run application thru ITS ..
I have function module RSPO_FRONTEND_PRINTERS_FOR_DEV which shows the default printer available in the system but it is in SAPGUI and which dont work for ITS applications.
Does any body knows the function which brings Default printer in ITS . I appreciate your answers . I Appreciate your responses.
Thanks
Pradeep ReddyWith PrintGetPrinters(), I can get all printer in the list. If it is a bug, where to get the patch for 11.5?
My pb build is 11.5.1 4608.
Also, another alternative solution to get default printer with pb 11.5.1?
Another is: is Pb 11 and Pb 12 can be installed on windows XP side by side? -
Printer name under Win NT/2000
Hi,
Does anyone have a VI or an idea how to retrieve the "Default printer
name" under Windows NT/2000? I am using LabVIEW 6.02.
Thanks,
Patrick Pol
Vitatron, the netherlandsPatrick,
I can see where you might want this info, but I know all the Print Report' VIs default to the default printer; however, if you weren't sure which printer was presently set as the default, then it would matter when you print - such as a color printer vs. B/W.
Here are 2 links to some default printer VIs which may help, if not, just use them as info.
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&E091308B77D6A8C88625683A000AD4BA&cat=FD6839395C5E51CF862567AC005866A9
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&C7659492335F6AA08625695000650A7A&cat=FD6839395C5E51CF862567AC005866A9
Good Luck, Doug -
Change printer name for invoice
How can we change the Printer Name in SAP for Invoicing ?
Regards,
Aisha Ishrat.
ICI Pakistan.Hi,
In VF02 go to output determination.Here select the output type and select communication medium.Here you can set the Printer name.
But the default printer name can be set in user's own data
Reward points if useful
Regards,
Amrish Purohit -
Hi Oracle Masters,
Is there any way to get the default printer name at runtime, so that to specify it in DESNAME ??
As i want to assign different printer to specific module in my application.
Thank YouSo, you're using Webforms. Just to clear something out, which default printer name do you mean? The Server default printer or the client?
You're sure aware that the Reports Server is running on the server, and therefore you must mean the default printer of the server. Right? Since the default printer almost never change, I would create a key in $ORACLE_HOME/reports/conf/cgicmd.dat and use this when printing.
//Martin -
when I open up an e-mail attachment a box pops up PRINT TO FILE below that line OUTPUT FILE NAME with an empty line for the file name vs. simply going to my default printer?
Make sure that '''''Print to File''''' isn't selected in the native print dialog box ''(see screenshot below)'' middle-right, and make sure your Printer is selected at the top of that dialog box.
''I'm a little confused why an email attachment would need to go directly to the printer, but that's what you asked about.'' -
Smartform font spacing Issue when using SAP printer name
Hi Friends,
I am facing some spacing issues when printing a form using SAP printer name. If I use LOCL then the output comes perfectly but when I use the SAP printer name the space between characters are getting widened and so the alignment of each column goes wayward. I suspect it could be due to the device type but not sure which seeting controls this. There is a similar problem in the logo as well. When using LOCL the logo comes out good but when using the printer name the quality is not good and becomes pixelised. Have any of you faced similar issues? Can you provide some guidance or pointers for the solution.
Device type of LOCL : ZSAPWIN
Device type of SAP printer name : ZHPLJ5
CPI is defined in smartform as 10.
Please let me know if you need more information.
Thanks,
PraveenHi,
This problem occurs because the printer driver for both the printers are different,
I suggest you use Local printer only or configure any other printer with printer diver in SAP as SAPWIN.
Regards,
Bharat. -
How to avoid printer name prompt while calling Smartform
Hi All,
I am calling smartform FM from my program. I am passing following settings in Output-Options and Control-Parameters:
wa_outputoptions-tddest = 'LP01'. "Printer name
wa_outputoptions-tdnewid = 'X'. "New request
wa_controlpara-device = 'PRINTER'. "Device
wa_controlpara-no_dialog = 'X'. "No dialog
Even after these settings I am getting prompt which asks printer name and other details.
Please tell me how I can avoid the prompt which asks printer name and other settings such as new spool request and print immediately.
Thanks in Advance.
Regards,
VijayHi Vijay,
Try like this.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
<b> control_parameters = wa_controlpara</b>
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
<b>output_options = wa_outputoptions
user_settings = space</b>
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = tab_otf_data
JOB_OUTPUT_OPTIONS =
TABLES
it_tab = itab[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
Regards,
SP.
Maybe you are looking for
-
How can I register my new ipad air?
How do I register my new ipad air?
-
Hello NWDI gurus!! I have a few questions regarding track creation process in NWDI. In our environment here, we have Portal development going on... We have the following systems in our landscape... Portal dev, Portal Sandbox, Portal Q, Portal Prod
-
Which new hardware should I buy
Hi I'm new to the forum and would like some help with my next purchase. I was wondering which would give me better performace a P4 2.8 with HT or Kinston hyper x 512 dual channel kit PC3700? I would like to buy one of these due to the cost, so I ju
-
Audition 3.0 installation stymied by missing version 1 CD
Just built a new PC with Win 7 64-bit, and am in the process of reinstalling core software. Ran into a snag installing Audition 3.0 as I have somehow misplaced the CD for v. 1, and I need that previous version serial number for the v. 3 install, sin
-
AE Error encountered during update (U44M1P7)
Hi. Updating AE CC, on Mac OSX 10.9.5. "Errors encountered during installation (U44M1P7), What do I do next? Thanks, Joe Boulden