Reg:how to include a report in another report.
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.
select kunnr name1 from kna1 into table itab.
loop at itab.
write: / itab-kunnr,itab-name.
In report 2 i write the declaration.
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??
Narin Nandivada replied
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...
Edited by: Narin Nandivada on Sep 9, 2008 4:37 PM