Exporting List To Memory

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.

If LIST_TO_TXT is causing you problems, you can try LIST_TO_ASCI alternatively.
Advertisement

Posted

in

,

by

Tags:

Comments

2 responses to “Exporting List To Memory”

  1. Doug Avatar

    Very good blog! Do you have any suggestions for
    aspiring writers? I’m planning to start my own site soon but
    I’m a little lost on everything. Would you advise starting with a free platform like WordPress or go
    for a paid option? There are so many choices
    out there that I’m completely confused .. Any recommendations?
    Thanks a lot!

    1. Dr. Kerem Koseoglu Avatar

      I believe that content is more important than the platform. You can start with a free platform; and when you have a lot of followers and start getting serious traffic, you might consider moving to an alternative platform with more options. All major platforms have options of moving, so no worries about that. WordPress worked fine for me so far.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s