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

Submitting a report

Former Member
0 Likes
985

Hi All,

I have created a report program.Now I want to use the output of another report in my program.

For this,I have used the statement

SUBMIT zrep WITH SELECTION-TABLE seltab EXPORTING LIST TO

MEMORY AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = itab_list

EXCEPTIONS

not_found = 4

OTHERS = 8.

Using the above,the output list of the called program is displayed.When I click on back then Iam able to see the output of my report.

I dont want the output of the called program to be displayed.I simply want to use the output of the called program in my report.

Can anyone tell me what is the mistake Iam doing and how I can achieve the desired functionality

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
954

Hi.

I think when u call another program from ur driver program , it will execute all the code of called program

and hence it will show also the output.

To avoid the output to be shown on the screen , u will have to do the little bit changes to the called program.

1) When u execute the called program alone , means not through calling from another program , make a flag which is set to 'X' and check this flag if it is set then out put shpuld be shown.

2) When u call the same program from outside another program then call this program by clearing that flag. and as u have made check there that if flag is clear then no output of that program should be shown.

In short, place a check in that program that it is being executed independently or from another program.

Hope u will got.

9 REPLIES 9
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
954

yes , you can achieve this.

Use SUPPRESS DIALOG.

Read only

0 Likes
954

I have used the following code.

SUBMIT report

WITH SELECTION-TABLE seltab

EXPORTING LIST TO MEMORY AND RETURN.

SUPPRESS DIALOG.

Still Iam able to see the output list of called program.

Read only

Former Member
0 Likes
954

Hi,

Donot use addition ' selection-screen' when using 'list_options'.

Read only

Former Member
0 Likes
955

Hi.

I think when u call another program from ur driver program , it will execute all the code of called program

and hence it will show also the output.

To avoid the output to be shown on the screen , u will have to do the little bit changes to the called program.

1) When u execute the called program alone , means not through calling from another program , make a flag which is set to 'X' and check this flag if it is set then out put shpuld be shown.

2) When u call the same program from outside another program then call this program by clearing that flag. and as u have made check there that if flag is clear then no output of that program should be shown.

In short, place a check in that program that it is being executed independently or from another program.

Hope u will got.

Read only

0 Likes
954

Hi Tahir,

Your solution is appropriate I guess, but I am not supposed to make changes in the called program.

Is there any other way for this?

Read only

0 Likes
954

Hi.

Please tell me that how ur called program is showing output. Means is it showing output in Smartform , ALV Grid or List.

If it is showing output through Smartform or ALV grid then to stop output to be shown is not possible with out modifying the program.

If the output is being shown using List i.e simple write statement then it is possible.

use the syntax as.

SUBMIT

EXPORTING LIST TO MEMORY " -


> Use this line , It will throw the output to buffer and not show

For further help on Submit Statement , write submit statement in program and place cursor on it and press F1 , it will show the detail of use of this statement

Edited by: tahir naqqash on May 12, 2009 10:44 AM

Read only

0 Likes
954

Hi,

The output of the called program is displayed as ALV Grid list.

It means that I have no other option to stop the display of called program.

Thank you all for your replies.

Read only

0 Likes
954

Hi Shayesta.

I also think so that there is no other option except modifying called program.

If u are afraid from changing the called program that changes can make effect then make the copy of that called program and change it according to ur need and use this modified program

Read only

Former Member
0 Likes
954

data : t_list like standard table of abaplist with header line.

DATA: BEGIN OF o_list OCCURS 0,

output(1500) TYPE c,

END OF o_list.

SUBMIT zrep WITH SELECTION-TABLE seltab EXPORTING LIST TO

MEMORY AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = t_list

EXCEPTIONS

not_found = 1.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = o_list " list converted to ASCII

listobject = t_list

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.