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

pass parameter from fm to subroutine

Former Member
0 Likes
1,308

hi,

how to pass import parameter of function module to "top of page' subroutine wirtten for ALV. both are in same function group.

hi,

how to pass import parameter of function module to "top of page' subroutine wirtten for ALV. both are in same function group.

9 REPLIES 9
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,209

Hello,

Your question is ambiguous. Can you please post the relevant portion of the code & explain what you are trying to achieve ?

BR,

Suhas

Read only

Former Member
0 Likes
1,209

i need to dipspaly the user input in the top-of-page of alv. how to pass this value to the top of page subroutine written. this subroutine is called using events not by any perform top of page...hope u got my problem

Read only

Former Member
0 Likes
1,209

Hello,

As per my understanding the ALV that you are calling is using the FM REUSE_ALV_GRID_DISPLAY. Now it has a parameter I_CALLBACK_TOP_OF_PAGE. Here you pass the name of a subroutine that you define and when the top of page of the ALV is triggered then this subroutine is called.

Now if you have defined a global variable holding the value then in the FORM ... ENDFORM statement for top of page you can use this variable holding the required value. To print the output you'll probably need to call the FM REUSE_ALV_COMMENTARY_WRITE.

Please check

Regards,

Sachin

Read only

Former Member
0 Likes
1,209

the function module is getting import parameter which i need to display in top of page. so , is it like i need to pass this value first to a global value and fetch from there in subroutine?

Read only

Former Member
0 Likes
1,209

Hello,

Yes.... as the subroutine for the top of page does not have any formal parameters so you will have to use a global variable and access it in the subroutine.

Regards,

Sachin

Read only

Former Member
0 Likes
1,209

thanks

Read only

Former Member
0 Likes
1,209

declare them as same variable. (use the same variable that you get from FM to top of page..)

clarify your question for more info..

Read only

Former Member
0 Likes
1,209

Hello,

Do you mean that your program is calling a FM and the FM returns a value and you need to use that value in the subroutine defined for the event top of page in an ALV?

If so then declare a variable of the same type as the returning parameter from the FM and assign the variable that value. Now as it is defined as a global variable use it in the subroutine defined for the top of page for the ALV.

Regards,

Sachin.

Read only

Former Member
0 Likes
1,209

Hi

Kindly Declare your variable in the Global area i.e the TOP include of your Function Group.

Regards

Gaurav