Skip to Content
0
Former Member
Nov 09, 2011 at 08:20 AM

Exit customized screen

25 Views

Dear gurus,

i have one problem here. I am using the BADI 'ME_PROCESS_REQ_CUST' to perform a checking of PR before save.

When user click 'Save', i will direct them to one customized screen using Function Module which i call screen 100.

In the screen, i have one button 'Cancel' to cancel the transaction. i would like to go back to the PR screen and display an error message 'PR not created'. But when i click on the 'Cancel' button, it calls back to this screen (screen 100) instead of the PR screen. Please guide me.

I have the below code:

In customized function module to call screen

CASE OK_CODE.
WHEN 'CANCEL'.
        EXPORT ok_code TO MEMORY ID 'ANS'.
        LEAVE SCREEN.

IN BADI function module

  CALL FUNCTION 'ZFM_CAPITALISED_Q'.

  IMPORT ok_code TO to_ok_code FROM MEMORY ID 'ANS'.

  IF to_ok_code EQ 'CANCEL'.
    MESSAGE ID 'ZMSG' TYPE 'E' NUMBER '000' WITH 'PR not created'.
  ENDIF.

Thanks,

Starry99