STOP : WRITE_FORM is invalid,OPEN _FORM is missing.
Hi,
I'm working on a report which is supposed to list down purchase activity for oil in a particular day, the layout out is printed via sapscript. My prob is when I want to execute the program,it give me this error :
STOP : WRITE_FORM is invalid,OPEN _FORM is missing.
I hv initiate the open form, but still it gave me this error. Below is my display form statement.
form display_output1.
data: counter type i.
call function 'OPEN_FORM'
exporting
device = 'PRINTER'
dialog = 'X'
form = 'Zmxar112_form'
language = sy-langu
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
others = 11.
ret_code = sy-subrc.
call function 'WRITE_FORM' "First header
exporting element = 'ITEM_HEADER'
exceptions others = 1.
if sy-subrc ne 0.
perform protocol_update.
endif.
call function 'WRITE_FORM' "Activate header
exporting element = 'ITEM_HEADER'
type = 'TOP'
exceptions others = 1.
if sy-subrc ne 0.
perform protocol_update.
endif.
sort t_in.
loop at t_in.
* on change of t_in-arktx.
on change of t_in-txz01.
if counter ne 0.
if ret_code ne 01.
call function 'CONTROL_FORM'
exporting
command = 'NEW-PAGE'
exceptions
unopened = 1
unstarted = 2
others = 3.
endif.
endif.
move-corresponding t_in to tt_in.
counter = counter + 1.
endon.
call function 'WRITE_FORM'
exporting
element = 'ITEM_LINE'
exceptions
element = 1
window = 2.
if sy-subrc ne 0.
perform protocol_update.
endif.
endloop.
call function 'WRITE_FORM' "Deactivate Header
exporting element = 'ITEM_HEADER'
function = 'DELETE'
type = 'TOP'
exceptions others = 1.
if sy-subrc ne 0.
perform protocol_update.
endif.
if ret_code ne 01.
call function 'CLOSE_FORM'.
endif.
endform.
Pls advice urgently. And tx for the coming advices! :>
- teja -
Try
CALL FUNCTION 'OPEN_FORM'
*etc
RET_CODE = SY-SUBRC.
CHECK RET_CODE = 0.
*Continue with your Prog.
KRK
Hi..
First, have you copied the form to the testing client? SAPScript forms are not cross-client object, so if you works with many clients you have to copy them to the testing client.
Usually, it works for me.
If this doesn't help, you can try what kumar suggest for your problem.
Hope it helps.
nurmyasin
try giving the form name in caps.
Hello,
Have you already solved the problem? I am encountering this error (via sm13) and i dont know what seems to be wrong...
Error reads:
TD 423: END_FORM is invalid, OPEN_FORM is missing
Please help.. Thanks
As Kumar said, did you checked sy-subrc?
After the call to OPEN_FORM, if sy-subrc NE 0 => your form is not opened, maybe without an error message... checking sy-subrc after a function call you will prevent these kind of things...
_________________
Brief History of the Tuly Idiots
Bad advices, wrong answers, bigotism
sapfans GD
Ad by Viiiiiic