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

Attach a report program in to Module Pool screen

anuradha_wijesinghe
Participant
0 Likes
4,512

Hi all,

     I have dialog Program (Module pool) and now i need to Execute a report program with button click (it may on another screen). Can someone help me to do this and explain how to do it.

When I click a button it should go for Selection screen and need to run the report . \

thanks 

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,997

U can use CALL TRANSACTION or SUBMIT

SUBMIT < PROGRAM NAME > VAI SELECTION-SCREEN AND RETURN.

OR

CALL TRANSACTION '<TRANSACTION CODE OF REPORT PROGRAM>'

9 REPLIES 9
Read only

Former Member
0 Likes
2,998

U can use CALL TRANSACTION or SUBMIT

SUBMIT < PROGRAM NAME > VAI SELECTION-SCREEN AND RETURN.

OR

CALL TRANSACTION '<TRANSACTION CODE OF REPORT PROGRAM>'

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,997

use submit statement..read help

Read only

Former Member
0 Likes
2,997

Use the 'Submit Program' command in the  module pool user-command.

SUBMIT {rep|(name)} [selscreen_options]

                    [list_options]

                    [job_options]

                    [AND RETURN].

If the program needs to return to the module pool after 'Back' action of the report , use the 'And return' addition in the syntax.

If the program needs to stop at the selection screen ,use the 'VIA SELECTION-SCREEN' addition,otherwise pass the details that the selection screen needs using the option 'WITH SELECTION-TABLE'.

Check the syntax for 'Submit' keyword

Read only

former_member196157
Active Participant
0 Likes
2,997

hiii,

use "Submit" statement..............

Read only

vladimir_erakovic
Contributor
0 Likes
2,997

Hi Anuradha,

In User Command PAI module of your dialog screen:

CASE ok_code.

     WHEN 'REPORT'.

       CALL TRANSACTION 'ZRNREP'.

ENDCASE.

That's the easiest way.

Regards,

Vladimir

Read only

former_member209120
Active Contributor
0 Likes
2,997

Hi

Simple try like this

REPORT  yram_52.

CALL SCREEN 9000.
*&---------------------------------------------------------------------*
*&      Module  STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
   SET PF-STATUS 'PF_9000'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.

   CASE sy-ucomm.

   when 'REPORT'.

    CALL TRANSACTION 'MB5B'.

   When 'EXIT'.

   Leave TO SCREEN 0.

   endcase.

   ENDMODULE.                 " USER_COMMAND_9000  INPUT

Output

Read only

sivaganesh_krishnan
Contributor
0 Likes
2,997

HI Anuradha,

First create a button in the screen and also assign the FCODE in the screen layout  . then in the PAI event of the screen , check for the ok_code is equal to FCODE.

IF FCODE EQ ok_code.

SUBMIT reportname AND RETURN.

endif.

On clicking the button , the report program gets called and on clicking back if comes to the current program.

Regards,

Sivaganesh

Read only

0 Likes
2,997

Dear Siva,

     Very thanks for ur reply.

     is that reportname is the program name. ( Ex : zstock (this a stock report of ours) ) ??????

Read only

0 Likes
2,997

yes Anuradha Wijesinghe.

If you want to stop at selection screen then write VIA SELECTION SCREEN with the submit statement.