Skip to Content
avatar image
Former Member

Calling an executable program.

Hi,

I have create a program that needs to call a second program sending it an internal table.

Is this possible? I know that I can use SUBMIT but I can't find the way to send it an IT to that second program.

Any Idea?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

8 Answers

  • Best Answer
    Apr 27, 2006 at 05:33 PM

    See command export.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 05:36 PM

    Hi,

    There are two ways in which you can do it.

    1. Easier one - EXPORT and IMPORT.

    2. USe the SELECTION SCREEN of the second program to pass the data if the table contains only one field. IF you have SELECT OPTION for that field, you can declare a RANGES variable in the calling program fill it and send it to the selection screen, while calling the SUBMIT program.

    If it has multiple columns, EXPORT / IMPORT is the way to go.

    regards,

    Ravi

    Note - Please mark the helpful answers

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 27, 2006 at 05:37 PM

    hi,

    try to use export internal table to memory,and import it from memory in your submit your program.

    Regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 05:38 PM

    Export from calling Program and import in the called program

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 05:38 PM

    hi,

    Export the table using 'EXPORT'.

    Regards,

    Tanveer.

    Mark helpful answers.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 05:40 PM

    Hi Jose,

    You can use SUBMIT with EXPORT option.

    The syntax is as follows.

    SUBMIT REPORT EXPORTING LIST TO MEMORY.

    Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN .

    You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' .

    Thanks,

    Vinay

    Message was edited by: Vinaykumar Gorrela

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 06:43 PM

    I'm trying to do this...

    -


    REPORT  ZPRUEBA_TABLA1.
    
    DATA: BEGIN OF IT_TABLA1 OCCURS 0,
      NOMBRE(20) TYPE C,
      EDAD TYPE I,
    END OF IT_TABLA1.
    
    START-OF-SELECTION.
    
      IT_TABLA1-NOMBRE = 'JOSE'.
      IT_TABLA1-EDAD = 25.
      APPEND IT_TABLA1.
    
      IT_TABLA1-NOMBRE = 'MANUEL'.
      IT_TABLA1-EDAD = 18.
      APPEND IT_TABLA1.
    
    EXPORT (IT_TABLA1) TO MEMORY ID 'TABLA'.
    
    SUBMIT ZPRUEBA_TABLA2 AND RETURN.
    

    -


    *&---------------------------------------------------------------------*
    *& Report  ZPRUEBA_TABLA2
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    *&---------------------------------------------------------------------*
    *& Report  ZPRUEBA_TABLA1
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  ZPRUEBA_TABLA2.
    
    DATA: BEGIN OF IT_TABLA1 OCCURS 0,
      NOMBRE(20) TYPE C,
      EDAD TYPE I,
    END OF IT_TABLA1.
    
    START-OF-SELECTION.
    
    IMPORT IT_TABLA1 FROM MEMORY ID 'TABLA'.
    
    LOOP AT IT_TABLA1.
      WRITE:/ IT_TABLA1-NOMBRE.
    ENDLOOP.
    

    And it is not working, I want to receive the it_tabla1 in the second program to loop it and work with it.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 27, 2006 at 06:58 PM

    I just changed

    EXPORT (IT_TABLA1) TO MEMORY ID 'TABLA'.

    to

    EXPORT IT_TABLA1 TO MEMORY ID 'TABLA'.

    and it works now.

    Thanx to all

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I thought that could have been the possible cause of error before..

      The reason being that (IT_TABLA1) is dynamic and IT_TABLA1 is static.

      Regards,

      Tanveer.

      Mark helpful answers