2009 Mar 09 8:14 PM
Hi. I have a programm A, wich should call a programm B, passing to parameters.
The problem is that programm B has 3 interns tables like final result, and then those 3 tables are sending to call a Smartform.
What i wnato to do is call programm B, not shows its result, and capture the content of the 3 interns tables to use them in programm A.
How I can Do this??? maybe using SUBMIT, but i don't know how, and is very important that the program wich is called, doesn't show its result, only capture its data.
2009 Mar 09 9:06 PM
Hi Jorge,
Do you have availability to change program B? If so you can simply ommit the call statement for smartform and use ABAP memory to send your tables' content back to program A.
"in program B
EXPORT tab FROM my_table1[] TO MEMORY ID 'TAB'.
"in program A
data: my_tab1 type ...
IMPORT tab TO my_tab1[] FROM MEMORY ID 'TAB'.
If you program B uses screen to displlay the results you can suppress it with
EXPORT ...
SUPRESS DIALOG. "screen won't be shown
If, on the other hand, you use simple write statements to display program's B results, you can do following:
"first submit program B in such mode
SUBMIT program_B EXPORTING TO LIST MEMORY. "now all your write statements won't be outputed on screen, instead it will be exported to memory
"now in the program A import it back from the memory using
DATA BEGIN OF my_tab1 OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF my_tab1.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = my_tab1.
For more information about the last one refer [this|http://www.sapdev.co.uk/reporting/rep_submit.htm].
Regards
Marcin
2009 Mar 09 8:16 PM
2009 Mar 09 8:22 PM
In SE38, write 'Submit' then press a F1.
Search the forum with key word 'Submit Program'
This are the basic steps need to be performed before posting in SDN.
Kuntal
2009 Mar 09 9:06 PM
Hi Jorge,
Do you have availability to change program B? If so you can simply ommit the call statement for smartform and use ABAP memory to send your tables' content back to program A.
"in program B
EXPORT tab FROM my_table1[] TO MEMORY ID 'TAB'.
"in program A
data: my_tab1 type ...
IMPORT tab TO my_tab1[] FROM MEMORY ID 'TAB'.
If you program B uses screen to displlay the results you can suppress it with
EXPORT ...
SUPRESS DIALOG. "screen won't be shown
If, on the other hand, you use simple write statements to display program's B results, you can do following:
"first submit program B in such mode
SUBMIT program_B EXPORTING TO LIST MEMORY. "now all your write statements won't be outputed on screen, instead it will be exported to memory
"now in the program A import it back from the memory using
DATA BEGIN OF my_tab1 OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF my_tab1.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = my_tab1.
For more information about the last one refer [this|http://www.sapdev.co.uk/reporting/rep_submit.htm].
Regards
Marcin