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

syntax to execute a report from inside a function module?

Former Member
0 Likes
781

Hi,

I am actually a Basis admin so this might be easy for you ABAPers.

I want to modify a function module to execute a report (without any variables or variants) somewhere in the beginning of the function module and then carry on with the rest of the funtion module.

What is the syntax for this?

Thanks!

3 REPLIES 3
Read only

former_member181966
Active Contributor
0 Likes
454

Normally FM is called like

DATA:GWY_GWHOST LIKE GWY_STRUCT-GWHOST,

GWY_GWSERV LIKE GWY_STRUCT-GWSERV.

CALL FUNCTION 'SYSTEM_GET_CURRENT_GATEWAY'

EXPORTING

STARTCOMP = STARTCOMP

IMPORTING

GWHOST = GWHOST

GWSERV = GWSERV.

Read only

Former Member
0 Likes
454

Hi Adriaan,

Use statement <b>SUBMIT</b>.

For example:

<b>SUBMIT REPORT01

VIA SELECTION-SCREEN "this is optional

AND RETURN.</b>

Read only

Former Member
0 Likes
454

Hi Adriaan,

you can call the report , using SUBMIT in your FM.

if you don't have any selection screen then you can directly say SUBMIT ZREPORT and RETURN.

if you have selection screen then fill the selection screen variables and pass it .check this sample..


DATA: SELTAB     TYPE TABLE OF RSPARAMS, 
      SELTAB_WA  LIKE LINE OF SELTAB. 

MOVE: 'LANGU'  TO SELTAB_WA-SELNAME, 
      'S'      TO SELTAB_WA-KIND,      " SELECT-OPTION 
      'I'      TO SELTAB_WA-SIGN, 
      'BT'     TO SELTAB_WA-OPTION, 
      'D'      TO SELTAB_WA-LOW, 
      'I'      TO SELTAB_WA-HIGH. 
APPEND SELTAB_WA TO SELTAB. 

MOVE: 'E'      TO SELTAB_WA-SIGN, 
      'EQ'     TO SELTAB_WA-OPTION, 
      'F'      TO SELTAB_WA-LOW, 
      SPACE    TO SELTAB_WA-HIGH. 
APPEND SELTAB_WA TO SELTAB. 

CLEAR SELTAB_WA. 
MOVE: 'ARBGB' TO SELTAB_WA-SELNAME, 
      'P'     TO SELTAB_WA-KIND,      " PARAMETER 
      'XX'    TO SELTAB_WA-LOW. 
APPEND SELTAB_WA TO SELTAB. 


SUBMIT REPORT00 
       USING SELECTION-SET 'VARIANT1' 
       WITH  ARBGB CP 'A*' 
       WITH  SELECTION-TABLE SELTAB 
       AND RETURN.

Regards

vijay