07-07-2006 6:42 AM
HI all,
I need to pass an internal table to a report using submit keyword. How can I do this??
Basically, I am writing a function module in which one internal table gets populated. In the same function module code, I will call another report thru submit keyword. To that report I need to pass this internal table data.
Please help me in this....
rgds,
anil.
07-07-2006 6:46 AM
07-07-2006 6:46 AM
07-07-2006 6:49 AM
Here is some sample code for the IMPORT/EXPORT.
program.
<b>report zkis1.
data: imara type table of mara with header line.
start-of-selection.
select * into table imara from mara up to 10 rows.
export imara to memory id 'YOURID'.
submit zkis2 and return.
</b>
The submitted program.
<b>report zkis2 .
data: imara type table of mara with header line.
import imara from memory id 'YOURID'.
loop at imara.
write:/ imara-matnr.
endloop.
</b>
07-07-2006 6:48 AM
You will have to pass the internal table values using the parameters of the report that you are submitting.
SUBMIT... [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>].
In this you can use
SUBMIT REPORT report_name WITH PARAMETER = 'XXX'.
So, if you have a select - options then you can dump all the values of the internal table into a RANGES variable and pass.
Regards,
Ravi
Note : Please mark all the helpful answers
07-07-2006 7:01 AM
Hi,
Below is an example from one of my reports. It basically passes values from my itab.
IF NOT v_kunnr IS INITIAL.
SUBMIT zdealer_contacts_add_edit AND RETURN
WITH p_kunnr = v_kunnr
WITH p_name1 = p_name1 "AVH
WITH p_cdseq = space
WITH p_flag = 'A'
WITH p_addr = it_zts0001-zaddress
WITH p_pers = it_zts0001-zcperson
WITH p_numb = it_zts0001-zcnumber
VIA SELECTION-SCREEN.
ENDIF.
07-07-2006 7:56 AM
Hi,
You can use EXPORT and IMPORT to MEMORY options.
REPORT ABC
Export <ITAB> to memory id 'SHARE'
SUBMIT DEF and return.
REPORT DEF.
Import <ITAB> from memory id 'SHARE'.
Regs,
Venkat Ramanan