Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Write_form issue

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.

Tags:
Former Member
replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question