Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OTF end command // missing in OTF data

Former Member
0 Likes
1,498

Hi Expert,

i m new to smartforms..I m facing a problem in smartforms while converting into pdf. when i run the program  I am getting the information message "OTF end command // missing in OTF data".  I have used the following function modules.

ALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname           = c_payslip_form

    IMPORTING

      fm_name            = lv_fm_name

    EXCEPTIONS

      no_form            = 1

      no_function_module = 2

      OTHERS             = 3.

  IF sy-subrc = 0.

    lwa_control_parameters-no_open  = abap_true.

    lwa_control_parameters-no_close = abap_true.

*kanishka

    CALL FUNCTION 'SSF_OPEN'

      EXPORTING

        output_options     = lwa_output_options

        control_parameters = lwa_control_parameters

      EXCEPTIONS

        formatting_error   = 1

        internal_error     = 2

        send_error         = 3

        user_canceled      = 4

        OTHERS             = 5.

    IF sy-subrc <> 0.

* Implement suitable error handling here

    ENDIF.

    LOOP AT pit_payslip_header INTO lwa_payslip_header.

      READ TABLE pit_payslip_item INTO lwa_payslip_item INDEX sy-tabix.

      CALL FUNCTION lv_fm_name

        EXPORTING

          control_parameters = lwa_control_parameters

          output_options     = lwa_output_options

          wa_header_data     = lwa_payslip_header-header

       IMPORTING

          job_output_info    = it_otf_data

       TABLES

          it_item_data       = lwa_payslip_item-item

        EXCEPTIONS

          formatting_error   = 1

          internal_error     = 2

          send_error         = 3

          user_canceled      = 4

          OTHERS             = 5.

      IF sy-subrc <> 0.

        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno DISPLAY LIKE 'E'

                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

        LEAVE LIST-PROCESSING.

      ENDIF.

     it_otf_data = it_otf_data.

      AT LAST.

          CALL FUNCTION 'CONVERT_OTF'

          EXPORTING

          format       = 'PDF'

          IMPORTING

          bin_filesize = bin_filesize

          TABLES

          otf          = it_otf_final

          lines        = it_pdfdata[].

          CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'

          EXPORTING

          line_width_dst = '255'

          TABLES

          content_in     = it_pdfdata[]

          content_out    = it_pdf[].

          IF sy-subrc = 0.

*          "Send mail

*          PERFORM send_mail.

          ENDIF.

          ENDAT.

    ENDLOOP.

3 REPLIES 3
Read only

SwadhinGhatuary
Active Contributor
0 Likes
780

Hi Kanishka,

Until unless u close the smart form by ssf_close the otf will not capture .

take one entry in internal table and cross check this.

Read only

suraj_meda
Discoverer
0 Likes
780

Hi Kanishka,

Are you passing the right internal table " it_otf_final" or " it_otf_data". to FM 'CONVERT_OTF'

Because i see the statement " it_otf_data = it_otf_data.",


If you are trying to convert the entire OTF data in the loop, can use the statement like:

"append lines of it_otf_data to it_otf_final"


Regards,

Suraj

Read only

gregorygotera
Explorer
0 Likes
780

Hi

You should mark  the parameter GETOTF inside the CONTROL_PARAMETERS table.

Regards

Gregory