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

calling a program in another program

Former Member
0 Likes
833

Hi guys,

I have 2 reports.

Report1-uploads file into internal table ITAB1.

Report2-To be called in Report 1 and shd be able to access the TAB1 values.

How shd i do this?DO guide me precisely.

8 REPLIES 8
Read only

Former Member
0 Likes
776

Hi Alka,

use SET PARAMETER and GET PARAMETER

please go through the KEY word documentation

there is a system table called INDX( HK )

this will serve your purpose.

Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
776

Hi,

Try to use SUBMIT statement .

Kalp..

Read only

Former Member
0 Likes
776

Hi Alka,

Try this...

In report one after ITAB1 is filled us memory id

export itab1 to memory id 'NAA'.

in report 2...

submit REPORT1 using selection-screen '1000'

with <selection screen parameters>

and return.

import itab1 from memory id 'NAA'.

if sy-subrc = 0.

use itab1 here.

-


endif.

Ater that free memory id

FREE MEMORY ID 'NAA'.

Dont forget to declare itab1 in REPORT2 with same structure declared inREPORT1

Regards,

Mr.A

Read only

Former Member
0 Likes
776

hi ,

if you want to use an internal table from one report to another,

then you can use export and import statements to do so.

in report 1 :

data: indxkey like indx-srtfd,

wa_indx type indx.

concatenate sy-uname '_' sy-datum '_' sy-uzeit into indxkey.

export <internal table name> from <internal table name> to database indx(st) from wa_indx id indxkey

submit report2

in report 2 :

data: indxkey like indx-srtfd,

indx_wa type indx.

concatenate sy-uname '_' sy-datum '_' sy-uzeit into indxkey.

import <internal table name> = <internal table name>

from database indx(st) id indxkey to indx_wa.

note ; the definition for internal tables in both the programs should be exaclty the same.

Edited by: Srinivas Manchikalapati on Nov 25, 2008 7:18 AM

Read only

0 Likes
776

Use SUBMIT ret1 using selection-screen ' '

with < > and return

Read only

Former Member
0 Likes
776

just create two internal tables of same type in both programs.

then in report1.

use

export itab1 = itab1 to memory id 'MEMID'. (any string u can specify)

then in report2

import itab1 = itab1 from memory id 'MEMID'

Read only

Former Member
0 Likes
776

Hi ,

try :

SUBMIT report EXPORTING LIST TO MEMORY

AND RETURN.

or

write a method in your original program to return the internal table.

in your report 2 use Call method to call the method of report1 which returns your table list.

Shruthi

Read only

Former Member
0 Likes
776

Export itab1 from report1 and import itab1 into report2.

EXPORT it_outtab = lt_text TO DATABASE indx(xy) ID 'XYZ'.

IMPORT it_outtab = it_outtab1 FROM DATABASE indx(xy) ID 'XYZ'.

note - no need to define it_outtab. and lt_text can be of any type. it_outtab1 should be of type lt_text.

Regards,

Aparna.