cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform not returning OTFDATA

Former Member
0 Kudos

I am having a little problem with smartforms and hope that somebody here can give me a few pointers to finding a solution.<p>

I have a Z smartform that is a copy of SF <b>/SMB40/MMPO_A</b> with some changes to handle our customers needs. These changes was made some time ago and the person responsible is no longer with the company, and - of course - documentation is spares. The smartform is called from our own version of printprogram <b>/SMB40/FM06P</b>.<p>

The smartform generates a PDF file of a Purcchase Order and attaches the file to an email.<p>

What I have to do now is to make an extra copy of this PDF file, so I was thinking that I could 'just' use the OTFDATA generated by and returned from the SF. I would then take this data and process it further through <b>FM CONVERT_OTF_2_PDF</b> and store it accordingly afterwards.<p>

Unfortunately I am having problems when I insert the IMPORTING statement in the signature. The program dumps (get error-messages when entering SM51 to check status).<p>

My signatur for the SF/FM call looks like this:<p>

<code>call function lf_fm_name<br>

exporting<br>

archive_index = toa_dara<br>

archive_parameters = arc_params<br>

control_parameters = ls_control_param<br>

mail_recipient = ls_recipient<br>

mail_sender = ls_sender<br>

output_options = ls_composer_param<br>

is_ekko = l_doc-xekko<br>

user_settings = ' ' "Disable User Printer<br>

is_pekko = l_doc-xpekko<br>

is_nast = l_nast<br>

iv_from_mem = l_from_memory<br>

iv_druvo = iv_druvo<br>

iv_xfz = iv_xfz<br>

*191109 z3mph start<br>

IMPORTING<br>

job_output_info = st_job_output_info<br>

  • job_output_options = st_job_output_options<br>

  • document_output_info = st_document_output_info<br>

*191109 z3mph end<br>

tables<br>

it_ekpo = l_doc-xekpo[][<br>

it_ekpa = l_doc-xekpa[]<br>

it_pekpo = l_doc-xpekpo[]<br>

it_eket = l_doc-xeket[]<br>

it_tkomv = l_doc-xtkomv[]<br>

it_ekkn = l_doc-xekkn[]<br>

it_ekek = l_doc-xekek[]<br>

it_komk = l_xkomk[]<br>

exceptions<br>

formatting_error = 1<br>

internal_error = 2<br>

send_error = 3<br>

user_canceled = 4<br>

others = 5.</code><p>

I have searched through the SF and FM using the debugger and so far I have found a program that is being used called SAPLSTXBC with an include LSTXBCFOP. In this include there is a form output_options where the following code can be found:<p>

<code>* treat GETOTF like preview: no archiving, no data is sent to spool<br>

if ssfpp-tdgetotf = c_true.<br>

ssfpp-tdpreview = c_true.<br>

endif.</code><p><br>

I have not been able to find anywhere else during program-flow where this variable is adjusted. And I don't even know if this is the cause of the problem.<p>

Sorry for the long rant, but I am trying to be a concise in describing my problem as possible. I now hope that someone here with a little more knowledge about and experience with Smartforms can give me a few pointers as to what I am doing wrong.<p>

Thanks in advance.<br>

Edited by: Michael Peter Hansen on Nov 20, 2009 10:21 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

Call the Smartform Function module again and include the GET OTF dat in the importing parameters rather than siimple inserting the importing parameters by coding ..try and let us know if u still have a problem.

below is a sample code for PDF

data: t_otfdata TYPE ssfcrescl,

wa_ctrlop-getotf = c_x.

CALL FUNCTION fm_name

EXPORTING

control_parameters = wa_ctrlop

output_options = wa_outopt

user_settings = space

wa_final = wa_final1

IMPORTING

job_output_info = t_otfdata

EXCEPTIONS

and then CALL FUNCTION 'CONVERT_OTF'

surya

Edited by: suryareddy on Nov 20, 2009 10:45 AM

Former Member
0 Kudos

>

> hi

> Call the Smartform Function module again and include the GET OTF dat in the importing parameters rather than siimple inserting the importing parameters by coding ..try and let us know if u still have a problem.

> below is a sample code for PDF

> data: t_otfdata TYPE ssfcrescl,

> wa_ctrlop-getotf = c_x.

> CALL FUNCTION fm_name

> EXPORTING

> control_parameters = wa_ctrlop

> output_options = wa_outopt

> user_settings = space

> wa_final = wa_final1

> IMPORTING

> job_output_info = t_otfdata

> EXCEPTIONS

> and then CALL FUNCTION 'CONVERT_OTF'

>

> surya

>

> Edited by: suryareddy on Nov 20, 2009 10:45 AM

I am not sure what the wa_final parameter is, but I am sure that there is no such thing in either my modified SF or in the original. Otherwise all other parameters are set as you describe them. Everything is passed through variables and not directly stated.

Could there possibly be a problem with me using IMPORTING parameters as well as TABLES? Every example I have found doesn't have the tables as parameters only the EXPORTING and IMPORTING ones.

Thanks.

NAeda
Contributor
0 Kudos

hi,

Use this link, here it shows how to convert smartform output to PDF.

http://www.sap-img.com/smartforms/conversion-of-smartform-output-to-pdf.htm

Rgds

Aeda

Former Member
0 Kudos

hi

wa_final is my internal structure that i have used in Smartforms which was declared in the smartform for interface. which u not need.

All i have said is call the FM again and try it out. rather than changiung the already existing Function module..

surya

Sm1tje
Active Contributor
0 Kudos

Not sure if this is what you are looking for, but there is a field in the control parameters when calling the SF FM with GETOTF.

If this is it, you could have just searched the forum first.

And what problem are you facing with the IMPORTING parameter that causes this dump? Have you correctly type the import parameter?

Former Member
0 Kudos

>

> Not sure if this is what you are looking for, but there is a field in the control parameters when calling the SF FM with GETOTF.

>

> If this is it, you could have just searched the forum first.

>

> And what problem are you facing with the IMPORTING parameter that causes this dump? Have you correctly type the import parameter?

getotf is already checked in the ls_control_param variable. And believe me I have searched the forums expensively as well as google. The only results I find deal with the process after having called the FM and thus assume that I have the otfdata in hand - which I do not.<p>

As for the error, I am not sure exactly what the problem is. The exact error-description is:<p>

00 671: ABAP-processor: CALL_FUNCTION_CONFLICT_TYPE<p>

Edited by: Michael Peter Hansen on Nov 20, 2009 10:59 AM

Sm1tje
Active Contributor
0 Kudos

Ok Michael,

now where exactly is the problem?

Since the GETOTF is set to 'X', the OTF data should be returned. However, the OTFDATA is part of the importing parameter JOB_OUTPUT_INFO. When calling the function module (SM FM itself) for retrieving the OTFDATA you will need this parameter. In your data declaration declare it like type SSFCRESCL. If you don't you will get the Type conflict short dump.

See what happens and let us know what the status is.