Application Development and Automation 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: 
Read only

How to define a default printer to a program without hardcoding?

Former Member
0 Likes
1,390

Hi Friends,

I have a program linked with Sapscript.

And I want the default printer for all the ppl using this program to be ABC and they are allowed to change any other printer they like.

How can I do that without hardcoding the default printer name in the calling program?

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
612

Hi Macy,

you can pass default printer name for a SapScript by passing print parameters in function OPEN_FORM. in function OPEN_FORM one input parameter is OPTIONS where you can pass structure ITCPO. you can definr default printer name in ITCPO-TDDEST. if you don't want to hardcode printer name then you can select it from table TSP03.

Hope it helps.

Regards,

Komal.

Read only

0 Likes
612

Hi Komal,

Thanks for your reply.

I know that I could define the default printer name in ITCPO-TDDEST in the calling program.

This hardcode method is what I don't want to.

Could you tell me more about the way that you suggested for selecting the printer name from table TSP03? Or there are other ways to do it?

Thanks in advance!

Read only

0 Likes
612

Hi Macy,

From TSP03 table you can select printers in your program based on application server, access method etc.

Regards,

Komal.

Read only

Former Member
0 Likes
612

Hi Macy,

You could also take the printer name from the user's profile (if it has been filled in). The user's default printer is held in table USR01 field SPLD. You can read this table using BNAME = sy-uname.

Regards, Paul.