‎2006 Apr 26 9:00 AM
can we get ALV data from the FM LIST_FROM_MEMORY?
can you give me an example PLS
‎2006 Apr 26 9:07 AM
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
‎2006 Apr 26 9:07 AM
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
‎2006 Apr 26 9:18 AM
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.
‎2006 Apr 26 9:23 AM
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.
‎2006 Apr 26 9:35 AM
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