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

How can I get the internal table data into a program by submitting another

Former Member
0 Likes
9,690

Hi all,

How can I get the data of an internal table by submitting another program into the present program. Please help me. this is urgent.

Thanks,

srinivas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,970

REPORT ZREP1 .

DATA: BEGIN OF i_makt occurs 0,

matnr TYPE makt-matnr,

maktx TYPE makt-maktx,

END OF i_makt.

select matnr

maktx

from makt

into table i_makt

up to 10 rows.

export i_makt to memory id 'BAC'.

-


REPORT ZREP2 .

DATA: BEGIN OF i_makt OCCURS 0,

matnr TYPE makt-matnr,

maktx TYPE makt-maktx,

END OF i_makt.

submit ZREP1 and return .

IMPORT I_MAKT FROM MEMORY ID 'BAC'.

LOOP AT I_MAKT.

ENDLOOP.

<USE WRITE STATEMENTS>.........

EXECUTE THE ZREP2.

you will get the output....

reward points if useful.

regards

srinivas

7 REPLIES 7
Read only

Former Member
0 Likes
3,970

hi

Use submit statement .

submit program name (from which u want the internal table).

submit <program name>EXPORTING LIST TO MEMORY

Effect

This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.

The list is stored in the ABAP Memory as an internal table of the row type ABAPLIST, ABAPLIST being a structured data type in the ABAP Dictionary.

The calling program can access the list stored once program access is completed, using function modules belonging to the function group SLST.

The function module LIST_FROM_MEMORY loads the list from the ABAP Memory to an internal table of the row type ABAPLIST.

The function module WRITE_LIST inserts the content of an internal table of the row type ABAPLIST in the current list.

The function module DISPLAY_LIST displays the content of an internal table of the row type ABAPLIST in a separate list screen.

reward points if useful.

deepa

Read only

Former Member
0 Likes
3,970

Hello,

Try this in the called program:


CONSTANTS:
  C_ITAB_NAME TYPE C LENGTH 72 VALUE '(PROGRAM_NAME)ITAB_NAME[]'.

FIELD-SYMBOLS: <FS_ITAB> TYPE ANY TABLE.

ASSIGN (C_ITAB_NAME) TO <FS_ITAB>.

Regards,

Read only

Former Member
0 Likes
3,970

Export the selected rows to the next program

EXPORT itab TO MEMORY ID 'MID'.

CALL TRANSACTION 'ZAB'.

ZAB is the tcode for the other program where u want to import the values.

In the second program

INITIALIZATION.

IMPORT the internal table from the first program

IMPORT itab FROM MEMORY ID 'MID'.

Read only

Former Member
0 Likes
3,970

Hi,

1) You have to export the internal table to memeory like this:

EXPORT itab TO MEMORY ID 'ABC'.

2) And then submit to another program.

SUBMIT zreport2 USING SELECTION-SCREEN '1000'

AND RETURN.

3) And in zreport2 ypu have to import that table from same memory Id.

IMPORT itab FROM MEMORY ID 'ABC'.

The internal table itab should be of same type and should be declared in both the programs.

Regards,

Pooja Bajaj.

Read only

Former Member
0 Likes
3,971

REPORT ZREP1 .

DATA: BEGIN OF i_makt occurs 0,

matnr TYPE makt-matnr,

maktx TYPE makt-maktx,

END OF i_makt.

select matnr

maktx

from makt

into table i_makt

up to 10 rows.

export i_makt to memory id 'BAC'.

-


REPORT ZREP2 .

DATA: BEGIN OF i_makt OCCURS 0,

matnr TYPE makt-matnr,

maktx TYPE makt-maktx,

END OF i_makt.

submit ZREP1 and return .

IMPORT I_MAKT FROM MEMORY ID 'BAC'.

LOOP AT I_MAKT.

ENDLOOP.

<USE WRITE STATEMENTS>.........

EXECUTE THE ZREP2.

you will get the output....

reward points if useful.

regards

srinivas

Read only

0 Likes
3,970

Guys...

This code works exactly perfect well...Try this...

Thanks Srinivasa ravva ...

Read only

cguere_
Member
0 Likes
3,970

please code abap for submit and get a internal table of other program