cancel
Showing results for 
Search instead for 
Did you mean: 

I want to print two internal tables data in a script

Former Member
0 Kudos

In a script i want to print these two tables.department table and student table in the main window in the script.two tables data i have to print one by one like department table and then down student table.If i have to print these two tables data means how.I am taking start form also.But i am getting error.Plz tell me the correct way.And in the script i am printing like this &itab&

&itab1&.Plz correct my program and give me correct solution.

REPORT ZSCRIPT1.

tables: zdept1,zpstudent2.

data: itab like zdept1 occurs 0 with header line.

data: itab1 like zpstudent2 occurs 0 with header line.

select * from zdept1 into table itab.

select * from zpstudent2 into table it2.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DIALOG = 'X'

FORM = 'ZPSCRIPT1'

LANGUAGE = SY-LANGU.

loop at itab.

.

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'ZPSCRIPT1'

LANGUAGE = ' '.

select * from zpstudent2 into table itab1.

loop at itab1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'TEST'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'.

CALL FUNCTION 'END_FORM'.

endloop.

endloop.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thankyou

former_member181995
Active Contributor
0 Kudos
I want to print two internal tables data in a script

No Probs.

REPORT ZSCRIPT1.

tables: zdept1,zpstudent2.

data: itab like zdept1 occurs 0 with header line.

data: itab1 like zpstudent2 occurs 0 with header line.

select * from zdept1 into table itab.

select * from zpstudent2 into table it2.


CALL FUNCTION 'OPEN_FORM'
EXPORTING
DIALOG = 'X'
FORM = 'ZPSCRIPT1'
LANGUAGE = SY-LANGU.

loop at itab.
.

CALL FUNCTION 'START_FORM'
EXPORTING
FORM = 'ZPSCRIPT1'
LANGUAGE = ' '.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TEST1'"this is new Element(Print Itab data)
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.

select * from zpstudent2 into table itab1.

loop at itab1.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TEST'"print itab1 data
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.




CALL FUNCTION 'END_FORM'.

endloop.

endloop.

Add one more Element in main window and for this element add one extra Write_form and print Different internal table data in that.

Former Member
0 Kudos

While i am printing i am getting error like this

WRITE_FORM is invalid, START_FORM is missing.

Plz solve my problem

Former Member
0 Kudos

Hi amit again i am getting error like START_FORM is invalid, END_FORM is missing.

plz tell me where is the problem