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

Calling a report program in another program.

Former Member
0 Likes
1,279

can we call on report program in another report program. If yes, please give me the right syntax. Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
813

Hi,

Use SUBMIT AND RETURN statement. In below given codes,

I'm sending an internal table t_spfli to a memory id abc. After that I'm calling another program by using SUBMIT <program name> AND RETURN.

Check these two programs

PROGRAM 1


REPORT  z_abap_memory.
DATA:
  w_carrid TYPE spfli-carrid,
  BEGIN OF fs_spfli,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
    fltime LIKE spfli-fltime,
  END OF fs_spfli.
DATA:
  t_spfli LIKE
    TABLE OF
          fs_spfli.
 
SELECT-OPTIONS:
  s_carrid FOR w_carrid.
 
START-OF-SELECTION.
  PERFORM get_spfli.
  PERFORM disp_spfli.
AT LINE-SELECTION.
  IF sy-lsind EQ 1.
    EXPORT t_spfli TO MEMORY ID 'ABC'.
    SUBMIT z_ABAP_MEMORY1 AND RETURN.
  ENDIF.
END-OF-SELECTION.
  PERFORM disp_spfli.
*&---------------------------------------------------------------------*
*&      Form  get_spfli
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_spfli .
  SELECT carrid
         connid
         fltime
    FROM spfli
    INTO TABLE t_spfli
   WHERE carrid IN s_carrid.
 
ENDFORM.                    " get_spfli
*&---------------------------------------------------------------------
*
*&      Form  disp_spfli
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------
*
FORM disp_spfli .
  LOOP AT t_spfli INTO fs_spfli.
    WRITE: / fs_spfli-carrid,
             fs_spfli-connid,
             fs_spfli-fltime.
         HIDE:
    fs_spfli-carrid,
    fs_spfli-connid.
  ENDLOOP.
 
ENDFORM.                    " disp_spfli

PROGRAM 2


REPORT  z_abap_memory1.
 
DATA:
  BEGIN OF fs_spfli,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
    fltime LIKE spfli-fltime,
  END OF fs_spfli,
  fs_fl LIKE fs_spfli.
DATA:
  BEGIN OF fs_flight,
    carrid LIKE sflight-carrid,
    connid LIKE sflight-connid,
    fldate LIKE sflight-fldate,
  END OF fs_flight.
 
DATA:
  t_spfli LIKE
    TABLE OF
          fs_spfli.
 
DATA:
  t_fl LIKE t_spfli.
 
DATA:
  t_flight LIKE
     TABLE OF
           fs_flight.
 
IMPORT t_spfli FROM MEMORY ID 'ABC'.
t_fl = t_spfli.
 
SELECT carrid
       connid
       fldate
  FROM sflight
  INTO TABLE t_flight
  FOR ALL ENTRIES IN t_spfli
 WHERE carrid = t_spfli-carrid
   AND connid = t_spfli-connid.
 
 
LOOP AT t_flight INTO fs_flight.
  WRITE: / fs_flight-carrid,
           fs_flight-connid,
           fs_flight-fldate.
ENDLOOP.

Regards

Abhijeet

8 REPLIES 8
Read only

Former Member
0 Likes
813

search the forum

You can use submit statement

Read only

Former Member
0 Likes
813

Hi !

ya you can call.

syntax is : SUBMIT <report name>.

Thanks & Regards,

Nisa.

Read only

Former Member
0 Likes
813

Hi,

Use submit statement.

SUBMIT {rep|(name)} [selscreen_options]

[ list_options ]

[ job_options]

[AND RETURN].

Hope it helps you.

Regards

Manjari.

Read only

Former Member
0 Likes
813

SUBMIT zreport_name AND RETURN.

Read only

Former Member
0 Likes
813

Hi Harsha,

You can call one report in another report using submit statement.

Please find the syntax below.

SUBMIT {rep|(name)} [selscreen_options]

[list_options]

[job_options]

[AND RETURN].

Please use the following links which shows examples (step by step) for reference.

http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba50d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba50035c111d1829f0000e829fbfe/content.htm

Thanks,

Naveen Kumar.

Read only

Former Member
0 Likes
814

Hi,

Use SUBMIT AND RETURN statement. In below given codes,

I'm sending an internal table t_spfli to a memory id abc. After that I'm calling another program by using SUBMIT <program name> AND RETURN.

Check these two programs

PROGRAM 1


REPORT  z_abap_memory.
DATA:
  w_carrid TYPE spfli-carrid,
  BEGIN OF fs_spfli,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
    fltime LIKE spfli-fltime,
  END OF fs_spfli.
DATA:
  t_spfli LIKE
    TABLE OF
          fs_spfli.
 
SELECT-OPTIONS:
  s_carrid FOR w_carrid.
 
START-OF-SELECTION.
  PERFORM get_spfli.
  PERFORM disp_spfli.
AT LINE-SELECTION.
  IF sy-lsind EQ 1.
    EXPORT t_spfli TO MEMORY ID 'ABC'.
    SUBMIT z_ABAP_MEMORY1 AND RETURN.
  ENDIF.
END-OF-SELECTION.
  PERFORM disp_spfli.
*&---------------------------------------------------------------------*
*&      Form  get_spfli
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_spfli .
  SELECT carrid
         connid
         fltime
    FROM spfli
    INTO TABLE t_spfli
   WHERE carrid IN s_carrid.
 
ENDFORM.                    " get_spfli
*&---------------------------------------------------------------------
*
*&      Form  disp_spfli
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------
*
FORM disp_spfli .
  LOOP AT t_spfli INTO fs_spfli.
    WRITE: / fs_spfli-carrid,
             fs_spfli-connid,
             fs_spfli-fltime.
         HIDE:
    fs_spfli-carrid,
    fs_spfli-connid.
  ENDLOOP.
 
ENDFORM.                    " disp_spfli

PROGRAM 2


REPORT  z_abap_memory1.
 
DATA:
  BEGIN OF fs_spfli,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
    fltime LIKE spfli-fltime,
  END OF fs_spfli,
  fs_fl LIKE fs_spfli.
DATA:
  BEGIN OF fs_flight,
    carrid LIKE sflight-carrid,
    connid LIKE sflight-connid,
    fldate LIKE sflight-fldate,
  END OF fs_flight.
 
DATA:
  t_spfli LIKE
    TABLE OF
          fs_spfli.
 
DATA:
  t_fl LIKE t_spfli.
 
DATA:
  t_flight LIKE
     TABLE OF
           fs_flight.
 
IMPORT t_spfli FROM MEMORY ID 'ABC'.
t_fl = t_spfli.
 
SELECT carrid
       connid
       fldate
  FROM sflight
  INTO TABLE t_flight
  FOR ALL ENTRIES IN t_spfli
 WHERE carrid = t_spfli-carrid
   AND connid = t_spfli-connid.
 
 
LOOP AT t_flight INTO fs_flight.
  WRITE: / fs_flight-carrid,
           fs_flight-connid,
           fs_flight-fldate.
ENDLOOP.

Regards

Abhijeet

Read only

Former Member
0 Likes
813

Hi !

ya you can call.

syntax is : SUBMIT <report name>.

Thanks & Regards,

Nisa.

Read only

0 Likes
813

THANKS