cancel
Showing results for 
Search instead for 
Did you mean: 

Submit report using internal table

Former Member
0 Kudos

Hi Experts!!,

REPORT 1

TYPES: BEGIN OF ty_out_table,

partner LIKE /sapsll/pntbp-partner,

bpvsy LIKE /sapsll/pntbp-bpvsy,

country LIKE adrc-country,

END OF ty_out_table.

  • internal table declaration & definition

DATA: gt_out_table TYPE STANDARD TABLE OF ty_out_table

WITH KEY partner

bpvsy.

I have data in internal table gt_out_table.

I want to pass data gt_out_table in report 2. using SUBMIT REPORT.

How to do that ?

REPORT 2

select-options: s_partnr for /sapsll/pntbp-bpvsy.

parameters: p_upd,

p_value .

please suggest.

Thanks

Anee

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi,

refer to this link.

http://www.sapdevelopment.co.uk/reporting/rep_submit.htm

try this code.

FIRST REPORT:

DATA: V_MATNR TYPE MATNR.

TYPES: BEGIN OF TY_ITAB,

MATNR TYPE MATNR,

MTART TYPE MTART,

MATKL TYPE MATKL,

ERNAM TYPE ERNAM,

END OF TY_ITAB.

TYPES: TT_ITAB TYPE STANDARD TABLE OF TY_ITAB.

DATA: ITAB TYPE TT_ITAB,

WA_ITAB TYPE TY_ITAB.

SELECTION-SCREEN: BEGIN OF BLOCK B1 with frame title text-001.

SELECT-OPTIONS: S_MATNR FOR V_MATNR.

SELECTION-SCREEN: END OF BLOCK B1.

SELECT

MATNR

MTART

MATKL

ERNAM

FROM MARA INTO TABLE ITAB

WHERE MATNR IN S_MATNR.

export ITAB to memory id 'SALES'.

SECOND REPORT

DATA: v_matnr TYPE matnr.

TYPES: BEGIN OF ty_itab,

matnr TYPE matnr,

mtart TYPE mtart,

matkl TYPE matkl,

ernam TYPE ernam,

END OF ty_itab.

TYPES: tt_itab TYPE STANDARD TABLE OF ty_itab.

DATA: itab TYPE tt_itab,

wa_itab TYPE ty_itab.

submit <first program name> AND RETURN.

IMPORT itab FROM MEMORY ID 'SALES'.

LOOP AT itab INTO wa_itab.

WRITE: wa_itab-matnr.

ENDLOOP.

regards,

sreelakshmi

Edited by: Sreelakshmi p on Oct 15, 2008 9:15 AM

Edited by: Sreelakshmi p on Oct 15, 2008 9:17 AM

Former Member
0 Kudos

hai,

... WITH SELECTION-TABLE rspar

Effect

If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:

SELNAME (length 8),

KIND (length 1),

SIGN (length 1),

OPTION (length 2),

LOW (length 45),

HIGH (length 45).

To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:

SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals

KIND must contain the type of selection screen component (P for parameters, S for selection criteria)

SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.

If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.

The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.

Notes

In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.

When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.

Former Member
0 Kudos

Hi Anee

Use export staement before submit statement .

export gt_out_table to memory id 'ID'.

Now in Report 2 write

import gt_out_table from memory id 'ID'.

REgards

HItesh

close this thread once your query is solved

Former Member
0 Kudos

hi

in the repor1

keep the part of code in subroutine i.e..fetching data to intrernal table.

use this subroutine in report2 where ever you required....

Former Member
0 Kudos

HI,

Use EXPORT and IMPORT statements to pass data to different programs and use it.

Regards,

Dhanunjaya Reddy