‎2009 May 12 6:05 AM
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
‎2009 May 12 6:28 AM
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.
‎2009 May 12 6:16 AM
‎2009 May 12 6:29 AM
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.
‎2009 May 12 6:24 AM
Hi,
Donot use addition ' selection-screen' when using 'list_options'.
‎2009 May 12 6:28 AM
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.
‎2009 May 12 6:32 AM
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?
‎2009 May 12 6:43 AM
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
‎2009 May 12 6:53 AM
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.
‎2009 May 12 7:04 AM
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
‎2009 May 12 2:40 PM
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.