‎2011 Jul 14 1:07 PM
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
‎2011 Jul 14 1:11 PM
Hi,
problem must be at ZSDBAPI_HU_GETLIST program.can u give more spesifications about this program.
Best Regards,
Burak
‎2011 Jul 14 1:11 PM
Hi,
problem must be at ZSDBAPI_HU_GETLIST program.can u give more spesifications about this program.
Best Regards,
Burak
‎2011 Jul 14 1:18 PM
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.
‎2011 Jul 14 2:04 PM
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
‎2011 Jul 14 2:12 PM
Thanks, but these classes are not available in 4.7c. I'll have to find an old-school workaround..