Skip to Content
0
Former Member
Oct 26, 2007 at 09:08 AM

Problem with a SUBMIT exporting results to memory

126 Views

Hello.

Edit 30/10/2007

I'am having some difficulties launching the report for S_ALR_87013611 through a submit.

I want to know if it's possible to launch the report without opening it in SAP. All the results stored in Memory so i can retrieve it with my main program.
I have tried the option EXPORTING LIST TO MEMORY AND RETURN, but still, it opens the report as an excel sheet.
Is there a way to disable this opening ???

More details below

1- When i execute my program, it opens à popup to enable or disable macros in excel and the it opens the results of the report in a excel sheet SAP.

What i want is to disable the popup and the opening of the sheet. I want to store the results in the memory and then retrieve what i need.

Here are some screenshots :

2- After closing the sheet, my program continues processing. I'm trying to read the data in memory but the sy-subrs is different from 0. I don't understand why.

Thanks for the help if anybody as any idea on how i can resolve this.

Sample of code :

DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



KOKRE  EQ p_kokrs           
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



GJAHR   EQ p_gjhar             
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



PERIV    EQ '1'
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



PERIB    EQ '9'
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



VERP     EQ '0'
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



KOSET   EQ 'GFGGNX'
         WITH 
DATA  BEGIN OF itab_list OCCURS 0.
        INCLUDE STRUCTURE abaplist.
DATA  END OF itab_list.

******** ......... ******

  IF sy-mandt EQ '030'.
    SUBMIT GP4QLQKH46VZJ3P1A40A23S3HJG030
         WITH $1KOKRE  EQ p_kokrs           
         WITH $1GJAHR   EQ p_gjhar             
         WITH $1PERIV    EQ '1'
         WITH $1PERIB    EQ '9'
         WITH $1VERP     EQ '0'
         WITH $1KOSET   EQ 'GFGGNX'
         WITH $1KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



KSTAR    EQ 'NCPR'
         EXPORTING LIST TO MEMORY
         AND RETURN.
  ENDIF.

  CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
      listobject = itab_list
    EXCEPTIONS
      not_found  = 4
      OTHERS     = 8.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur de lecture LIST_FROM_MEMORY',
             sy-subrc.
  ENDIF.


  REFRESH vlist.

  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      list_index         = -1
    TABLES
      listasci           = vlist
      listobject         = itab_list
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.

  IF sy-subrc NE '0'.
    WRITE:/ 'Erreur reprise memory LIST_TO_ASCI. ',
            sy-subrc.
  ENDIF.



Message was edited by: Helder

Helder Da Costa