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

SMART FORM Printing issue

Former Member
0 Likes
1,185

I am new in smart forms. I have some issues for printing the smart forms. I am not sure how can I print the smart forms. Here is the coding for the function module. when ever I try to print the smart form it is asking the printer name and all the option. wondering how can I populate that automaticaly, so once I run the program, it will not ask any printer name and other options. Please advice me. I am not sure what I am missing

Thanks

Toms


data: i_SSFCOMPOP like SSFCOMPOP occurs 0 with header line. 
data: i_SSFCTRLOP like SSFCTRLOP occurs 0 with header line. 

p_form = 'ZDFI_CUSTOMER_STATEMENT'. 

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' 
EXPORTING formname = p_form 
* variant = ' ' 
* direct_call = ' ' 
IMPORTING fm_name = fm_name 
EXCEPTIONS no_form = 1 
no_function_module = 2 
OTHERS = 3. 

IF sy-subrc <> 0. 
* error handling 
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
EXIT. 
ENDIF. 
clear: i_ssfcompop. 
refresh: i_ssfcompop. 

i_ssfcompop-TDPRINTER = p_print " Printer name from selection screen.. 
i_ssfcompop-TDNEWID = 'X'. 
i_ssfcompop-TDIMMED = 'X'. 
i_ssfcompop-TDDEST = 'X'. 
append i_ssfcompop. 



i_SSFCTRLOP-device = p_print. 
append i_SSFCTRLOP. 

CALL FUNCTION fm_name 
EXPORTING 
* ARCHIVE_INDEX = 
* ARCHIVE_INDEX_TAB = 
* ARCHIVE_PARAMETERS = 
CONTROL_PARAMETERS = i_SSFCTRLOP 
* MAIL_APPL_OBJ = 
* MAIL_RECIPIENT = 
* MAIL_SENDER = 
OUTPUT_OPTIONS = i_SSFCOMPOP 
USER_SETTINGS = 'X' 
* IMPORTING 
* DOCUMENT_OUTPUT_INFO = 
* JOB_OUTPUT_INFO = 
* JOB_OUTPUT_OPTIONS = 
TABLES 
zaddress = x_kna1 
ztotal = i_total 
ZMAIN = i_final 
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. 

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,125

HI,

<b>In Control Parameters:

1. Give I_SSFCTRLOP -NO_DIALOG = 'X '.</b>

pass the above field

<b>In the Output Options:</b>

2. Give i_ssfcompop-TDIMMED = 'X' .

3. Give i_ssfcompop-TDNEWID = 'X' .

4. USERSETTINGS = 'X'.

remember all other logic remains same.

let me know if you still have the problem

Mark all the helpful answers

Regards

Sudheer

I am new in smart forms. I have some issues for printing the smart forms. I am not sure how can I print the smart forms. Here is the coding for the function module. when ever I try to print the smart form it is asking the printer name and all the option. wondering how can I populate that automaticaly, so once I run the program, it will not ask any printer name and other options. Please advice me. I am not sure what I am missing

Thanks

Toms


data: i_SSFCOMPOP like SSFCOMPOP occurs 0 with header line. 
data: i_SSFCTRLOP like SSFCTRLOP occurs 0 with header line. 

p_form = 'ZDFI_CUSTOMER_STATEMENT'. 

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' 
EXPORTING formname = p_form 
* variant = ' ' 
* direct_call = ' ' 
IMPORTING fm_name = fm_name 
EXCEPTIONS no_form = 1 
no_function_module = 2 
OTHERS = 3. 

IF sy-subrc <> 0. 
* error handling 
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
EXIT. 
ENDIF. 
clear: i_ssfcompop. 
refresh: i_ssfcompop. 

i_ssfcompop-TDPRINTER = p_print " Printer name from selection screen.. 
i_ssfcompop-TDNEWID = 'X'. 
i_ssfcompop-TDIMMED = 'X'. 
i_ssfcompop-TDDEST = 'X'. 
append i_ssfcompop. 



i_SSFCTRLOP-device = p_print. 
append i_SSFCTRLOP. 

