‎2008 Nov 04 10:28 AM
Hi,
I need to quit a screen with a red button OK_CODE = EXIT, but SAP give me a message : we have to fill obligatory fields.
my purpose is to leave the screen without fill in the obligatory fields.
Best regard
‎2008 Nov 04 10:48 AM
Hi saad,
If you do have obligatory fields on your screen and you have not defined your exit procedure in moduel with addition at exit-command, you'll have to enter values into the obligatory fields before exiting. The only way around is to define the module where you have the code for exiting the screen with addition at exit command. In the PAI section define as follows,
Process After Input.
Module <modulename> at exit-command.
and inside the module write
if ok_code = 'EXIT'.
leave program
endif.
Here if you click on the button whose fcode is EXIT, it will bypass and validations as it is defined under at exit-command.
Hope this helps in resolving your issue.
Regards,
Sachin
‎2008 Nov 04 10:30 AM
You need to change the Function Type of the EXIT button to 'E'
The screen where you maintain the GUI status, go there and double click on FCODE for EXIT, it will open "Function attribute" window.Set Function Type = "E"
In the screen flow logic, add a new Module called"EXIT"
MODULE EXIT AT EXIT-COMMAND.
Inside that module write
LEAVE PROGRAM.
Edited by: Swastik Bharati on Nov 4, 2008 11:31 AM
Edited by: Swastik Bharati on Nov 4, 2008 11:33 AM
‎2008 Nov 04 10:31 AM
Create module using AT EXIT-COMMAND in PAI. Write your code for EXIT into this module.
Search more on AT EXIT-COMMAND to get the examples on it.
Regards,
Vikas
‎2008 Nov 04 10:46 AM
Hello,
As said by Swastik in his reply in this thread earlier you need to specify the Function code as 'E' and then in PBI event you can write the code at 'at exit-commant'.
- Jayant Sahu.
‎2008 Nov 04 10:48 AM
Hi saad,
If you do have obligatory fields on your screen and you have not defined your exit procedure in moduel with addition at exit-command, you'll have to enter values into the obligatory fields before exiting. The only way around is to define the module where you have the code for exiting the screen with addition at exit command. In the PAI section define as follows,
Process After Input.
Module <modulename> at exit-command.
and inside the module write
if ok_code = 'EXIT'.
leave program
endif.
Here if you click on the button whose fcode is EXIT, it will bypass and validations as it is defined under at exit-command.
Hope this helps in resolving your issue.
Regards,
Sachin