Skip to Content
author's profile photo
Former Member

Get OTF data for a sales order document

I have a problem in getting the information of the created sales order document number as OTF data. I need this OTF data so to convert into PDF format using function module 'CONVERT_OTF_2_PDF'. My situation is i am keeping a parameter for sales order document number . when i execute the report after giving a sales order document number, i should get the OTF data .

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Oct 04, 2005 at 01:43 AM

    Hi!

    Firstly you have to define what technique is used for creation of sales order as printed document - smartform or sapscript. Then proceed as follows.

    In case of smartform:

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'ZFORMNAME'

    IMPORTING

    fm_name = v_form_name

    EXCEPTIONS

    no_form = 1

    no_function_module = 2

    OTHERS = 3.

    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.

    i_otf[] = w_return-otfdata[].

    In case of sapscript:

    options-tdgetotf = 'X'.

    CALL FUNCTION 'OPEN_FORM'

    EXPORTING

    options = options

    ...

    CALL FUNCTION 'CLOSE_FORM'

    • IMPORTING

    • RESULT =

    • RDI_RESULT =

    TABLES

    otfdata = i_otf

    EXCEPTIONS

    unopened = 1

    bad_pageformat_for_print = 2

    send_error = 3

    spool_error = 4

    OTHERS = 5.

    i_otf -

    Regards,

    Maxim.

    Add comment
    10|10000 characters needed characters exceeded