Application Development and Automation 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: 
Read only

passing internal table thru submit

Former Member
0 Likes
2,048

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
Read only

Former Member
0 Likes
980

u can use Import Export statements

5 REPLIES 5
Read only

Former Member
0 Likes
981

u can use Import Export statements

Read only

0 Likes
980

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>

Read only

Former Member
0 Likes
980

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

Read only

aris_hidalgo
Contributor
0 Likes
980

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.

Read only

Former Member
0 Likes
980

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