2007 Oct 01 10:47 AM
Dear Experts
I am using the below statement to execute the program in background
SUBMIT RIAUFK20 and return
with lead_auf in lead_auf
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
My problem is the program which I am submiting is a report and after excecuting the report in background, I need the final internal table values in my Program for another calculation.
Is it possible and If so let me know with the example.
Thanks in Advance
\karthik
Dear Experts
I am using the below statement to execute the program in background
SUBMIT RIAUFK20 and return
with lead_auf in lead_auf
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
My problem is the program which I am submiting is a report and after excecuting the report in background, I need the final internal table values in my Program for another calculation.
Is it possible and If so let me know with the example.
Thanks in Advance
\karthik
2007 Oct 01 10:52 AM
Hi ...
You can use the ABAP Memory to EXPORT this internal table in the Submitted Report and IMPORT it from the Calling program.
ABAP MEMORY:To transfer the Data between the Programs Running in the Same Session We can use.
Eg:
Calling Report.
REPORT ZREP1.
DATA : ITAB TYPE TABLE OF MARA.
SELECT * FROM MARA INTO TABLE ITAB.
EXPORT TEMPTAB FROM ITAB TO MEMORY ID 'M1'.
SUBMIT ZREP2 AND RETURN.
Called report
REPORT ZREP2.
DATA: IT_MARA TYPE TABLE OF MARA.
DATA WA TYPE MARA.
IMPORT TEMPTAB TO IT_MARA FROM MEMORY ID 'M1'
LOOP AT IT_MARA INTO WA.
WRITE:/ WA-MATNR.
ENDLOOP.
<b>REWARD IF HELPFUL.</b>
2007 Oct 01 10:54 AM
submit <report_name>
with <parameters>
exporting list to memory
and return.
now call the fms:LIST_FROM_MEMORY, LIST_TO_ASCI to get the data.
Now you will have to manually split the data accordingly into individual fields
" See sample code below
data : it_abaplist type table of abaplist.
data : it_text(255) type c occurs 0 with header line.
* Submitting the report output to memory
submit rsstat20
with rstartti = p_stime
with rday = p_sdate
with rendti = p_etime
with rendday = p_edate
with rmaxcnt = p_cnt
exporting list to memory
and return.
* Retrieves the Report List from memory
call function 'LIST_FROM_MEMORY'
tables
listobject = it_abaplist
exceptions
not_found = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Converts the memory output to Asci output
call function 'LIST_TO_ASCI'
tables
listasci = it_text
listobject = it_abaplist
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Regards
Gopi
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |