Application Development 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: 

Write_form_lines not printing the internal table

Former Member
0 Kudos

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

6 REPLIES 6

0 Kudos

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

0 Kudos

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

dani_mn
Active Contributor
0 Kudos

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

Former Member
0 Kudos

I'm already using the write_form_lines with non-main windows and its working fine in other scripts.

Former Member
0 Kudos

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..................

Former Member
0 Kudos

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