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 issue

Former Member
0 Likes
617

Hello,

i am getting an error in script as WRITE_FORM is invalid, START_FORM is missing for my output.

I created very simple print progm. Bt its showing this error. can any one help this?

where is the problem?

REPORT ZTESTING.

tables : mara, makt.

Data : begin of it_mara occurs 0,

matnr like mara-matnr,

  • maktx like makt-maktx,

end of it_mara.

select matnr from mara into table it_mara.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

FORM = 'ZTEST'

LANGUAGE = SY-LANGU

.

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'ZTEST'

LANGUAGE = sy-langu .

.

loop at it_mara.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'MAIN'

ELEMENT = 'TEST'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

.

endloop.

CALL FUNCTION 'CLOSE_FORM'

  • IMPORTING

  • RESULT =

  • RDI_RESULT =

  • TABLES

  • OTFDATA =

EXCEPTIONS

  • UNOPENED = 1

    • BAD_PAGEFORMAT_FOR_PRINT = 2

    • SEND_ERROR = 3

    • SPOOL_ERROR = 4

    • CODEPAGE = 5

OTHERS = 1.

  • .

IF SY-SUBRC <> 0.

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

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
584

why are you using start_form, it is not required. use open_form, write_form, close_form.

CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZTEST'
LANGUAGE = SY-LANGU
.
loop at it_mara.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
ELEMENT = 'TEST'

EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
.

endloop.

CALL FUNCTION 'CLOSE_FORM'


IMPORTING 
RESULT = 
RDI_RESULT = 
TABLES 
OTFDATA = 
EXCEPTIONS

UNOPENED = 1 
BAD_PAGEFORMAT_FOR_PRINT = 2 
SEND_ERROR = 3 
SPOOL_ERROR = 4 
CODEPAGE = 5 
OTHERS = 1.

. 
IF SY-SUBRC NE 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
ENDIF.

2 REPLIES 2
Read only

Former Member
0 Likes
585

why are you using start_form, it is not required. use open_form, write_form, close_form.

CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZTEST'
LANGUAGE = SY-LANGU
.
loop at it_mara.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
ELEMENT = 'TEST'

EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
.

endloop.

CALL FUNCTION 'CLOSE_FORM'


IMPORTING 
RESULT = 
RDI_RESULT = 
TABLES 
OTFDATA = 
EXCEPTIONS

UNOPENED = 1 
BAD_PAGEFORMAT_FOR_PRINT = 2 
SEND_ERROR = 3 
SPOOL_ERROR = 4 
CODEPAGE = 5 
OTHERS = 1.

. 
IF SY-SUBRC NE 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
ENDIF.

Read only

Former Member
0 Likes
584

check the layout in se71 ->Pages->Standard attributes tab->If Next Page is Maintained Or not ?