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 while .pdf conversion

Former Member
0 Likes
5,737

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.

15 REPLIES 15
Read only

Former Member
0 Likes
3,983

Hi S

    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

Read only

0 Likes
3,983

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

Read only

0 Likes
3,983

hi..

already complete this issue. now working fine..

Read only

Former Member
0 Likes
3,983

i got a solution... thanks for all..

Read only

Former Member
0 Likes
3,983

hi..

already complete this issue. now working fine..

Read only

0 Likes
3,983

sir now i get faced the same problem, can you help me ..

Read only

0 Likes
3,983

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

Read only

0 Likes
3,983

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.

Read only

0 Likes
3,983

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.

Read only

0 Likes
3,983

Dear experts,

after executing the code i am getting error the missing otf data.

how to resolve it

Read only

0 Likes
3,983

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...

Read only

0 Likes
3,983

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..

Read only

0 Likes
3,983

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.

Read only

0 Likes
3,983

Dear janis,

now i am getting the otf data and also convert to pdf but its not showing in the output..

Read only

0 Likes
3,983

Kaustav, there is already an open discussion from you on same topic. Do not bump old threads.

You are unable to look at working example and figure out what is wrong with your code.

You can continue the discussion there.

I am locking this thread.