cancel
Showing results for 
Search instead for 
Did you mean: 

WRITE_FORM is invalid, START_FORM is missing.

FranklinAsis
Explorer
0 Kudos

Hi,

I've followed the sequence in calling a sapscript form but it doesnt seem to work. I got the error message:

WRITE_FORM is invalid, START_FORM is missing.

when i tested the program in QAS.

Here are my codes, can someone tell me whats wrong with it?

CALL FUNCTION 'OPEN_FORM'

EXCEPTIONS

canceled = 1

device = 2

form = 3

OPTIONS = 4

unclosed = 5

mail_options = 6

archive_error = 7

invalid_fax_number = 8

more_params_needed_in_batch = 9

spool_error = 10

codepage = 11

OTHERS = 12.

CALL FUNCTION 'START_FORM'

EXPORTING

form = 'Z_CONTR_EMP'

EXCEPTIONS

form = 1

format = 2

unended = 3

unopened = 4

unused = 5

spool_error = 6

codepage = 7

OTHERS = 8.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'HEADER'.

CALL FUNCTION 'END_FORM'

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

spool_error = 3

codepage = 4

OTHERS = 5.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

spool_error = 4

codepage = 5

OTHERS = 6.

I've already removed the fields that are commented out.

I think something is wrong with my WRITE_FORM, i dont quite understand the difference between elements and windows.

Also, if in the sapscript form i have 3 windows(header, main footer) do i have to call them all in order for me to see the print preview of my sapscript form?

example:

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'HEADER'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'MAIN'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'FOOTER'.

Thanks,

Frank

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

frank.asis : Hi I am also facing same issue in output if - nast-nacha = 5 -Mail. Could you please help me regarding this.?

0 Kudos

Dear frank.asis,

COuld you please help me regarding this I am also facing same problem in VA03 -nast-nacha = 5 , Mail.

Thanks.

Former Member
0 Kudos

hi,

I think the problem is in the Scriptlayout.

1.goto se71

2. specify the form name.

3 go with PAGES Attributes

4. Specify the NEXT PAGE as PAGE1 if it containes only one page.( if it contains more than one page specify the NEXT PAGE as ur required page.)

5. then save and Activate it.

And Also U have to specify the Exporting parameter PAGE in START_FORM function module.

The sequence is :

OPEN_FORM.

START_FORM.

WRITE_FORM.

END_FORM.

CLOSE_FORM.

i think this solves ur problem.

thanks,

raji

reward if helpful.

venkat_o
Active Contributor
0 Kudos

Hi Franklin,

Check these function module and corresponding description.

1.

CALL FUNCTION 'OPEN_FORM'

The function module OPEN_FORM opens form printing. You must call this function module before you can use any other form function (WRITE_FORM, START_FORM, CONTROL_FORM...).

You need not specify a form name. If you omit the name, you must use the function module START_FORM to open a form before starting the output.

You must end form printing by using the function module CLOSE_FORM. Otherwise, the system does not print or display anything.

2.

CALL FUNCTION 'START_FORM'

In-between the function modules OPEN_FORM and CLOSE_FORM, you can use different forms. This allows you to combine several different forms into one print output. However, you can combine only those forms that have the same page format.

To switch forms, use the function module START_FORM. If another form is still open, you must close it first using END_FORM.

If you specify no form name when calling START_FORM, the system restarts the last open form. If after OPEN_FORM no form was activated yet, the system leaves the function module with the exception UNUSED.

3.

CALL FUNCTION 'WRITE_FORM'

The system outputs the form element specified in parameter ELEMENT into the currently opened form.

In the parameter WINDOW you can specify the name of a window for the output. Remember that the form element must be defined in this window. The parameter FUNCTION specifies how to merge the text lines to be output with any existing contents in the window. In this case, there are differences between the different window types or areas.

CALL FUNCTION 'END_FORM'

CALL FUNCTION 'START_FORM'

CALL FUNCTION 'WRITE_FORM'

CALL FUNCTION 'END_FORM'

CALL FUNCTION CLOSE_FORM

I think in ur case u seem to have not called END_FORM function module.

Check it out .

Regards,

Venkat.O

Former Member
0 Kudos

Hello frank,

function module write form is needed when u r using element in script.

suppose u r using two element u have to call that function module WRITE_FORM twice.

and here u give the element name.

regards

ss

Former Member
0 Kudos

here is the example

suppose u have 3 or 4 window like main header footer

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'HEADER'

EXCEPTIONS

window = 1

OTHERS = 2.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'INFO'

EXCEPTIONS

window = 1

OTHERS = 2.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM_HEADER'

window = 'MAIN'

EXCEPTIONS

element = 1

window = 2

OTHERS = 3.