‎2005 Nov 21 5:33 PM
Hi,
I have defined a function with a screen.
To refresh the screen contents, I call the same function again, as shown below:
CALL function 'Z_SIMS_TEST'
exporting
ID_LIST = GID_LIST.
LEAVE PROGRAM.
What it does is exit the function, and the program that called it in the first place, is there away for it to just exit the function and go back to the program that called it? I still need the function to tidy itself up, and not cause any memory leaks.
Thanks
‎2005 Nov 21 5:36 PM
‎2005 Nov 21 5:43 PM
‎2005 Nov 21 5:45 PM
Here is what I mean...... Say you have this function module....
FUNCTION Z_TEST.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(SUBRC) TYPE SY-SUBRC
*" EXCEPTIONS
*" AN_EXCEPTION
*"----------------------------------------------------------------------
Write:/ 'Im in the function module'.
if subrc = 0.
Write:/
'Im inside the check and need to come out of the function module'.
* You can use the exit statement here to exit the
* funciton module, if your check is in the mainline.
exit.
* Or you can raise an exception which will also make
* the processing of the funcion module end.
Raise an_exception.
endif.
write:/ 'Im still in the function module after the check'.
ENDFUNCTION.
Here is the call to the example function module.
* Calling this way, will turn the check on and
* make the function module end.
call function 'Z_TEST'
exporting
subrc = '0'
exceptions
an_exception = 1
others = 2.
Regards,
Rich Heilman
‎2005 Nov 21 5:47 PM
‎2005 Nov 21 5:48 PM