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

submit query

Former Member
0 Likes
1,895

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

2 REPLIES 2
Read only

varma_narayana
Active Contributor
0 Likes
783

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>

Read only

gopi_narendra
Active Contributor
0 Likes
783

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