on 03-10-2007 6:12 AM
Hi,
Thanks to eveyone for reading this post.
I want to print a form thru smartform. I am able to do that now by calling that smart form and passing the data. Now i wanted to print multiple docs using smartform so that the dialog box printer doesnt apppear and all printing is executed without any user intervention.
I tried to call smart form in the following way so that data is printed to the printer without any thing appearing on the screen (dialog box).
I did consult the forums here and when i try it I either see the dialog box or see other sy-subrc.
Code -
Data: w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop.
W_COMPOP-tdnewid = 'X'.
W_COMPOP-tdFINAL = 'X'.
W_COMPOP-tdimmed = 'X'.
W_COMPOP-tddelete = 'X'.
W_COMPOP-tdcopies = 1 .
*W_COMPOP-TDNOPREV = 'X' .
W_COMPOP-TDDEST = 'LP01'.
*W_COMPOP-tdnoprint = 'X'.
W_ctrlop-DEVICE = 'PRINTER'. " Here we dont give printer name 'KX-P3696'.
w_ctrlop-no_dialog = 'X'.
w_ctrlop-preview = ''.
CALL FUNCTION '/1BCDWB/SF00000135'
*CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i would be glad if anyone can help me. I did a few RND in the code above to make it work but it dosent.
Moreover when the dialog box appears then there is a text in the bar below which says please maintain printer master data. (something like that). Is that creating a problem ?
Thanks,
JG
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,,
me also struggling from that same problem ,,
so i f u resolved that problem
can u plss send me the procedure how that we can resolve??
thank you..
Edited by: anil.neegineni on Nov 11, 2010 11:51 AM
Edited by: anil.neegineni on Nov 11, 2010 11:51 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{
REPORT ZANNTEST.
Data Declarations
DATA : control TYPE ssfctrlop,"Smart Forms: Control structure
output_options TYPE ssfcompop,"Smart Composer (transfer) options
v_fm TYPE rs38l_fnam."Form Name
control-preview = 'X'."Preview the output of Smartform
control-no_dialog = 'X'."Don't show Dialog
output_options-tddest = 'LOCL'."Spool: Output device
output_options-tdnoprint = 'X'."No printing from print preview
Function Module to get Generated Fucntion module of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZCONEXTNLETTER' " your created zform
IMPORTING
fm_name = v_fm
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.
CALL FUNCTION v_fm
EXPORTING
user_settings = ' ' " don't forget this option
control_parameters = control
output_options = output_options
PR_PERNR = '00001019' " it wil come from ur form parameters
PR_BEGDA = '19940101' " it will come from ut form parameters
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.
}
this is the best answer for ur requirement..
lets njyyyyyyyyyyy..
Thread Resolved:
If i maintain master data of output device then there is no problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.