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

how to write report output into table

Former Member
0 Likes
3,034

Hi,

I want to get data out from report "RSPARAM" which list all system profile parameters my requirement is that i need to write output of this report to table so can anyone please tell me how should achieve this?

is there any FM which read report as parameters and write into table?

thanks in advance.

john.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,191

thanks rich , poornanad.

rich your code help me...

but when i pass rsparam report with submit it doesn't return any thing, more specific on my requirement

i want those three column data which we get when we run rsparam report into a table?

so please tell me how do i get this?

thanks,

john

Hi John,

You haven't marked your post as a question. I have done that now, and you'll be able to assign points to the answers that have helped you.

Regards,

Anand Mandalika.

7 REPLIES 7
Read only

Former Member
0 Likes
2,191

Hi John,

You can take a look at the F1-documentation for the SUBMIT statement. There's an option called EXPORTING LIST TO MEMORY. That should help you realize your requirement.

Regards,

Anand Mandalika.

Read only

0 Likes
2,191

Here is a sample program.



report zrich_0003 .

data: begin of listout occurs 0,
      line(1024) type c,
      end of listout.

* Submit the report and export list to memory
submit z_your_report exporting list to memory
            and return.

* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.

loop at listout.
  write:/ listout.
endloop.

************************************************************************
* RETRIEVE_LIST_FROM_MEMORY
************************************************************************
form retrieve_list_from_memory tables reportlines.

  data: list like abaplist occurs 0 with header line.
  data: txtlines(1024) type c occurs 0 with header line.

  clear list.  refresh list.
  clear reportlines. refresh reportlines.

  call function 'LIST_FROM_MEMORY'
       tables
            listobject = list
       exceptions
            not_found  = 1
            others     = 2.

  check sy-subrc = 0.

  call function 'LIST_TO_ASCI'
       tables
            listobject         = list
            listasci           = txtlines
       exceptions
            empty_list         = 1
            list_index_invalid = 2
            others             = 3.

  check sy-subrc = 0.

  reportlines[] = txtlines[].

  call function 'LIST_FREE_MEMORY'.

endform.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
2,192

thanks rich , poornanad.

rich your code help me...

but when i pass rsparam report with submit it doesn't return any thing, more specific on my requirement

i want those three column data which we get when we run rsparam report into a table?

so please tell me how do i get this?

thanks,

john

Read only

0 Likes
2,191

Looks like the program you are calling(rsparam) is just calling another report, RSPFPAR. Let's just call that one directly. Here is an updated version of the program.

This will also put the first 3 columns in a internal table. This should show you what you need to do.


report zrich_0003 .

data: begin of listout occurs 0,
      line(1024) type c,
      end of listout.

data: begin of itab occurs 0,
      column1(100) type c,
      column2(100) type c,
      column3(100) type c,
      therest(100) type c,
      end of itab.

* Submit the report and export list to memory
submit  rspfpar exporting list to memory
            and return.

* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.

loop at listout.
  if sy-tabix => 7.
    clear itab.
split listout+1(500) at '|' into itab-column1 itab-column2
                                 itab-column3 itab-therest.
    append itab.
  endif.
endloop.

loop at itab.
  write:/ itab-column1, itab-column2, itab-column3.

endloop.

************************************************************************
* RETRIEVE_LIST_FROM_MEMORY
************************************************************************
form retrieve_list_from_memory tables reportlines.

  data: list like abaplist occurs 0 with header line.
  data: txtlines(1024) type c occurs 0 with header line.

  clear list.  refresh list.
  clear reportlines. refresh reportlines.

  call function 'LIST_FROM_MEMORY'
       tables
            listobject = list
       exceptions
            not_found  = 1
            others     = 2.

  check sy-subrc = 0.

  call function 'LIST_TO_ASCI'
       tables
            listobject         = list
            listasci           = txtlines
       exceptions
            empty_list         = 1
            list_index_invalid = 2
            others             = 3.

  check sy-subrc = 0.

  reportlines[] = txtlines[].

  call function 'LIST_FREE_MEMORY'.

endform.

Regards,

Rich Heilman

Read only

0 Likes
2,191

By the way, can you please mark this post as a question and reward points accordingly.

Thanks.

Regards,

Rich Heilman

Read only

0 Likes
2,191

Hi Rich,

i want reward your answer.How do i reward to your answer?

Thanks for your help.

john

Read only

0 Likes
2,191

Hi John,

You haven't marked your post as a question. I have done that now, and you'll be able to assign points to the answers that have helped you.

Regards,

Anand Mandalika.