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

Back button working in oops ALV

Former Member
0 Likes
4,796


Hi Experts,

We are using cl_salv_table=>factory( ) for diaplaying alv report and post data to sap.

On the first screen, we have some buttons like post data, simulate posting, refresh all.Requirement is once we post the data and refresh and press on back button, the initial selection screen should be displayed. But its not happening so, on pressing back button the same screen, the previous alv screens get diplayed and to actually see the sel screen we have to press it several times. please help me resolve this issue.

Thanks and regards,

Amith

1 ACCEPTED SOLUTION
Read only

asim_isik
Active Participant
0 Likes
2,736

Hi ,

use  cl_gui_alv_grid


Hi Experts,

We are using cl_salv_table=>factory( ) for diaplaying alv report and post data to sap.

On the first screen, we have some buttons like post data, simulate posting, refresh all.Requirement is once we post the data and refresh and press on back button, the initial selection screen should be displayed. But its not happening so, on pressing back button the same screen, the previous alv screens get diplayed and to actually see the sel screen we have to press it several times. please help me resolve this issue.

Thanks and regards,

Amith

10 REPLIES 10
Read only

asim_isik
Active Participant
0 Likes
2,737

Hi ,

use  cl_gui_alv_grid

Read only

Former Member
0 Likes
2,736

@ Asim

Given issue is not a strong enough reason to switch from SALV to cl_gui_alv_grid.

@ Amith:

Run demo program SALV_DEMO_TABLE_SIMPLE and choose radio button "Output as Grid" and Execute.

Back button is able to navigate back to selection screen because of the way user command is handled in PAI block of screen. Observe this in debug and then implement same thing in your program.

Since you are pressing back several times, it is possible then instead of refreshing existing ALV, program is calling new ALV from PAI block on every refresh.

Read only

former_member202818
Active Contributor
0 Likes
2,736

Hi Amith,

I did't get the exact requirement. As of my understand, can you solve this using LEAVE LIST-PROCESSING?

     I think you are calling a screen from ALV user command,

Write LEAVE LIST-PROCESSING after CALL OR SUMBIT staement.

Regards

Sreekanth

Read only

vamsilakshman_pendurti
Active Participant
0 Likes
2,736

Hi Amith ,

At the time of click on Back button it should be call previous screen i.e,

Selection screen...

Then try this code For  the Back button....


write this code in Back Button..............

IF sy-ucomm = 'BACK'.

leave to screen 0.


Means it calls previous screen.....


Hope you understand.

vamsilakshman.p

Read only

Former Member
0 Likes
2,736

Hi,

Implement subroutine for User Command and put the following code in it :

CASE SY-UCOMM.

     WHEN 'BACK'.      "or whatever the fct code is for back button

          LEAVE TO TRANSACTION SY-TCODE.

ENDCASE.

Regards,

Ashish

Read only

Former Member
0 Likes
2,736

Hi,

     Check Whether your PF-STATUS  and CODE ASSOCIATED with it is activated.

Regards

Read only

venuarun
Active Participant
0 Likes
2,736

Hi Amith,

Also check your Pf Status is activated or not ..

In PAI

When 'Back'

Leave to screen 0.

Regards

Arun VS

Read only

Former Member
0 Likes
2,736

To all who are suggesting "Leave to screen 0".

Please don't forget Screen number 0 is used for previous screen and which is already happening in his report. His requirement is to go to the first screen not the previous.

Thanks.

Read only

venuarun
Active Participant
0 Likes
2,736

Hi amith

IN PAI

WHEN 'EXIT' OR 'BACK' OR 'CANC'.

*Destructor

       CALL METHOD go_custom_container->free.

         Leave to screen 0.


Regards

Arun VS

Read only

Former Member
0 Likes
2,736

Thank you everyone for Valuable inputs.

Best regards,

Amith