12-09-2005 3:12 AM
Hi Guys,
I had been reading the threads regarding converting Smartforms to PDF and suppresing the output device dialog box. I have tried applying the codes I saw in the posts but I cannot seem to suppress the dialog box and I am getting a short dump converting my OTF to PDF. I am using CRM 5.0.
Here's my code:
FORM send_data_collect_performa .
DATA: lv_formname TYPE RS38L_FNAM.
s_control_parameters-no_dialog = 'X'.
s_control_parameters-getotf = 'X'.
s_output_options-tdnoprev = 'X'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZCUSRF006'
IMPORTING
FM_NAME = lv_formname
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 lv_formname
EXPORTING
CONTROL_PARAMETERS = s_control_parameters
OUTPUT_OPTIONS = s_output_options
MODEL_DESC = v_model
SERIAL_NO = v_serno
CUSTOMER = v_customer
JOB_NO = v_jobno
ADDRESS1 = v_bp_addr1
ADDRESS2 = v_bp_addr2
TEL_NUMBER = v_telno
FAX = v_telno
DATE_RECEIVED = v_rec_dt
PURCHASE_DATE = v_pur_dt
SRC_ADDR1 = v_source_addr1
SRC_ADDR2 = v_source_addr2
IMPORTING
JOB_OUTPUT_INFO = s_job_output_info
TABLES
I_ESTIMATE1 = i_estimate
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " send_data_collect_performa
FORM convert_otf_to_pdf .
CALL FUNCTION 'CONVERT_OTF_2_PDF'
TABLES
OTF = s_job_output_info-otfdata
DOCTAB_ARCHIVE = t_doctab_arch
LINES = t_pdf
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 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.
Please help. Thanks in advance.
12-09-2005 3:35 AM
LeGo,
Try to pass a default printer to the parameters. Also, can you give some details of the short dump?
Regards,
Ravi
12-09-2005 4:02 AM
Hi,
Here is the sample code.You need to pass the importing parameters for the FM 'CONVERT_OTF_2_PDF'.Kindly reward points by clicking the star on the left of reply,if it helps.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
Work Area declarations
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_len_in LIKE sood-objlen,
v_form_name TYPE rs38l_fnam.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST2'
importing
fm_name = v_form_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.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
<b>EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in</b>
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING ' ~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~ '.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
12-09-2005 6:32 AM
Hello Jayanthi,
Thanks for your quick reply. I was able to get rid of the short dump, and it seems to convert the OTF to PDF now.
However, I still cannot suppress the pop up box. I have tried putting the default printer as 'LOCL' and still getting the pop up.
LeGo
12-09-2005 6:42 AM
Did you gave NO_DAIALOG = 'X'. in control parameters..
regards
vijay
12-09-2005 6:51 AM
Hi Vijay,
Yes I did, here's the code which I originally pasted:
s_control_parameters-no_dialog = 'X'.
s_control_parameters-getotf = 'X'.
s_output_options-tdnoprev = 'X'.
Any thoughts?
Thanks,
Leowell
12-09-2005 7:03 AM
ds_print_opt-tddest = nast-ldest.
ds_print_opt-tdnoprint = ' '.
<b>* ds_print_opt-tdnoprev = ' '.</b>
ds_print_opt-tdimmed = nast-dimme.
ds_print_opt-tdcopies = nast-anzal.
ds_print_opt-tddelete = nast-delet.
ds_control-no_dialog = c_x.
ds_control-preview = xscreen.
ds_print_opt-tdnewid = c_x.
we gave like this we are not getting
any preview..
check the bold one we commented it....
12-09-2005 7:13 AM
Hi Lego,
There is another Program we are using...
there we passed like this..
control-preview = ' '.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = p_pid.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
output_options-tddest = p_pid.
now no dialog is coming....
please try this...
12-09-2005 7:16 AM
Hi Lego,
please try that and let me know if still you are having the same problem....
12-09-2005 7:17 AM
Hello Vijay,
I have also triend commenting that one out (TDNOPREV) and still got the pop up dialog for the output device. =(
12-09-2005 7:31 AM
data: control TYPE ssfctrlop,
control_parameters TYPE ssfctrlop.
<b>
control-preview = ' '.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = p_pid.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
output_options-tddest = p_pid.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
output_options = output_options
control_parameters = control_parameters
control = control
user_settings = ' '
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.
EXIT.
ENDIF.
</b>
after that ..
CALL FUNCTION fm_name
EXPORTING
output_options = output_options
control_parameters = control_parameters
user_settings = ' '
i_detail = i_detail
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.
check out the bold ones , are you calling SSF_OPEN please let me know..
12-09-2005 10:13 AM
Thanks a lot to those who have replied. It solved my problem. I really appreciate it.
I have awarded points base on your answers.