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

Passing parameters to subroutine

Former Member
0 Likes
662

Hi,

I have a subroutine which is being called from the 2 PAI modules of the different screens.The subroutine has two queries which are the same for both the modules , the only difference I want is that after the queries there is a call to a new screen.I want different screens to be called for both the PAI modules.Please suggest what should I pass to the subroutine so that different screens can be called based on the PAI module.

Hi,

I have a subroutine which is being called from the 2 PAI modules of the different screens.The subroutine has two queries which are the same for both the modules , the only difference I want is that after the queries there is a call to a new screen.I want different screens to be called for both the PAI modules.Please suggest what should I pass to the subroutine so that different screens can be called based on the PAI module.

3 REPLIES 3
Read only

Former Member
0 Likes
605

you can use the following

PERFORM F_CALL using G_SCRN_NUMBER

Regards,

Mansi.

Read only

Former Member
0 Likes
605

Hi Sunil ,

You can use the same subroutine along with the using .

You need to call the same subroutine with different interface parameter.

In the interface parameter you need to specify the screen no (For example).

Check the code as a example --

perform screen using '100'.
perform screen using '101'.


*&---------------------------------------------------------------------*
*&      Form  SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0006   text
*----------------------------------------------------------------------*
form SCREEN  using    value(p_scrno).
call screen p_scrno.
endform.                    " SCREEN

Regards

Pinaki

Read only

Former Member
0 Likes
605

Hi,

For your requirement you must get the Current screen number. Current screen number always in Sy-DYNNR. Use this field as input you can get the required functionality.