Application Development 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: 

The Problem is about Standard Back Button Function in the Report Program.

xing_bin
Explorer
0 Kudos

The Problem is about Standard Back Button Function in the Report Program.

In the Report,First call screen Then Using "write" output some information,That is ok. but In the GUI When I press back button that is standard button,it exit screen to program.

My question is how can i do When i press back button,the screen can be back forward first screen instand of exit screen to program. Thanks .

13 REPLIES 13

Former Member
0 Kudos

Hi,

Try to capture the sy-ucom of BACK button. Example:


case sy-ucomm.
when 'BACK'. "your back button command
   LEAVE TO SCREEN 0.
endcase.

Please check.

Rgds,

0 Kudos

hi Thien M. Pham

I have tried it accord to your method,but can not. because the report can not catch sy-ucomm or excute any code about the report insanding of forward to the code of system when I press back button. so I think how to forward to my report when I press back button,whereas I used "At user-Command",but I can not ,so please answer my question ,Thank you!

0 Kudos

Hi,

How do you define your status? and did you assign Function code for your "BACK" button?

Thanks,

0 Kudos

how to define status in the report? I define status using set pf-status in the report,but it does not seem to effect.In my status,I set back botton BACK.

0 Kudos

Hi,

I think BACK is system command and it will not trigger AT USER-CoMMAND. Try to put another Function code for BACK button in your status. And check name of your status (does it contain "_" character? if yes, it won't work).

Please check.

Thanks

0 Kudos

I have tried this method,but using this method except function code "BACK" document said.

0 Kudos

So, please enter debug mode and check sy-ucomm when you click on BACK button.

regards,

0 Kudos

Hi Jokey,

You cannot write your own code for handling the back button in the report program...

You said u first call a screen and then do the write statement...If that is right then correct approach would have been to create a module pool program and include the screen in there...

At the point wherein you want to display the list, use the statement LEAVE TO LIST PROCESSING AND RETURN TO SCREEN 0. This way the list would be processed and on back button you can come back to the screen that called it...

Pleae refer to the ABAP HELP for more details...

Regards,

Sitakant

Edited by: Sitakant Tripathy on Sep 15, 2010 11:09 AM

0 Kudos

This problem is program can not go back my report instand of forward to system code,when I debug.so even I have sy-ucomm,I can write code accoding to sy-comm in my report,when I press button, the program can not goto my report excuting than code,Using "at user-comand" except "BACK" function code document said.can you tell me How?

Former Member
0 Kudos

The issue is vague.

What is the standard back button you're referring to? I mean please detailed out how you run everything. i.e. Did you start by running your report program then from there, it calls a standard transaction.

'Coz if it only calls a standard transaction, normally when back button is hit, it will go back to your report program screen.

If you're calling another screen (call screen), you just do it the PAI of that screen.In debugging mode, get what's the sy-ucomm of that BACK button, then start your coding in the PAI (LEAVE TO SCREEN 0 - this will go back to your previous screen). Elaborate more your issue if this still didn't help at all.

Former Member
0 Kudos

Hi,

First, is this a custom screen or from an ALV list? If from a custom screen, then the following might apply...

In your GUI status, did you define the function associated with the button with the Function Type Exit (E) ?

If so, pressing the button will trigger the MODULE mmm AT EXIT-COMMAND.

Regards, Andy

Former Member
0 Kudos

Hi,

You can define your own PF-STATUS and in that assign the function code for BACK button anything except 'BACK'.

The code would somewhat look like this:

SET PF-STATUS 'TEST'.

write : itab-col1,

itab-col2.

in the PF-STATUS 'TEST', assign the function code to BACK button as 'BCK'.

Now in your program you can use the event AT USER-COMMAND.

In this you can handle the functionality of BACK button.

Hope this helps.

Regards,

Himanshu

0 Kudos

ok, thank you