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: 

Smartforms returns with internal error

Former Member
0 Kudos
3,301

Hi,

I am trying to send a fax with smartforms via message control, but after calling the function module an exception is called -> (unknown exception raised) internal error. I have got red traffic lights in the message protocol.

I can print the smartforms without problems.

I can print and fax the smartform with the same(!) print program and the same(!) formular for another message type.

Customizing has no errors. Sap notes search got no results. Strange...

I have just modified the generated function module to look for the error. The exception is called here at the very end of the function module:

IF CONTROL_PARAMETERS-NO_CLOSE = SPACE.

CALL FUNCTION 'SSFCOMP_CLOSE'

IMPORTING RESULT = %RESULT_CL

EXCEPTIONS OTHERS = 1.

IF SY-SUBRC <> 0. PERFORM %RAISE. ENDIF.

JOB_OUTPUT_INFO = %RESULT_CL.

ENDIF.

Obviously, the SSF composer can't be closed. Why?

The parameters control_parameters-no_open and control_parameters-no_close are initial before calling the smartform function module.

Thanks for any hints!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
354

Hello Christian,

Looking at function SSFCOMP_CLOSE, it seems that it will raise an error when ssfcstat-tdopen is false, indicating that for some reason, the processor has closed the form.

What you could do is to debug and set a watchpoint on ssfcstat-tdopen (but only in the SSF processor, i.e. Local Watchpoint = X) in the first call to the SSF processor (function group STXBC).

You can then see if at any point this variable is changed, and probably why.

Regards,

Martin

9 REPLIES 9

Former Member
0 Kudos
355

Hello Christian,

Looking at function SSFCOMP_CLOSE, it seems that it will raise an error when ssfcstat-tdopen is false, indicating that for some reason, the processor has closed the form.

What you could do is to debug and set a watchpoint on ssfcstat-tdopen (but only in the SSF processor, i.e. Local Watchpoint = X) in the first call to the SSF processor (function group STXBC).

You can then see if at any point this variable is changed, and probably why.

Regards,

Martin

0 Kudos
354

Hi Martin,

the problem is i can't debug, because the smartform is processed in background (message control).

Any chance to debug it anyway?

Regards,

Christian

0 Kudos
354

Christian,

It should be possible, depending on what application this is for. Most likely, there is a way to print the document directly.

Please tell me what type of document you are printing.

Kind Regards,

Martin

0 Kudos
354

Hi Martin,

I can print it without problems. Only to fax is the problem. Even if create a stand-alone print program and call my smartform to fax it - it works (i have to add "commit work" at the end).

This smartform is for faxing an SD-document (quotation).

Customizing: transaction NACE (application V1 -> sales) and then my message type ZAN01.

Maybe you know an SAP print program using smartforms in sales ditribution? All print programs i have found are for sapscript.

Regards,

Christian

0 Kudos
354

Hello Christian,

You should be able to debug in the transaction VA21/22/23, by selecting Sales Document -> Issue Output To from the menu (depending on your release). This runs the print process in the foreground. The only time I am aware that it runs in the background, is when you 4 (Send Immediately) as the dispatch time in the output record). You can instead select 3 or something else, and then perform the output from the start screen of the transaction.

As an alternative, you can run program SD70AV1A to launch the output.

Regards,

Martin

By the way, you may find problems in reaching breakpoints in smartforms (at least, I did). You can insert a code element in your smartforms and put a BREAK-POINT statement in the code.

The problem is that only on the first output of your document, after you activate the smartform, is the function group actually generated. After that, you can always go and insert "soft" breakpoints in the function module.

0 Kudos
354

Hi Martin,

many thanks for your patience, now i could debug and found the error:

During call of the function SSFCOMP_CLOSE, a function SSF_MAPST_BCS_2_BCI is called. And here the exceptions is called:

  • status

case bcs_status.

when 'N'.

mailstatus = space.

when 'E'.

mailstatus = 'E'.

when 'A'.

mailstatus = 'I'.

when others.

message id 'SSFCOMPOSER' type 'E' number '034'

raising parameter_error.

endcase.

The program is looking for some bcs_status and in the debugger the value is initial. Now I am really confused about the "mailing" context I am in.

in the dynamic caller function i have commented out the parameters mail_object, mail_sender, mail_receiver. This is working with other smartforms perfectly but why here not?

Regards,

Christian

0 Kudos
354

Hello Christian,

I have just gone over the thread again to try and get all the facts straight.

You say that faxing with the same program and form with another output type works. That means that your faxing is set up correctly.

You say that you are using a custom output type (ZAN01). How is it different from AN00?

Also, are you using the standard print programs, or have you customized them? (You mention commenting out some parameters in the dynamic function call; are you making a modification or did you copy the original programs?).

Another thing that is confusing me a little is that you mention a smartform problem, but seem to be using a Layout Set (i.e. old SAPScript). What are the values of your customizing entry for ZAN01/2 (2 being method Fax). (Are you sure the output type is ZAN01? I see the field as being only four characters long.

I am sorry for all these questions, but I am a little confused now, and just trying to work out how things stand.

Thanks,

Martin

0 Kudos
354

Hi Martin,

I have completly renewed the customizing and now everything is working fine!

I have just copied the AN00 message type and added my print program and my smartform.

There is something wrong with the old ZAN1 customizing and i dont care.

Many thanks for your patients and help.

Points were rewarded.

Regards,

Christian

0 Kudos
354

Hi Christian,

Thanks for the feedback. That's good to hear!

Martin