Skip to Content
0
Former Member
Aug 02, 2005 at 07:04 PM

stream of data in scripts

15 Views

hello friends,

for the print program below.....

when i execute it i am getting only one record in the layout. (supposed to get 5 records).

so i looped the write_form for main window.

when i do this i dont get any thing other than header and footer contents.

hope i am doing it in the right way.....

plz suggest me.....

REPORT ZNEW1 .

TABLES: MARA.

DATA: BEGIN OF ITAB OCCURS 10,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

LAEDA LIKE MARA-LAEDA,

END OF ITAB.

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF ITAB

WHERE VPSTA = 'KDALSBG'.

ENDSELECT.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

*DEVICE = ' '

  • DIALOG = 'X'

FORM = 'ZNEWLAY1'

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HEADER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'HEADER'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

*LOOP AT ITAB.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

*ENDLOOP.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'FOOTER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'FOOTER'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.