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

Screen navigation

jepi_flanders
Participant
0 Likes
2,651

Dear Experts,

I'm new to Abap and have a question concerning screen navigation: in my program I have a selection screen 0100 (created with SELECTION-SCREEN BEGIN OF SCREEN 100...., and called with CALL SELECTION-SCREEN 100) then, when pressing Execute (F8) the logics works and present the result via WRITE statements.

Up to here, no problems.

Now I would like that, when I press 'Back' (F3), I'm returning to the selection screen, for new selections. Instead, if I press 'Back' I'm going really back to the SE38 transaction, for instance, and then I need to run the program again to have a new selection.

This is maybe a basic question, but I already searched on the internet without success, and I'm really frustrated not being able to find a solution to this.

Hope you can help me.

Best regards,

Jepi

10 REPLIES 10
Read only

Former Member
0 Likes
1,728

Hi,

Check this

Read only

Former Member
0 Likes
1,728

Now I would like that, when I press 'Back' (F3), I'm returning to the selection screen, for new selections. Instead, if I press 'Back' I'm going really back to the SE38 transaction, for instance, and then I need to run the program again to have a new selection.

This is maybe a basic question, but I already searched on the internet without success, and I'm really frustrated not being able to find a solution to this.

In your PF status for 'BACK' do


case sy-ucomm.
when 'back'.
   leave to screen 0.

Read only

Former Member
0 Likes
1,728

Hi,

Create a module with AT-EXIT COMMAND.


CASE SY-UCOMM.
  WHEN 'BACK'.
    LEAVE TO SCREEN 100.
ENDCASE.

Regards,

Danish.

Read only

0 Likes
1,728

Dear all,

Thank you for replying.

@ Danish: Could you please tell me where shall I create the module?

Do I have to create a new screen, say 200, and there write the result from the program, and in its flow logic add the module with AT-EXIT COMMAND?

Thanks again.

JF

Read only

Former Member
0 Likes
1,728

Hi,

By writing "leave to screen 0100." will help you solve this problem.

Hope this helps.

Regrads,

Gaurav.

Read only

Former Member
0 Likes
1,728

Well since it is an executable program i guess you cannot use GUI statuses or Exit module. Well normally if you hit the back button it should return to the program. may be some small logic error in your program if you can post your program here we could check.

Read only

Former Member
0 Likes
1,728

Hi ,

in same screen write module like below

PROCESS AFTER INPUT.

MODULE BACK AT EXIT-COMMAND.

in include program.

module back.

CASE SY-UCOMM.

WHEN u2018BACKu2019.

LEAVE TO SCREEN 100.

ENDCASE.

Read only

0 Likes
1,728

Hi Kalyan,

Thank you for answering.

In reality, the screen 100 flow logic is automatically created and has already a MODULE %_BACK AT EXIT-COMMAND.

Maybe, have I to create a new screen, say 200, and there put my new flow logic?

Thanks again

JF

Read only

0 Likes
1,728

Hi,

I think you no need to create another screen.

You can clear the field as you click on BACK button after displaying your results, is that ok for you?



      WHEN 'BACK'.
        LEAVE TO  SCREEN 100.
        cx_input  = ''. " if a checkbox is there
        CLEAR i_input." clear input field as i_input is input field for you

Ben

Read only

0 Likes
1,728

For Selection Screen you need not call screen as 100 and all( default screen 1000 is present ) , We can use it by declaring parameters , select-options etc directly .If u have to manipulate Selection screen then u can use Selection Screen EVENTS for more screen navigation and calculations.

If you are using multiple selection screens then set navigation using event

At selection-screen output.

set pf-status '100'. "Set fcode for back button as 'BACK'.

at selection-screen

CASE sscrfields-ucomm.

WHEN 'BACK'.

LEAVE PROGRAM.

Edited by: Jacob K. George on Mar 2, 2012 11:25 AM