Skip to Content
author's profile photo Former Member
Former Member

Suppressing dialog box in smartforms and convert OTF to PDF

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 09, 2005 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2005 at 03:35 AM

    LeGo,

    Try to pass a default printer to the parameters. Also, can you give some details of the short dump?

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.