‎2007 May 30 3:06 PM
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
‎2007 May 30 3:48 PM
u r calling write_form after close_form...
You must use tht before close_form...
‎2007 May 30 3:53 PM
close_form should e the last .....if write it in between ...then u have use open_form
and then write_form....
‎2007 May 31 4:56 AM
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
‎2007 Jun 02 9:56 AM
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...
‎2007 May 31 5:07 AM
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