Did you know that it is possible to call an ABAP program from another one, and import the output list without letting the user see it? Here is an example program that does it:
REPORT ZKK_LIST2 .
types: begin of tt,
line(202),
end of tt.data: xlist type abaplist occurs 0 with header line.
data: xtext type tt occurs 0 with header line.start-of-selection.
submit zkk_list1 exporting list to memory and return.
CALL FUNCTION ‘LIST_FROM_MEMORY’
TABLES
LISTOBJECT = xlist
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.CALL FUNCTION ‘LIST_TO_TXT’
* EXPORTING
* LIST_INDEX = -1
TABLES
LISTTXT = xtext
LISTOBJECT = xlist
EXCEPTIONS
EMPTY_LIST = 1
LIST_INDEX_INVALID = 2
OTHERS = 3
.
break-point.end-of-selection.
Please note that this won’t work if the output was created with REUSE_ALV_GRID_DISPLAY. However, REUSE_ALV_LIST_DISPLAY will work just fine.
Leave a Reply