‎2007 Oct 01 10:16 AM
Hi,
In one screen(designed using screen painter) I am giving some mandatory fields. I am not entering values on those fields and if I try to do back button it is not going but it is displaying the message like enter mandatory fields I dont want like that so please help me how to activate exit and cancel buttons I mean how to write the logic for this. And one more doubt is in one screen I am giving order number and I am displaying message if order number is not exist like order is not exist it is displaying the message but I want to clear the order number entered on the screen at the time of displaying the error message itself. Please tell me the logic and where I can insert that logic. Please help me. I will give the points.
Thanks a lot.
‎2007 Oct 01 10:19 AM
Hi,
Open the Screen in Screen Painter & goto field Attributes.
Instead of MANDATORY, change it to REQUIRED.
Activate the screen
& run the program.
Best regards,
Prashant
‎2007 Oct 01 10:19 AM
Hi,
for clearing the Order number please clear the Order number after you are validating it.... i.e. before displaying the error message.
Thanks and Regards,
Jayant Sahu
‎2007 Oct 01 10:20 AM
Change the button type to 'E'
On-exit command...so that validation checks will not be applicable for those buttons.
Regards
Vasu
‎2007 Oct 01 10:22 AM
hi babji.
after displaying message u just clear the field , using clear statement .
use LEAVE PROGRAM to leave the screen.
regards
prajwal.k
‎2007 Oct 01 10:27 AM
hi,
For activating the back and cancel button, without entering any mandatory values, you will have to add <b>at exit command</b> FM.
The module with the addition AT EXIT-COMMAND is processed before the automatic field input checks.
You can use it for navigation. You may only use the AT EXIT-COMMAND addition with one module for
each screen. It may not have an associated FIELD statement.
For clearing the order number, clear the contents before u display the message, u will will be having the if condition to check the order number, add the code in if condition in the PAI.
<b>Hope this is helpful, Do reward.</b>
Message was edited by:
Runal Singh
‎2007 Oct 01 10:35 AM
hi,
for ur first condition. to come out of screen without giving mandatory fields use AT USER-COMMAND event as
in flow logic create a new module as
module exittt -> double click on it.
in pai.
AT USER-COMMAND ON MODULE EXIT.
leave to list-processing .
or ur logic here.
2. to clear the field before displaying error message to user as
before writing error message use
EX:
CLEAR P_MATNR.
MESSAGE E000 WITH 'ENTER MATERIAL NO'.
i think u wrote ur validation in AT SELECTION SCREEN EVENT.
as for ex to display error message if p_matnr field value is not correct
AT SELECTION SCREEN
select single * from mara where matnr in p_matnr.
CLEAR P_MATNR. /// WRITE CLEAR STATEMENT HERE.
if sy-subrc ne 0.
message E000 with ' GIVE CORRECT VALUE'.
ENDIF.
if helpful reward some points.
with regards,
Suresh Aluri.
‎2007 Oct 01 10:38 AM
hi,
if u want to do that when user press BACK button and mendatory fields are not filled than also it should go back than give <b>'E' function type</b> of that BACK button.
now make one module in PAI.
PROCESS AFTER INPUT.
<b>MODULE exit_0100 AT EXIT-COMMAND</b>.
and in module write like this,
<b>MODULE exit_0100 INPUT.</b>
LEAVE PROGRAM.
<b>ENDMODULE. " exit_0100 INPUT</b>
reward if useful.