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

problem in sending program to memory , need advice .

Former Member
0 Likes
607

hello ,

i try to send program to memory and pull the data/result back to my program .

what can be the problem ?

SUBMIT RM06EL00

USING SELECTION-SET 'AMNY'

EXPORTING LIST TO MEMORY

AND RETURN.

still the program display the result in the end ( alv report ) ,

and not coming back to my sending program .

thanks .

3 REPLIES 3
Read only

Former Member
0 Likes
531

Hello Dakota,

since report RM06EL00 is producing a ALV list u could easily get the list into the memory.

Check this sample


START-OF-SELECTION.
  DATA: LISTOBJECT LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.
  SUBMIT  Z48R_PROJEKTSTATUS WITH SO_WWSTO IN SO_WWSTO
                             WITH SO_ISTAT IN SO_ISTAT
                             EXPORTING LIST TO MEMORY
                             AND RETURN.


* Import the list from memory and store it in table listobject
  CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
            LISTOBJECT = LISTOBJECT
       EXCEPTIONS
            NOT_FOUND  = 1
            OTHERS     = 2.
  IF SY-SUBRC <> 0.
    WRITE  'Error in list_from_memory.'.
  ENDIF.
  CALL FUNCTION 'LIST_TO_ASCI'
*       EXPORTING
*            LIST_INDEX         = -1
       TABLES
            LISTASCI           = LT_TXT
            LISTOBJECT         = LISTOBJECT
       EXCEPTIONS
            EMPTY_LIST         = 1
            LIST_INDEX_INVALID = 2
            OTHERS             = 3.
  CHECK SY-SUBRC = 0.

  DATA: LV_LINES LIKE SY-TABIX.
  DESCRIBE TABLE LT_TXT LINES LV_LINES.
  LOOP AT LT_TXT INTO W_TEXTLINE.
    CHECK SY-TABIX > 3.
    CHECK W_TEXTLINE(5) <> 'Keine'.
    CHECK W_TEXTLINE(5) <> '-----'.
    DO 120 TIMES. REPLACE ' |' WITH '|' INTO W_TEXTLINE.  ENDDO.
    "WRITE / w_textline(255).
    PERFORM HANDLE_LINE USING W_TEXTLINE.
  ENDLOOP.

* Free memory
  CALL FUNCTION 'LIST_FREE_MEMORY'
       TABLES
            LISTOBJECT = LISTOBJECT
       EXCEPTIONS
            OTHERS     = 1.
  IF SY-SUBRC <> 0.
    WRITE  'Error in list_free_memory.'.
  ENDIF.

&---------------------------------------------------------------------*
*&      Form  handle_line
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--> P_TEXTLINE  text
*----------------------------------------------------------------------*
FORM HANDLE_LINE USING    P_LINE.

  DATA: BEGIN OF T_CLINE OCCURS 0,
          TEXT(40),
        END   OF T_CLINE.

** erstes Zeichen immer | und irrelevant
  SHIFT P_LINE.
  SPLIT P_LINE AT '|' INTO TABLE T_CLINE.
  READ TABLE T_CLINE INDEX 2.
  G_T_STATUS-PSPID = T_CLINE-TEXT.
  READ TABLE T_CLINE INDEX 3.
  G_T_STATUS-POSID = T_CLINE-TEXT.
  APPEND G_T_STATUS.

ENDFORM.                    " handle_line

Read only

0 Likes
531

yes , i know that its look easy , but still , the report (RM06EL00) is show up ,

and not coming back .

thanks any way , and i use the same code that you supply here .

thanks .

  • Read list from memory into table

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LT_LISTOBJECT

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • Error in function module &1

MESSAGE ID '61' TYPE 'E' NUMBER '731'

WITH 'LIST_FROM_MEMORY'.

ENDIF.

  • and objbin is of size CHAR(255) we make this table copy

CALL FUNCTION 'TABLE_COMPRESS'

TABLES

IN = LT_LISTOBJECT

OUT = LT_OBJBIN

EXCEPTIONS

COMPRESS_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • Error in function module &1

MESSAGE ID '61' TYPE 'E' NUMBER '731'

WITH 'TABLE_COMPRESS'.

ENDIF.

Read only

Former Member
0 Likes
531

Hi,

Tyr this way

SET PARAMETER ID 'RID' FIELD v_pname.

v_pname = sy-repid.

SUBMIT (v_pname)[USING SELECTION-SCREEN dynnr]

[VIA SELECTION-SCREEN]

[selscreen_parameters] ...

AND RETURN.

Please check this for more information.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm

Thanks

Vana