2015 May 22 3:28 PM
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.
2015 May 26 10:36 AM
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.
2015 May 29 8:30 AM
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
2015 Jun 01 2:09 PM
Hi
You should mark the parameter GETOTF inside the CONTROL_PARAMETERS table.
Regards
Gregory