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

print priview in smartforms

Former Member
0 Likes
907

Hi experts,

If i select printer name in the selection screen..


SELECTION-SCREEN BEGIN OF BLOCK P1 WITH FRAME  TITLE TEXT-005.
PARAMETERS : P_PRINT LIKE NAST-LDEST.
SELECTION-SCREEN END OF BLOCK P1.

I want to get that printer name in print privew in smartforms....

How can i achive this?

Reward guaranteed

thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

Hi kaki,

1. like this :

BOLD is important.

Also

USER_SETTINGS = space

<b>

(This parameter is Imporant, do not comment this parameter,

instead pass like this only,

other wise OUR PRinter will not get selected !

)</b>

DATA: output_options TYPE ssfcompop.

<b>output_options-tddest = 'LOC1'. <----


your printer</b>

funcname = '/1BCDWB/SF00000100'.

CALL FUNCTION funcname

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT = 'mamit'

  • MAIL_SENDER =

<b> output_options = output_options

USER_SETTINGS = space</b>

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = output_data

  • JOB_OUTPUT_OPTIONS =

TABLES

p9002 = p9002

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

BREAK-POINT.

regards,

amit m.

Hi experts,

If i select printer name in the selection screen..


SELECTION-SCREEN BEGIN OF BLOCK P1 WITH FRAME  TITLE TEXT-005.
PARAMETERS : P_PRINT LIKE NAST-LDEST.
SELECTION-SCREEN END OF BLOCK P1.

I want to get that printer name in print privew in smartforms....

How can i achive this?

Reward guaranteed

thanks

kaki

6 REPLIES 6
Read only

Former Member
0 Likes
825

HI Kaki,

TDDEST of SSFCOMPOP contains the device name..

just pass this to the FM in Output options in exporting parameters..

SELECTION-SCREEN BEGIN OF BLOCK P1 WITH FRAME TITLE TEXT-005.

PARAMETERS : P_PRINT LIKE NAST-LDEST.

SELECTION-SCREEN END OF BLOCK P1.

.....

data : dev type SSFCOMPOP.

dev-TDDEST = p_PRINT.

CALL FUNCTION...

EXPORTING

....

OUTPUT_OPTIONS = dev

...

regards

satesh

Read only

Former Member
0 Likes
825
DATA param TYPE SSFCTRLOP
param-device = ."Device name"

and pass it as a parameter to the smartform

CALL FUNCTION 'your_smartform'

IMPORTING

CONTROL_PARAMETERS = param

.

Read only

Former Member
0 Likes
826

Hi kaki,

1. like this :

BOLD is important.

Also

USER_SETTINGS = space

<b>

(This parameter is Imporant, do not comment this parameter,

instead pass like this only,

other wise OUR PRinter will not get selected !

)</b>

DATA: output_options TYPE ssfcompop.

<b>output_options-tddest = 'LOC1'. <----


your printer</b>

funcname = '/1BCDWB/SF00000100'.

CALL FUNCTION funcname

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT = 'mamit'

  • MAIL_SENDER =

<b> output_options = output_options

USER_SETTINGS = space</b>

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = output_data

  • JOB_OUTPUT_OPTIONS =

TABLES

p9002 = p9002

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

BREAK-POINT.

regards,

amit m.

Read only

Former Member
0 Likes
825

hi kaki,

To the funcion module that is generated by the smartforms there is a parameter called Control parameters.

Declare internal table it_print like SSFCTRLOP.

it_print-device = P_PRINT.

hope this helps,

priya

Read only

0 Likes
825

Hi Wenceslaus,Amit,Satish,

Thanks for all replies.

Points alloted.

thanks

kaki

Read only

Former Member
0 Likes
825

Hi Kaki,

you follow the following two steps :

1. In your layout, write in any text where you want to print he name of printer : &OUTPUT_OPTIONS-TDDEST&

(NOTE THIS IS MENTIONED IN THE IMPORT PARAMETER OF THE FORM INTERFACE).

2. In your program,

copy paste the following code and run it : ( you will get the result once you activate both the layout and the program)

Report zkunal.

DATA : OUTPUT_OPTIONS TYPE ssfcompop.

OUTPUT_OPTIONS-TDDEST = 'LP01'.

" LP01 is printer name

CALL FUNCTION '/1BCDWB/SF00000071'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = OUTPUT_OPTIONS

USER_SETTINGS = SPACE

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

  • 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.

When you get execute this , you can see the printer name in your smart form.

Thanks and Regards,

Kunal