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

LIST_FROM_MEMORY not_found

Former Member
0 Likes
1,252

Hi

I got (most of) this code from sdn, but the LIST_FROM_MEMORY always fails with not_found subrc. We're on 4.7c, but surely this should work?

&----


*& Report ZADRTEMP73 *

&----


REPORT ZADRTEMP73.

*

SELECTION-SCREEN: BEGIN OF BLOCK SEL WITH FRAME TITLE TEXT-SEL.

PARAMETERS P_EXIDV TYPE EXIDV OBLIGATORY.

SELECTION-SCREEN: END OF BLOCK SEL.

*

DATA: BEGIN OF LISTOUT OCCURS 0,

LINE(1024) TYPE C,

END OF LISTOUT.

START-OF-SELECTION.

  • Submit the report and export list to memory

SUBMIT ZSDBAPI_HU_GETLIST WITH P_EXIDV = P_EXIDV

EXPORTING LIST TO MEMORY

AND RETURN.

  • Get list from memory and convert to ascii

PERFORM RETRIEVE_LIST_FROM_MEMORY TABLES LISTOUT.

LOOP AT LISTOUT.

WRITE:/ LISTOUT.

ENDLOOP.

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

  • RETRIEVE_LIST_FROM_MEMORY

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

FORM RETRIEVE_LIST_FROM_MEMORY TABLES REPORTLINES.

DATA: LIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.

DATA: TXTLINES(1024) TYPE C OCCURS 0 WITH HEADER LINE.

CLEAR LIST. REFRESH LIST.

CLEAR REPORTLINES. REFRESH REPORTLINES.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LIST

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CHECK SY-SUBRC = 0.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

LISTOBJECT = LIST

LISTASCI = TXTLINES

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3.

CHECK SY-SUBRC = 0.

REPORTLINES[] = TXTLINES[].

CALL FUNCTION 'LIST_FREE_MEMORY'.

ENDFORM. "retrieve_list_from_memory

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,156

Hi,

problem must be at ZSDBAPI_HU_GETLIST program.can u give more spesifications about this program.

Best Regards,

Burak

4 REPLIES 4
Read only

Former Member
0 Likes
1,157

Hi,

problem must be at ZSDBAPI_HU_GETLIST program.can u give more spesifications about this program.

Best Regards,

Burak

Read only

0 Likes
1,156

I realise now that this functionality is not what I expected. It only returns what is written with the WRITE statement which is ridiculous in itself. I was looking for something similar to the shared memory, but we're on 4.7c and unfortunately I cannot use that. Also the normal EXPORT and IMPORT MEMORY is not allowed from the OO context where I need it. I was hoping to use it from within a BADI.

Read only

0 Likes
1,156

Hi Adrian,

Are you looking for something like this?

/people/glen.simpson/blog/2011/07/07/gain-programmatic-access-to-data-of-sapgui-alv-reports

Regards,

Kothand

Read only

0 Likes
1,156

Thanks, but these classes are not available in 4.7c. I'll have to find an old-school workaround..