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

function module reuse_alv_grid_display with multiple calls

Former Member
0 Likes
1,035

Hi!

For some reasons i've used the old function module reuse_alv_grid_display in a large report.

I'm calling it few times for list outputs, few times for a protocol ...

But when i click on the back button (the one near cancel and exit) i have to walk through all previous list outputs.

What i want is to go immediately to the starting selection screen.

This should have to do with the list index (or similar)...

How can i avoid that previous lists stay in buffer when i call the alv-module again?

Thanks in advance for your help.

Cheers, Ingo

1 ACCEPTED SOLUTION
Read only

former_member491621
Contributor
0 Likes
757

Hi Ingo,

You could use the function code of the back button in your program

CASE sy-ucomm.

     WHEN 'BACK'.

          LEAVE LIST-PROCESSING.

     WHEN OTHERS.

          ....other processing.

ENDCASE.

Hope this helps

4 REPLIES 4
Read only

former_member491621
Contributor
0 Likes
758

Hi Ingo,

You could use the function code of the back button in your program

CASE sy-ucomm.

     WHEN 'BACK'.

          LEAVE LIST-PROCESSING.

     WHEN OTHERS.

          ....other processing.

ENDCASE.

Hope this helps

Read only

0 Likes
757

Hi Aniket!

Thanks for your answer.

I've tried already leave to screen ...

but this doesn't work 'cause i'm using a three tabbed selection screen with three subscreens.

So my current code uses leave program but this isn't very comfortable 😉

I'll try your suggestion on Monday (now it's Saturday) and let you know.

Thanks.

Cheers, Ingo

Read only

RaymondGiuseppi
Active Contributor
0 Likes
757

As your are using full screen ALV FM, let those manage the screen, in the user_command parameter there is a field to exit the FM, so back to previous screen, set it when managing "back" events. (Just read documentation of FM and the thousands of thread on the subject, RS_SELFIELD-EXIT = 'X'.) So when control will get back to your form, e.g. when clicking BACK on another call of th FM, the current ALV will close, leave to previous screen.

Regards,

Raymond

Read only

0 Likes
757

Hi!

Nothing of the suggested solutions works.

I think this has to do with the three tabbed subscreens i'm using.

I've found something that works:

At start of selection i'm using

function module RS_REFRESH_FROM_SELECTOPTIONS to save the inserted data.

If sy-ucomm is '&F03' i'm using

submit my current program with selection-table 'the saved data'

via selection-screen.

Not highend coding but it works 😉

Thanks all for the ideas regarding this case.

Cheers, Ingo