Application Development 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: 

Printer Selection on Selection-Screen

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

9 REPLIES 9

Former Member
0 Kudos

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.

0 Kudos

Hi Avinash,

TSP01_SP0R-RQDESTL.

Does this table exist.

I checked TSP01 but there is no field with name RQDESTL.

Thanks,

Prasad.

0 Kudos

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.

0 Kudos

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.

0 Kudos
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.

0 Kudos

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.

0 Kudos

Hi Avinash I am printing Hirerchical List.

This uses two ITABS for Header & Item

How to pass this two ITABS.

Thanks,

Prasad.

Former Member
0 Kudos

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

former_member156446
Active Contributor
0 Kudos

search SCN with 'GET_PRINT_PARAMETERS' to print