cancel
Showing results for 
Search instead for 
Did you mean: 

form is not printed

Former Member
0 Kudos

hi!

i have a very weird problem, i am trying to print a form through ME9F and i am getting error message ME142.

there is no problem displaying the form.

when i debugged it i saw that there is exception = 1 in FM CLOSE_FORM .

regards

yifat

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi!

the exception os unopened ,but when i debug it after FM OPEN_FORM subrc = 0.

so it means that the form was opened, bat cant be closed when printing.

why there is a difference between displaying and printing the form.

i have no problem displaying the form

thanks

yifat

Former Member
0 Kudos

hi!

thanks for your answers.

i am using print program SAPFM06P, there is no problem with OPEN_FORM subrc = 0, the problem is on CLOSE_FORM when subrc = 1.

could be problem in the sapscript?

thanks

regards

yifat

Former Member
0 Kudos

Hi

the code to call fm CLOSE_FORM should be like this:

CALL FUNCTION 'CLOSE_FORM'

IMPORTING

result = result

EXCEPTIONS

OTHERS = 1.

IF NOT sy-subrc IS INITIAL.

p_retco = '1'.

PERFORM protocol_update USING '142' ekko-ebeln

space space space.

EXIT.

ENDIF.

So for all exceptions the sy-subrc is 1, but the exceptions of CLOSE_FORM are this:

UNOPENED

BAD_PAGEFORMAT_FOR_PRINT

SEND_ERROR

SPOOL_ERROR

So you should check which excption is really raised, if BAD_PAGEFORMAT_FOR_PRINT should be a problem in the sapscript.

Max

venkata_ramisetti
Active Contributor
0 Kudos

Hi,

Looks like you have not opend the form with the function module START_FORM and trying to close the form with CLOSE_FORM.

OPEN_FORM must close with CLOSE_FORM.

START_FORM must close with END_FORM.

Check whether OPEN_FORM or START_form are properly called?

Thanks,

Ramakrishna

Former Member
0 Kudos

Hi ,

you need to call the open form and close form only once, where as start form and end form multiple times especially if you are refering to one form.

so for each startform there should be endform

thanks

venki

Former Member
0 Kudos

Be sure that you are only trying to close the form once and that you are giving the correct form name.

Former Member
0 Kudos

Hi Yifat

It means the driver program hasn't called the fm OPEN_FORM or there was an error when the form was open by that function module.

So you should debug the driver program where the fm OPEN_FORM is called.

Max