Skip to Content

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

Reg:how to include a report in another report.

Hi,

Can anyone please tell me how to call a report from another report.

My requirement is for example please see the below requirement :

In report1 I write the logic.

Zreport1.

select kunnr name1 from kna1 into table itab.

loop at itab.

write: / itab-kunnr,itab-name.

endloop.

In report 2 i write the declaration.

Zreport2.

Tables:kna1.

data:begin of itab occurs 0,

kunnr like kna1-kunnr,

name1 like kna1-name1,

end of itab.

Now I want to include or call the report1 in report2 .Can anyone please tell me how it can be done??

Former Member
Former Member replied

Hi,

write the submit statement as SUBMIT ZREPORT1 AND RETURN in ZREPORT2 program..

If you dont execute the ZREPORT1 independently then its better you write that in a ZINCLUDE... and

include that in your second program where ever necessary..

for that check this...

+ZINCLUDE+ 
select kunnr name1 from kna1 into table itab.
loop at itab.
write: / itab-kunnr,itab-name.
endloop.

*ZINCLUDE ends here...

*Use the above ZINCLUDE as below...
Report Zreport2.
Tables:kna1.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.

INCLUDE ZINCLUDE. " this will do the task mentioned in the include above...

I would rather suggest to go for the second method that is _ Specifying ZINCLUDE_ coz for the first one.. you need to

have data declarations and which is not necessary for just a simple select query.. if you are processing

any further in the first program then go for the first method_( SUBMIT STATEMENT)_ by declaring the necessary variables..

This would solve your issue...

Good luck

Narin

Edited by: Narin Nandivada on Sep 9, 2008 4:37 PM

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