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

How to Implement badi BBP_OUTPUT_CHANGE_SF to call smartform

Hi Gurus,

My query is how do i implement the smartform.

I tried to debug the standard code.

I have used the following code and i dont get the output on the screen. Can you please guide me. If possible with sample code.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = form_name

IMPORTING

fm_name = lv_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

v_contract_no = e_header-object_id.

  • Set relevant control parameters

lv_control_parameters-getotf = l_x. "OTF output

lv_control_parameters-no_dialog = l_x. "No print dialog

lv_control_parameters-preview = space. "No preview

  • Set relevant output options

lv_output_options-tdnewid = l_x. "Print parameters,

lv_output_options-tddelete = space. "Print parameters,

lv_output_options-tddest = 'LP01'.

*function module to pass the internal tables containing data and

*output settings for smartform

CALL FUNCTION lv_fm_name

EXPORTING

control_parameters = lv_control_parameters

output_options = lv_output_options

user_settings = space

wa_text = wa_text

contract_no = v_contract_no

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = lv_ssf_output

  • JOB_OUTPUT_OPTIONS =

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

REFRESH lt_otfdata.

lt_otfdata[] = lv_ssf_output-otfdata[].

DATA: l_dummy TYPE STANDARD TABLE OF tline,

pdf_data TYPE xstring,

pdf_size TYPE i.

CLEAR: pdf_data, pdf_size.

  • convert otf to pdf

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

IMPORTING

bin_filesize = pdf_size

bin_file = pdf_data

TABLES

otf = lt_otfdata[]

lines = l_dummy

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.

data lt_content type bbpt_att_cont.

CALL FUNCTION 'BBP_OUTPUT_X_TABLESIZE_CHG'

EXPORTING

  • IV_APPEND = ' '

  • IV_BYTE_MODE = 'X'

  • IV_STRING =

iv_xstring = pdf_data

  • IV_SIZE =

IMPORTING

ev_size = pdf_size

  • EV_LINES =

  • EV_STRING =

  • EV_XSTRING =

TABLES

  • IT_DATA =

et_data = lt_content

  • EXCEPTIONS

  • NOENTRIES = 1

  • OTHERS = 2

.

CALL FUNCTION 'BBP_ALEWEB_DOWNLOAD'

EXPORTING

data_len = pdf_size

mime_type = 'APPLICATION/PDF'

  • DATA_TYPE = 'RAW'

tables

data_tab = lt_content

  • EXCEPTIONS

  • ITS_NOT_AVAILABLE = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

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

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

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 08:40 PM

    Hi

    <b>What is the detailed business requirement in your case ?</b>

    Which SRM version are you using ?

    <b>Please use the code to call the BADI - BBP_OUTPUT_CHANGE_SF / BBP_CHANGE_SF_SC</b>

    <u>For PDF output form change use BADI BBP_OUTPUT_CHANGE_SF.</u>

    <b>how-to-change-default-smartform-triggered-while-pr</b>

    <u>smartform-display</u>

    <b>add-a-printer----lp01</b>

    condition-dependent-document-output

    <b>other Related links -></b>

    add-a-printer----lp01

    sending-smart-form-to-printer-in-srm

    srm-po's-to-be-printed-out-with-the-po

    <u>Hope this will help. Do let me know.</u>

    Regards

    - Atul

    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.