I want it to skip mandatory fields when i clicked on 'İptal' button .
But i don't want to control mandatory fields without "obligatory" . I want to see check mark in textboxes like screenshot.
Normally 'İptal' button calls a different screen when there is no mandatory fields.
Note: Screens are standard selection screens.
the way that I have solved this not to make the fields obligatory in the layout but in your code to create some conditions example I have my input output field called ekpo-ebeln:
this solved my problem,and it works!
You can do the following trick to achieve your requirement.
Prerequisites:
First and the foremost! Do NOT declare your parameters using
OBLIGATORY
clause. This constraint overrides all internal checks and validations during selection screens processing.Here I assume that you use standard GUI status with buttons activated on Application Toolbar. Standard Execute button has standard
ONLI
fcode, whereas İptal hasIPT
.To manipulate target fields we need IDs assigned to them:
Solution details:
Declare AT SELECTION-SCREEN OUTPUT event where fields' attributes would be edited.
Handling function codes in AT SELECTION-SCREEN event.
Explanation: on program start your fields have
required
attribute set to 2, which means they have obligatory tick, but not really acts like obligatory, i.e. that is exactly what you need. You can perfectly press your İptal button and run any other program.However, if you want to enable obligatory constraints you simply press standard Execute and it invokes our selection screen again (
LEAVE TO SCREEN 1000
) but with another fcode (ONLI
) upon whichrequired
attribute is overriden and voila! Going further is impossible until you fill these fields.What you need to do is have a function code assigned to the pushbutton on the screen that has the function type "Exit".
Then you can use the event
AT SELECTION-SCREEN ON EXIT-COMMAND
in your report (I assume you are talking about a report because you talk about selection screens). This event is called by the system before validating the fields on the screen. Here you can implement all your necessary logic.However, the only way I can think how to do that is to copy the standard GUI status
%_00
from programRSSYSTDB
to your program and add your function code and make it a type "exit". Then inAT SELECTION-SCREEN OUTPUT
you can use theSET PF-STATUS
command to override the standard GUI status. (Otherwise if you assign a function code to your pushbutton, but it will not receive special treatment to trigger theON EXIT-COMMAND
event).EDIT: I just tried this and it works, but not when assigning the function code to a pushbutton (using
SELECTION-SCREEN PUSHBUTTON
). Instead, I had to add the function code as a button on the toolbar. Then it triggers theAT SELECTION-SCREEN OUTPUT
event).EDIT 2: (Just copied my comment from below into here because it is important to note) By the way, I had to rename the %_00 GUI status to something else when I copied it. Otherwise, even when specifying the addition FROM PROGRAM in SET PF-STATUS, it would still use the old GUI status from RSSYSTDB.