on 07-15-2009 3:19 AM
Hi all,
I have some problems with my code below. My requirements are to get the form print immediately without the dialog, as well as create a spool for next print purposes.
Can someone please tell me what is wrong with my code?
Many thanks in advance.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
data: LS_CONTROL_PARAM TYPE SSFCTRLOP.
data: LS_OUTPUT_PARAM TYPE SSFCOMPOP.
DATA: ls_job_info TYPE ssfcrescl.
LS_OUTPUT_PARAM-TDNOPREV = 'X'.
LS_OUTPUT_PARAM-TDNOPRINT = 'X'.
LS_OUTPUT_PARAM-tdimmed = SPACE.
LS_OUTPUT_PARAM-tdcopies = 1.
LS_OUTPUT_PARAM-tddelete = 'X'.
LS_OUTPUT_PARAM-tdnewid = 'X'.
LS_OUTPUT_PARAM-tddest = 'P098'.
LS_OUTPUT_PARAM-tdFINAL = 'X'.
LS_CONTROL_PARAM-device = 'PRINTER'.
LS_CONTROL_PARAM-getotf = SPACE.
LS_CONTROL_PARAM-no_dialog = 'X'.
LS_CONTROL_PARAM-preview = 'X'.
LS_CONTROL_PARAM-no_open = 'X'.
LS_CONTROL_PARAM-no_close = 'X'.
call function 'SSF_OPEN'
exporting
USER_SETTINGS = SPACE
OUTPUT_OPTIONS = LS_OUTPUT_PARAM
control_parameters = LS_CONTROL_PARAM
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
call function fm_name
exporting
control_parameters = LS_CONTROL_PARAM
output_options = LS_OUTPUT_PARAM
user_settings = SPACE
customer = customer
bookings = bookings
connections = connections
importing
job_output_info = ls_job_info
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
call function 'SSF_CLOSE'
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
others = 4.
call function 'SSF_READ_ERRORS'
importing
errortab = errtab.
Hi Myahsam,
Refer this [Link|http://help.sap.com/saphelp_nw70/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm]
Regards,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
u should pass the below values to OUTPUT_OPTIONS & Contol_parameters..
l_t_out-tddest = 'LOCL'.
l_t_out-tdimmed = 'X'.
l_t_out-TDNOPRINT = 'X'.
l_t_out-tddelete = 'X'.
l_t_control-no_dialog = 'X'.
Hope it hellps!!
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vishnu,
I tried this, it is still not immediately printed.
LS_OUTPUT_PARAM-TDNOPREV = 'X'.
LS_OUTPUT_PARAM-TDNOPRINT = 'X'.
LS_OUTPUT_PARAM-tdimmed = 'X'.
LS_OUTPUT_PARAM-tdcopies = 1.
LS_OUTPUT_PARAM-tddelete = 'X'.
LS_OUTPUT_PARAM-tdnewid = 'X'.
LS_OUTPUT_PARAM-tddest = 'LOCL'.
LS_OUTPUT_PARAM-tdFINAL = 'X'.
LS_CONTROL_PARAM-device = 'PRINTER'.
LS_CONTROL_PARAM-getotf = SPACE.
LS_CONTROL_PARAM-no_dialog = 'X'.
LS_CONTROL_PARAM-preview = 'X'.
LS_CONTROL_PARAM-no_open = 'X'.
LS_CONTROL_PARAM-no_close = 'X'.
Hi pavan,
Appreciate for your help. When I executed the program, first, it prompts me the selection option screen. After I filled all the necessary fields, I clicked on "execute" button, it will goes to the preview screen.
What my requirement is the print out should also execute immediately after the preview screen display.
Also, my requirement needs to create a spool id in SP01.
Can it be done?
Thanks.
Wong,
Please create one test program and test this program. It prints directly and keeps spool number. I can see that in SP01.
This code is same as before i posted yesterday except one line commented.
Thanks
Venkat.O
REPORT ztest_smartform.
DATA:it_nfal TYPE nfal OCCURS 0 WITH HEADER LINE.
DATA:fm_name TYPE rs38l_fnam.
DATA:ssfctrlop TYPE ssfctrlop.
"START-OF-SELECTION.
START-OF-SELECTION.
"select data
SELECT * FROM nfal INTO TABLE it_nfal UP TO 10 ROWS.
ssfctrlop-no_dialog = 'X'. "Just set this one. It gives what you want.
"Get Function module name for given smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = fm_name.
"Call Smartform function module.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ssfctrlop
* output_options = ssfcompop "commented one
TABLES
it_nfal = it_nfal.
Hi venkat,
Thanks for the follow up.
I have copied your code (the latest one) and created a dummy smartforms.
Program and smartforms compiled successfully. Now, I execute it, the print dialog is prompt again.
Is there any profile settings difference between you and me?
Why the print dialog is still displaying?
Very strange.
Hi Wong,
<li>Instead of using SS_OPEN and SSF_CLOSE, you can use directly function module which is generated when you activate smartform.
<li>Check the program and see what needs to be done to get what u want.
I hope that it solves your requirement.
Thanks
Venkat.OREPORT ztest_smartform.
DATA:it_nfal TYPE nfal OCCURS 0 WITH HEADER LINE.
DATA:fm_name TYPE rs38l_fnam.
DATA:ssfctrlop TYPE ssfctrlop.
"START-OF-SELECTION.
START-OF-SELECTION.
"select data
SELECT * FROM nfal INTO TABLE it_nfal UP TO 10 ROWS.
ssfctrlop-no_dialog = 'X'. "Just set this one. It gives what you want.
"Get Function module name for given smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = fm_name.
"Call Smartform function module.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ssfctrlop
output_options = ssfcompop
TABLES
it_nfal = it_nfal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.