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

Smartform internal_error when merging forms into 1 spool request

Former Member
0 Likes
434

Hi,

I have 2 smartforms - a letter and a certificate. The user has the option to print either one of these forms or both, per employee. I'm using 1 spool request.

As soon as I call the second smartform there is an INTERNAL_ERROR. Why does this happen and how do I solve the problem?

Please refer to the code sample below:

loop at i380.

  • make sure the spool is not closed

control_parameters-no_open = 'X'.

control_parameters-no_close = 'X'.

AT FIRST.

control_parameters-no_open = ' '.

ENDAT.

AT LAST.

control_parameters-no_close = ' '.

ENDAT.

  • call smartform 1

call function 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZLETTER'

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

endif.

CALL FUNCTION FM_NAME

EXPORTING

CONTROL_PARAMETERS = control_parameters

OUTPUT_OPTIONS = output_options

USER_SETTINGS = ' '

pernr = i380-pernr

IMPORTING

JOB_OUTPUT_INFO = otf_info

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

endif.

  • second smartform - certificate

call function 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZCERTIFICATE'

IMPORTING

FM_NAME = FM_NAME2

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

endif.

CALL FUNCTION FM_NAME2

EXPORTING

CONTROL_PARAMETERS = control_parameters

OUTPUT_OPTIONS = output_options

USER_SETTINGS = ' '

pernr = i380-pernr

IMPORTING

JOB_OUTPUT_INFO = otf_info

EXCEPTIONS

FORMATTING_ERROR = 1

<b> INTERNAL_ERROR = 2</b> SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

ENDIF.

endloop.

I cleared output_parameters, output_options and otf_info when calling form ZCERTIFICATE but this does not solve the problem. When ZCERTIFICATE is called seperately, there is no problem. The forms should be printed directly without conversion to PDF.

Your help will be appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
370

Hi,

In the loop AT Last is in wrong place. May be that could be the reason for your problem. Then the second call to samrt from is will be working on a closed session.

regards

austin

Message was edited by: Joseph Austin Prabhu Paulthas

2 REPLIES 2
Read only

Former Member
0 Likes
370

Hi,

I dont think you can call the FM twice for 2 different layouts,because once the call to the smartform is done,it will not return to the program & start another smartform.

Read only

Former Member
0 Likes
371

Hi,

In the loop AT Last is in wrong place. May be that could be the reason for your problem. Then the second call to samrt from is will be working on a closed session.

regards

austin

Message was edited by: Joseph Austin Prabhu Paulthas