Skip to Content
avatar image
Former Member

Submit Report

Hi ,

we have requirement where we need to get the output of report A in report B. For example: all the values displayed after executing report A needs to be fetched in the internal table of report B.

I tried using SUBMIT REPORT

EXPORTING LIST TO MEMORY

But i could not get proper solution.

Please share your views.

Thanks in advance

Gowri

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 22, 2010 at 06:41 AM

    Hi

    " Just Copy this and Test in 
    
    Report Ztest1.
    data : listobject TYPE TABLE OF ABAPLIST." For More info Take F1 help on Export to Memory 
    SUBMIT ztest EXPORTING LIST TO MEMORY AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject       = listobject
     EXCEPTIONS
       NOT_FOUND        = 1
       OTHERS           = 2
              .
    IF sy-subrc = 0.
    CALL FUNCTION 'WRITE_LIST'
     EXPORTING
       WRITE_ONLY       = 'X'
      TABLES
        listobject       = listobject
     EXCEPTIONS
       EMPTY_LIST       = 1
       OTHERS           = 2      .
    ENDIF.
    
    Your ZTEST Program look as below
    
    report ZTEST.
    data : itab type standard table of sflight with header line.
    
    select * from sflight into table itab.
    if sy-subrc = 0.
      loop at itab.
        write :/ itab-carrid, itab-connid. " This Write Statement is Must to generatet List
      endloop.
    endif.

    Cheerz

    Ram

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Sumodh P

      Hi Sumodh,

      Actually after calling FM 'LIST_FROM_MEMORY' , I have called FM 'LIST_TO_ASCI' and pssed table LISTASCI to receive the list in ASCII.

      Thanks

      Gowri.

  • Jun 22, 2010 at 06:24 AM

    Hi,

    If you are executing Report A then

    Export that internal table to a memory id and in the Report B import that internal table from the specified memory id.

    So by doing like this you can get that internal table values of A in to B.

    Hope you are familir with the Export and Import synatx. Other just do the F1 on this.

    Other just have a look on the below coding.

    This is in Report A.

    data : itab type table of ekko,

    itab1 type table of ekko.

    itab1 = itab.

    Export itab to itab1 memory id ' Report A'.

    In Report B.

    Data itab type table of Ekko.

    Import Itab1 to itab from memory id ' Report A'.

    With Regards,

    Sumodh.P

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sumodh,

      Thanks for your reply.

      Actually Report A is a Standard Report which we dont have any export ..import statements in it.

      So I have tried using Submit report exporting list to memory in Report B(which is a custom report) and then using FM 'LIST_FROM_MEMORY' .

      Thanks in advance,

      Gowri

  • avatar image
    Former Member
    Jun 22, 2010 at 06:44 AM

    Hi Friend

    Use Below code.

    SUBMIT (p_prog)

    WITH p_rbukrs EQ t_email_add-bukrs

    WITH p_budat EQ s_budat-low

    WITH s_tpsif2-low EQ t_email_add-zztpsif2

    WITH s_conso IN s_conso

    WITH s_altkt IN s_rzza

    TO SAP-SPOOL

    SPOOL PARAMETERS s_pri_params

    WITHOUT SPOOL DYNPRO

    AND RETURN.

    Thanks

    Regards

    I.Muthukumar.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Muthu,

      Thanks for your reply.

      Can you please elaborate..

      I dont have much idea on sap-spool.

      where can we get the data in the internal table of custom report B , if we use the code given by u.

      Thanks in advance,

      Gowri