cancel
Showing results for 
Search instead for 
Did you mean: 

problem when transform a smartform to pdf

Former Member
0 Kudos

Hi all:

When I run the program to dispaly pdf transformed from smartform,

the IE explorer is busy dead, have you ever met the same problem?

thank you very much

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Do a trace and find out which part of the code is taking too much time. Hope this helps.

Former Member
0 Kudos

Hi guys:

thank you very much for reply, there is an exception indeed, when calling the following function SSFCOMP_PDF_PREVIEW,

there is an exception----


CNTL_ERROR = 2 -


" Control Framework: Fatal error - GUI cannot be reached ". I can see the preview but soon IE would busy dead, could you please tell me how to solve it ?

CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'

EXPORTING

I_OTF = LT_OTFDATA

EXCEPTIONS

CONVERT_OTF_TO_PDF_ERROR = 1

CNTL_ERROR = 2

OTHERS = 3.

ChrisPaine
Active Contributor
0 Kudos

You are using a GUI specific method - SSFCOMP_PDF_PREVIEW - which you cannot do in WDA!

Have a quick search please - there have been many many posts on how to serve a PDF to a user from WDA. (even some dating back from 2006!)

but in general - to output to the user a PDF that you have created the easiest method is to use the:

 cl_wd_runtime_services=>attach_file_to_response method

to send the PDF to the user.

Former Member
0 Kudos

thank you very much ,actually I am following the below link to do this.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6...

ChrisPaine
Active Contributor
0 Kudos

Interesting!

the article would appear to be wrong!

You don't need to call this FM at all - indeed - as it is only called with exporting parameters it is not going to change your form at all!

in the code:


lt_otfdata[] = lv_ssf_output-otfdata[].
call function 'SSFCOMP_PDF_PREVIEW'
exporting
i_otf = lt_otfdata
exceptions
convert_otf_to_pdf_error = 1
cntl_error = 2
others = 3.
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
data: l_dummy type standard table of tline,
pdf_data type xstring,
pdf_size type i.

remove the section:


call function 'SSFCOMP_PDF_PREVIEW'
exporting
i_otf = lt_otfdata
exceptions
convert_otf_to_pdf_error = 1
cntl_error = 2
others = 3.
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

hopefully you can now generate your PDF.

Let us know if you have any further problems.

Chris

Answers (1)

Answers (1)

former_member628395
Active Participant
0 Kudos

Hi,

What is the size of the pdf getting generated out of the smartform? You may face this issue when the size of pdf is large and

takes time to get downloaded. This should not be an issue with the code. Try waiting for sometime and check if it gets loaded.

Regards,

Sagar

Former Member
0 Kudos

thank you very much for your reply, guys, but data to be displayed is very little, how to control its size?

and code is running well. I can't see where it is wrong when tracing

thank you very much .

Former Member
0 Kudos

I did not understand, The data is very little how to control it's size. Try adding PACKET SIZE while fetching data into Internal tables in select queries this might help.

Former Member
0 Kudos

sorry for not explaining it clearly, the data to be diplayed is an internal table with only four lines, I think maybe PDF's size is big even data transfered to it is not so much. how to concol the size of the file of PDF. for example, the picture of BMP type is big,

but jpg type of the same picture is much less big. I am not sure the comparision here is plausible.

***********************

You may face this issue when the size of pdf is large and takes time to get downloaded

************************

Edited by: jingying Sony on Jul 1, 2010 4:20 PM

Former Member
0 Kudos

sorry for not explaining it clearly, the data to be diplayed is an internal table with only four lines, I think maybe PDF's size is big even data transfered to it is not so much. how to concol the size of the file of PDF. for example, the picture of BMP type is big,

but jpg type of the same picture is much less big. I am not sure the comparision here is plausible.

***********************

You may face this issue when the size of pdf is large and takes time to get downloaded