Copyright 2024 - BV TallVision IT

You want to give your end user the option to start a new session: think again. Starting a new session is a standard option on every menu and can even be done with SHIFT-*, so you don't need to do that anywhere else. Or should your new session start a specific transaction ? Here's how:

CALL FUNCTION 'ABAP4_CALL_TRANSACTION' 
  STARTING NEW TASK 'MY_TASK'
    EXPORTING
      tcode         = 'Z_OWN_TCODE'
      skip_screen   = 'X'
    EXCEPTIONS
      OTHERS        = 0.