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

WRITE_FORM is invalid, START_FORM is missing

Former Member
0 Likes
815

Hello,

i am getting an error in script as WRITE_FORM is invalid, START_FORM is missing for invoice, its working for many but only for certain some invoice its not working and i have found out where the problem is but i am not able to get solution .The error is because i have included another window which is called by writeform can any one say why only for PERFORM WRITEFORM error has come and also for certain values .

PERFORM open_form.

PERFORM write_form USING 'TEXT1'.

PERFORM write_form USING 'TEXT2'.

PERFORM write_form USING 'TEXT3'.

PERFORM WRITEFORM.

*

PERFORM close_from.

FORM write_form USING p_text.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = p_text

function = 'SET'

type = 'BODY'

window = 'MAIN'.

ENDFORM. " write_form

FORM writeform.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ADD'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'ADD'.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " write_form

5 REPLIES 5
Read only

Former Member
0 Likes
696

u r calling write_form after close_form...

You must use tht before close_form...

Read only

Former Member
0 Likes
696

close_form should e the last .....if write it in between ...then u have use open_form

and then write_form....

Read only

Former Member
0 Likes
696

Hi Anand,

The error in write_form is because you have set TYPE as 'BODY' for a variable window. Only main window will have types as 'TOP', 'BODY' and 'BOTTOM'.

Remove the type and it will work fine.

Award points if useful.

Regards

Indrajit

Read only

0 Likes
696

i commented that line but then also this error is coming...

So i debugg..its because the application is closed ie its not priniting that window....why only for 2 or 3 data its coming wht else may be problem...

Read only

Former Member
0 Likes
696

hi anand,

please check whether you have mentioned the next page in SE71...

for example if there are 2 pages...PAGE1 and PAGE2

for PAGE1 mention next page as PAGE2 and for PAGE2 mention next page as PAGE2

this would defineitely solve ur problem..

please reward points incase useful..

Regards,

Prashant