Application Development 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: 

FM LIST_OF_MEMORY

Former Member
0 Kudos

thanks all.

i get the data in to <b>listobject</b>

but it in 2 columns , i want it seprate so i can find my data that i need.

i use the func asci? and it not solve it for me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi again,

1. use it like this:

*----


Simple Example

1. Do two things

2. make one new simple program

named ZAM_TEMP01

code should be like this simple :

REPORT ZAM_TEMP01.

write 😕 'amit'.

*----


3. now create another program,

and just copy paste this code.

4.

report abc.

*----


data : ABAPLIST like table of ABAPLIST.

data : begin of itab occurs 0,

f(100) type c,

end of itab.

*----


start-of-selection.

submit zam_temp01 and return exporting list to memory.

*----


CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = abaplist

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTASCI = itab

LISTOBJECT = abaplist

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

loop at itab.

write 😕 itab-f.

endloop.

regards,

amit m.

12 REPLIES 12

Former Member
0 Kudos

Hi rani,

1. LIST_TO_ASCI

*----


Simple Example

1. Do two things

2. make one new simple program

named ZAM_TEMP01

and just WRITE 'HELLO'.

in that program.

3. now create another program,

and just copy paste this code.

4.

report abc.

*----


data : ABAPLIST like table of ABAPLIST.

data : begin of itab occurs 0,

f(100) type c,

end of itab.

*----


start-of-selection.

submit zam_temp01 and return exporting list to memory.

*----


CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = abaplist

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTASCI = itab

LISTOBJECT = abaplist

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

loop at itab.

write 😕 itab-f.

endloop.

regards,

amit m.

0 Kudos

amit i did your example

very nice

i get all the data like in the screen.

but now i need to take the stock and manuplate it and how i can do it if i have only <b>coulmn F</b>

0 Kudos

Hi Rani,

once you have data in your itab , you need to analyze, and then split itab data , and split can be using offset method get the stock data to some other itab.

and do what ever you want.

Regards

vijay

0 Kudos

is there a FM doing it

i have data complex like this

xxxxxxxxxxxxx

x | 3 |7

xxxxxx

wwwwwwwwwww

eeeeee

not everthing in the same postiion.

becuase of that i asked yesterday if i could take the table BESTAND that is in the mb5b code

0 Kudos

Hi again,

1. the thing for which u are asking is :

making sense and format

out of data which is in character format

in multiple lines.

2. thats very tricky and practically

impossible.

3. The reason is that

words and sentences in report

are not in fixed format and alignment.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos

hi,

you need to use LIST_TO_ASCI FM,

did you check my previous posts..

i am telling you so many times.

Regards

vijay

0 Kudos

i told you i did the FM asci and i did not get.

former_member181962
Active Contributor
0 Kudos

Is it LIST_from_MEMORY?

Former Member
0 Kudos

here is your code

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = IT_LIST

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC = 0.

"convert it to ASCI

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTASCI = IT_ASC

LISTOBJECT = IT_LIST

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

ENDIF.

what is the declare of IT_ASC

0 Kudos

it should be in this way..

DATA:BEGIN OF IT_ASC OCCURS 0,
      TXT(250),
     END OF IT_ASC.

Regards

vijay

Former Member
0 Kudos

Hi again,

1. use it like this:

*----


Simple Example

1. Do two things

2. make one new simple program

named ZAM_TEMP01

code should be like this simple :

REPORT ZAM_TEMP01.

write 😕 'amit'.

*----


3. now create another program,

and just copy paste this code.

4.

report abc.

*----


data : ABAPLIST like table of ABAPLIST.

data : begin of itab occurs 0,

f(100) type c,

end of itab.

*----


start-of-selection.

submit zam_temp01 and return exporting list to memory.

*----


CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = abaplist

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTASCI = itab

LISTOBJECT = abaplist

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

loop at itab.

write 😕 itab-f.

endloop.

regards,

amit m.

Former Member
0 Kudos

hi

good

go through the code mentioned here

SUBMIT (REPORT_NAME)

USING SELECTION-SET P_VARI

EXPORTING LIST TO MEMORY

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = INT_LISTOBJECT

EXCEPTIONS

NOT_FOUND = 1.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTASCI = INT_LISTASCII

LISTOBJECT = INT_LISTOBJECT

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2.

-


DATA: MTAB_REPORT_LIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.

DATA: MTAB_REPORT_HTML LIKE W3HTML OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF MTAB_REPORT_ASCII OCCURS 0,

LINE(255) TYPE C,

END OF MTAB_REPORT_ASCII.

START-OF-SELECTION.

*-- Submit a report. This one is the chart of accounts

SUBMIT RFSKPL00

EXPORTING LIST TO MEMORY " Save list in memory

AND RETURN. " Return control to this program

END-OF-SELECTION.

*-- Get the list from memory

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = MTAB_REPORT_LIST

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

*-- Write the list out

*-- This is a trivial example. A better use would be when the

*-- requirement is to have one report print out several different

*-- reports on the same list level.

CALL FUNCTION 'WRITE_LIST'

TABLES

LISTOBJECT = MTAB_REPORT_LIST

EXCEPTIONS

EMPTY_LIST = 1

OTHERS = 2.

************************************************************************

  • The examples below this line do not require that the report be *

  • submitted to memory when run. All that they require is that the *

  • report has been written to the screen. *

************************************************************************

*-- Take the current list that has been written to screen, and format

*-- as an HTML file.

CALL FUNCTION 'WWW_LIST_TO_HTML'

TABLES

HTML = MTAB_REPORT_HTML

EXCEPTIONS

OTHERS = 1.

*-- Save the list. Same as using System->List->Save->Local File or

*-- entering %pc in the OKCODE box. This function does not need the

*-- include <%_LIST> in a program.

*-- Method can be:

*-- NOCO - No conversion

*-- RTF - Rich Text Format

*-- DAT - Tab delimited Format

*-- When no method is given, a selection screen is presented for the

*-- user to choose the method.

CALL FUNCTION 'LIST_DOWNLOAD'

EXPORTING

METHOD = 'NOCO'

EXCEPTIONS

OTHERS = 1.

thanks

mrutyun