CALL FUNCTION fm_name 
EXPORTING 
* ARCHIVE_INDEX = 
* ARCHIVE_INDEX_TAB = 
* ARCHIVE_PARAMETERS = 
CONTROL_PARAMETERS = i_SSFCTRLOP 
* MAIL_APPL_OBJ = 
* MAIL_RECIPIENT = 
* MAIL_SENDER = 
OUTPUT_OPTIONS = i_SSFCOMPOP 
USER_SETTINGS = 'X' 
* IMPORTING 
* DOCUMENT_OUTPUT_INFO = 
* JOB_OUTPUT_INFO = 
* JOB_OUTPUT_OPTIONS = 
TABLES 
zaddress = x_kna1 
ztotal = i_total 
ZMAIN = i_final 
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. 

8 REPLIES 8
Read only

Former Member
0 Likes
1,125

Have you tried setting SSFCOMPOP-TDNOPREV?

Read only

0 Likes
1,125

I tried with that also by passing value 'X'. but no changes. and also I noticed one more thing is here

i_SSFCOMPOP-TDNOPREV = 'X'.

i_ssfcompop-TDPRINTER = p_print. " p_print from the selection screen..

i_ssfcompop-TDNEWID = 'X'.

i_ssfcompop-TDIMMED = 'X'.

i_ssfcompop-TDDEST = 'X'.

Only new spool request is comming as checked and every thing else is not

Read only

Former Member
0 Likes
1,125

Hi,

See the Below Program, look at the Bold ones

REPORT y_smartform1_new .

**************DECLARATIONS******************************

TABLES: zshail_t1,sflight.

DATA: cparam TYPE ssfctrlop,

outop TYPE ssfcompop,

fm_name TYPE rs38l_fnam,

my_tabix TYPE sy-tabix,

file_size TYPE i,

bin_filesize TYPE i.

DATA: tab_otf_data TYPE ssfcrescl,

pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,

itab LIKE TABLE OF zshail_t1 WITH HEADER LINE,

otab TYPE TABLE OF sflight WITH HEADER LINE,

tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE.

start-of-selection.

<b>**********suppressing the dialog box****************

outop-tddest = 'LP01'.

cparam-no_dialog = 'X'.

cparam-preview = space.

cparam-getotf = 'X'.</b>

****************for the first smartform**************

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSHAIL_SMFORM2'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = 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.

SELECT my_id my_income my_name FROM zshail_t1 INTO TABLE itab.

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

<b>control_parameters = cparam</b>

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = outop

user_settings = space

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

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

Sudheer

Read only

0 Likes
1,125

I have some more issue. I gave

i_ssfcompop-TDIMMED = 'X'. but it is not taking that. any Idea?

Read only

Former Member
0 Likes
1,125

Hi,

If you give <b>i_ssfcompop-TDIMMED = 'X'</b>, then it will give the Print immediately. i saw your program, it should take that parameter, see in the debugging mode whether it is there or not, if it is there then you need see the Printer

Regards

Sudheer

Read only

Former Member
0 Likes
1,126

HI,

<b>In Control Parameters:

1. Give I_SSFCTRLOP -NO_DIALOG = 'X '.</b>

pass the above field

<b>In the Output Options:</b>

2. Give i_ssfcompop-TDIMMED = 'X' .

3. Give i_ssfcompop-TDNEWID = 'X' .

4. USERSETTINGS = 'X'.

remember all other logic remains same.

let me know if you still have the problem

Mark all the helpful answers

Regards

Sudheer

Read only

0 Likes
1,125

When I tried to give <b>usersettings = space</b> then it worked.

Read only

0 Likes
1,125

Hi,

Basically, <b>User_Settings = 'X'</b> and <b>output_options defined in structure ssfcompop</b> are meant for same purpose. If User_settings is set to 'X', the user defaults for spool control are used. Otherwise, the output_options values for the printer, immediate output and spool retention period are evaluated.

Further, structure 'ssfctrlop' in control_parameters should be used to suppress the display of output dialog. Use field ssfctrlop-no_dialog to suppress dialog box for output.

Hope this was helpful.

Regards.