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: 

passing internal table thru submit

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

u can use Import Export statements

5 REPLIES 5

Former Member
0 Kudos

u can use Import Export statements

0 Kudos

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>

Former Member
0 Kudos

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

aris_hidalgo
Contributor
0 Kudos

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.

Former Member
0 Kudos

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