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

getting data from a list output

Former Member
0 Likes
544

Hai,

I need to call a report which lists out internal table data, from an RFC.

For this I exported list which I got from report to memory in calling RFC, and I used the following FMs to get data.

'LIST_FROM_MEMORY'

'WRITE_LIST'

'DISPLAY_LIST'

By calling these I'm getting the list output correctly but I need to get this list output to an internal table of the calling RFC. Could anyone suggest regarding this.

Thank you

Regards

Srinivas

Hai,

I need to call a report which lists out internal table data, from an RFC.

For this I exported list which I got from report to memory in calling RFC, and I used the following FMs to get data.

'LIST_FROM_MEMORY'

'WRITE_LIST'

'DISPLAY_LIST'

By calling these I'm getting the list output correctly but I need to get this list output to an internal table of the calling RFC. Could anyone suggest regarding this.

Thank you

Regards

Srinivas

1 REPLY 1
Read only

deepak_dhamat
Active Contributor
0 Likes
473

Dear Shri ,

data : listtab like abaplist occurs 1 .

data : listtab_tmp like abaplist occurs 1.

data: txtlines(2000) type c occurs 0 with header line.

data :txtlines1(2000) type c occurs 0 with header line .

data : n type int2 .

data : cnt type i value 1 .

types : begin of wa_alpha,

a(30) type c ,

b(30) type c ,

c(30) type c ,

d(30) type c ,

e(30) type c ,

f(30) type c ,

g(30) type c ,

h(30) type c ,

i(30) type c ,

j(30) type c ,

k(30) type c ,

l(30) type c ,

end of wa_alpha .

data : it_alpha type standard table of wa_alpha with header line .

data : it_alpha1 type standard table of wa_alpha with header line .

submit riequi20 using selection-set 'TOOLROOM' exporting list to memory and return .

call function 'LIST_FROM_MEMORY'

tables

listobject = listtab

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.

describe table listtab lines n .

check sy-subrc = 0.

call function 'LIST_TO_ASCI'

tables

listobject = listtab

listasci = txtlines

exceptions

empty_list = 1

list_index_invalid = 2

others = 3.

check sy-subrc = 0.

describe table txtlines lines n .

n = n - 2.

loop at txtlines .

if cnt = 1 or cnt = 3 .

delete txtlines .

endif.

if cnt = n .

delete txtlines .

endif.

cnt = cnt + 1 .

clear txtlines .

endloop.

data : delimiter(1) value '|'.

loop at txtlines.

split txtlines at delimiter into it_alpha-a

it_alpha-b

it_alpha-c

it_alpha-d

it_alpha-e

it_alpha-f

it_alpha-g

it_alpha-h

it_alpha-i

it_alpha-j

it_alpha-k

it_alpha-l .

append it_alpha .

clear txtlines .

endloop.

Use this logic your problem will solve thats for sure .....

Thanks And Regards .

Deepak Dhamat.