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

FM LIST_FROM_MEMORY

Former Member
0 Likes
1,675

can we get ALV data from the FM LIST_FROM_MEMORY?

can you give me an example PLS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,198

Hai Please Try with this Example

Data: listobject like abaplist occurs 1 with header line.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = listobject

EXCEPTIONS

OTHERS = 1 .

IF sy-subrc <> 0.

message ID '61' TYPE 'E' NUMBER '731'

with 'LIST_FROM_MEMORY'.

ENDIF.

Thanks & Regards

Sreenivasulu P

4 REPLIES 4
Read only

Former Member
0 Likes
1,199

Hai Please Try with this Example

Data: listobject like abaplist occurs 1 with header line.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = listobject

EXCEPTIONS

OTHERS = 1 .

IF sy-subrc <> 0.

message ID '61' TYPE 'E' NUMBER '731'

with 'LIST_FROM_MEMORY'.

ENDIF.

Thanks & Regards

Sreenivasulu P

Read only

Former Member
0 Likes
1,198

Hi,

Just checked out with a demo program, alv data cannot be obtained from LIST_FROM_MEMORY simply because ALV will be calling a seperate screen rather than the screen called for list printing.

ex:

REPORT zzalvcallsubmit .

FIELD-SYMBOLS : <fs> TYPE ANY.

DATA : l_string TYPE string VALUE '(ZZALV)P_SIMPLE'.

DATA : t_select TYPE rsparams OCCURS 0 WITH HEADER LINE.

t_select-selname = 'S_DATE'.

t_select-sign = 'I'.

t_select-option = 'BT'.

t_select-low = '20040101'.

t_select-high = '20051231'.

APPEND t_select.

SUBMIT zzalv WITH SELECTION-TABLE

t_select EXPORTING LIST TO MEMORY AND RETURN.

DATA : t_list TYPE abaplist OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = t_list

  • 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.

Read only

Former Member
0 Likes
1,198

Hi rani,

1. if its an ALV LIST (and not grid)

then we can get the data.

2. moreover,

the data will be raw data.

We will not be able to extract information

from it.

3. It will be exactly in the same format

as it is printed,

(ie. with headings, vertical lines, etc)

regards,

amit m.

Read only

Former Member
0 Likes
1,198

hi,

 CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
            LISTOBJECT = IT_LIST
       EXCEPTIONS
            NOT_FOUND  = 1
            OTHERS     = 2.

  IF SY-SUBRC = 0.
    CALL FUNCTION 'LIST_TO_ASCI'
         TABLES
              LISTASCI           = IT_ASC
              LISTOBJECT         = IT_LIST
         EXCEPTIONS
              EMPTY_LIST         = 1
              LIST_INDEX_INVALID = 2
              OTHERS             = 3.
  ENDIF.

Regards

vijay