2012 Dec 31 5:50 AM
Hi genius,
am try to convert the .pdf for my report , but its showing the error " OTF End command // missing in OTF data" .
Please refer bellow screen-shot and reply to me...
my OTFdata [] = no data ...
how to get the result.
2012 Dec 31 6:40 AM
Hi Subramani,
These are the steps for converting to pdf.
1.Get SF FM name by SSF_FUNCTION_MODULE_NAME
2.Then call SF CALL FUNCTION <fm_name> " As you did in the screenshot
3. Call FM CONVERT_OTF_2_PDF and convert to PDF from the OTF data
pass OTF data as
TABLES
otf = st_job_output_info-otfdata " search in SDN for sample codes..
4.Go to debugging and check all steps are executing fine with data
5.Get the filename to store the PDF
use
CREATE OBJECT v_obj. " TYPE REF TO cl_gui_frontend_services,
CALL METHOD v_obj->file_save_dialog
6. Now call GUI_DOWNLOAD for saving you file in desktop
Thanks
Ben
2012 Dec 31 8:11 AM
Hi Subramani,
Data: control_parameter type ssfctrlop.
control_parameter-getotf = 'X'.
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_otf_from_fm TYPE ssfcrescl,
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
W_bin_filesize TYPE i,
filename type localfile.
you have to pass it
call function fm_name
Exporting
control_parameter = control_parameter.
importing
job_output_info = t_otf_from_fm
if sy-subrc eq 0.
t_otf[] = t_otf_from_fm-otfdata[].
endif.
after this you call a fm.
call function convert_otf
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
* BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
if sy-subrc eq 0.
call function gui_download
EXPORTING
BIN_FILESIZE = W_bin_filesize
filename = FILE_NAME
FILETYPE = 'BIN'
tables
data_tab = T_pdf_tab
you follow this process. hope its helpful to you....
Thanks
Sabyasachi
2013 Jan 29 5:05 AM
2012 Dec 31 7:20 AM
2013 Jan 29 5:06 AM
2014 Aug 27 6:54 PM
2014 Aug 27 7:12 PM
Let me assure you: you should be able to help yourself by checking:
- if all the necessary parameters for getting OTF are set while calling SF generated FM;
- properly handling the exceptions of SF function call (checking sy-subrc and outputing appropriate messages)
cheers
Jānis
2014 Aug 27 7:29 PM
when this is call i am getting error
CALL FUNCTION fm_name "'/1BCDWB/SF00000088'
EXPORTING
control_parameter = control_parameter
s_zbukr = s_zbukr
s_vblnr = wa_itab-belnr
s_gjahr = s_gjahr
v_zbukr = v_zbukr
v_chect = v_chect
v_vblnr = v_vblnr
v_zaldt = v_zaldt
v_rwbtr = v_rwbtr
v_banka = v_banka
v_ort01 = v_ort01
v_words = v_words
v_amount = v_amount
v_anred = v_anred
v_name1 = v_name1
v_name2 = v_name2
v_stras = v_stras
v_ort02 = v_ort02
v_bezei = v_bezei
v_pstlz = v_pstlz
v_landx = v_landx
s_strgb = s_strgb
v_verkf = v_verkf """"""""""""""Added by SHARDA
v_telf1 = v_telf1 """"""""""""
IMPORTING
job_output_info = t_otf_from_fm
TABLES
i_final = it_final.
if sy-subrc eq 0.
t_otf[] = t_otf_from_fm-otfdata[].
endif.
2014 Aug 27 8:37 PM
Please, man... I do not posses any kind of psychic abilities, at least tell what error are you getting...
Please look up in program SF_EXAMPLE_01 what exceptions are available for generated Smartform function module and how to handle them. Look up in SAP Help on Smartform programming how to set the parameters to get the output of form as OTF. Search before posting - getting OTF is a basic stuff.
2014 Aug 28 4:56 AM
Dear experts,
after executing the code i am getting error the missing otf data.
how to resolve it
2014 Aug 28 6:57 AM
Thank you. The error likely happens because:
- the generated Smartform function module comes to an error, which should have been caught and handled via exceptions of the function call (actually unlikely in this case because dump should have been produced, but the exceptions need to be handled properly regardless); or
- the input parameters necessary to return OTF are not set correctly
and the OTF table therefore remains empty. There are always other more exotic possibilities, but let's check the common ones first.
Now, did you really not understand what I'm asking you to do regarding adding the exceptions of the generated function module to the call? Or checking whether the parameters necessary for OTF output are set correctly?
If yes then that's unfortunate, because out of principle I'm not going to spoon-feed the 5-7 source code lines for something as trivial... But at least please say that you did not understand. Or that you are not a programmer and don't know how to do it. Or that you can't or will not do it because so and so. Or that you did and the error persists. Or something, man... something at least somewhat responsive to every task you are asked to do. Otherwise the posters like you make me... err... start doubting the future of humanity
cheers
Janis
Edit in: and please post the code (fragments) showing the whole handling of smart form. If you will remain unresponsive, sorry, but this will be my last post on this problem...
2014 Aug 28 7:20 AM
Dear sir,
not like that,
i checked that otf structure is showing empty after calling the fm
i declared all the variables properly properly but importing paramters st_job_output_info is showing empty..
2014 Aug 28 7:24 AM
Don't forget to set GETOTF field in control parameters = 'X'.
Where control parameter structure is an importing parameter of smartform of line type SSFCTRLOP.
2014 Aug 28 8:07 AM
Dear janis,
now i am getting the otf data and also convert to pdf but its not showing in the output..
2014 Aug 28 8:22 AM