Application Development 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: 

OTF end command // missing in OTF data

0 Kudos
2,807

Hi All,

I'm sending Smartforms in Email attachment with an email body text but getting error as "OTF end command // missing in OTF data". I've attached the code below.

When I debug the code found that line 222 call function returning sy-subrc = 3 (send_error). Please let me know where im missing something.

* call smartform invoice
"Control Parameters
ls_control_param-getotf = 'X'.

CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
* mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = space
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = repeat
IMPORTING
job_output_info = ls_job_info
* document_output_info =
* job_output_options =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.

CALL FUNCTION 'Z_CONVERT_OTF_2_PDF_MAIL_ATTCH'
TABLES "I've used above custom call function to get data in PDF.
t_objbin = lt_objbin
t_itcoo = ls_job_info-otfdata.


Thank you,

Ankita.

8 REPLIES 8

FredericGirod
Active Contributor
2,609

Did you have something in ls_job_info-otfdata ?

0 Kudos
2,609

Hi Frederic,

No, its empty.

Sandra_Rossi
Active Contributor
0 Kudos
2,609

It means that you didn't close the form (see the control parameters NO_OPEN and NO_CLOSE mixed with the optional use of SSF_OPEN and SSF_CLOSE).

Sandra_Rossi
Active Contributor
0 Kudos
2,609

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

FredericGirod
Active Contributor
2,609

it is like chocolate, no OTF data no PDF conversion

You certainly forget one of the necessary parameters

Check the part 3 of this old blog

https://blogs.sap.com/2013/05/30/sending-mail-using-oo-2-smartforms/

Send the Smartform in PDF attachment with a text message.

0 Kudos
2,609

Hi Frederic,

Thank you so much for your response.

Just for confirmation following parameters I missed thatswhy i'm getting the error ryt?

MOVE : ‘X’ TO is_control_param–no_dialog ,

‘ ‘ TO is_control_param–preview ,
sy–langu TO is_control_param–langu ,
‘PRINTER’ TO is_control_param–device ,
‘X’ TO is_composer_param–tdnoprint ,
‘X’ TO is_composer_param–tdnoprev ,

‘X’ TO is_composer_param–tdfinal.

FredericGirod
Active Contributor
0 Kudos
2,609

yes, it could be