07-10-2006 5:54 AM
Hi,
I'm using write_form_lines to print an internal table in a normal window.This is the code I'm using. The t_header table does not contain any records and there are 10 lines in the itab.But its not printing anything.
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
function = 'APPEND'
header = t_header
window = 'FIRST'
TABLES
lines = itab.
Thanks
Nidhi Jain
07-10-2006 6:08 AM
Hello Nidhi,
In the query you have written that t_header is a table, I hope its a workarea not table. I mean header should be a workarea of type (Line of itab).
Data: t_header like line of itab.
I hope its the same. May be you can allow the execption of the function module and see if any aception is raised by checking the value of sy-subrc.
Regards,
Sesh
07-10-2006 7:27 AM
Hi Sesh,
Its a work area only. This is actually on the second page and it does not have a main window. Would that make any difference?
The sy-subrc returned by the function is zero.
Regards
Nidhi
07-10-2006 6:19 AM
Hi try this code.
Its working perfectly.
Replace the form name with yours and also window used.
try to use main window just for testing.
REPORT ZWA_TEST2 .
Data: t_header type thead .
DATA: itab like tline occurs 0 with header line.
itab-tdformat = '01'.
itab-tdline = 'HEllo this is first line'.
append itab.
itab-tdformat = '02'.
itab-tdline = 'HEllo this is second line'.
append itab.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZWA_FD_PERMANENT'.
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
function = 'APPEND'
header = t_header
window = 'MAIN'
TABLES
lines = itab.
CALL FUNCTION 'CLOSE_FORM' .
Regards,
Wasim Ahmed
07-10-2006 7:28 AM
I'm already using the write_form_lines with non-main windows and its working fine in other scripts.
07-10-2006 6:26 AM
once u try this
REPORT ZWA_TEST2 .
Data: t_header type thead .
DATA: itab like tline occurs 0 with header line.
itab-tdformat = '01'.
itab-tdline = 'HEllo this is first line'.
append itab.
itab-tdformat = '02'.
itab-tdline = 'HEllo this is second line'.
append itab.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZWA_FD_PERMANENT'.
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
function = 'APPEND'
header = t_header
window = 'MAIN'
TABLES
lines = itab.
CALL FUNCTION 'CLOSE_FORM' .
i hope tht is work..................
07-10-2006 7:39 AM
Hi,
The problem was that the page did not have a main window.So now I've put a main window for the page and that sorted out the problem.
Thanks
Nidhi