‎2006 Jul 18 1:01 PM
Hi,
In selection screen, i want to validate user-inputs for select-option field.
i tried with 'at selection-screen',
guide me on this
‎2006 Jul 18 1:05 PM
Hello Rajesh,
Use this code.
at selection screen on s_matnr-low.
if not s_matnr-low initial.
select single * from mara into lv_mara where matnr = s_matnr-low.
if sy-subrc NE 0.
error message.
endif.
at selection screen on s_matnr-high.
if not s_matnr-high initial.
select single * from mara into lv_mara where matnr = s_matnr-high.
if sy-subrc NE 0.
error message.
endif.
Hope this will be helpful for u.
Reward points.
Vasanth
‎2006 Jul 18 1:06 PM
Hi rajesh,
1. For such things, we have to follow this logic.
2.
START-OF-SELECTION.
If Wrong Condition.
<b> Message 'Please enter' type 'I'.
LEAVE LIST-PROCESSING.</b>
Endif.
WRITE 😕 'Success'.
3. Important Points.
a) use Messsage type I (and not E)
b) then use the command LEAVE LIST-PROCESSING.
(this will go back to the selection-screen)
regards,
amit m.
‎2006 Jul 18 1:21 PM
hi amit,
Its not working,
1) I have select option field named - 's_name'.
2) It can be initial(means retrieves all the names from Dtab), or can be 'abc' alone , or can be 'stu' alone , or can be 'uvy' alone, or all the 3 values in multiple options.
Apart from these inputs it should throw error, saying
'enter correct name'.
‎2006 Jul 18 1:07 PM
hi
u can use AT selection screenon Value-request for <field>.
Reward point if helpful.
Naveen
‎2006 Jul 18 1:08 PM
Hi,
Use <b>At selection-screen event.</b>
Then inside that event u can write ur validations.
what ever may be.
U can directly validate them on ur select-options field.
U can write select queries and even subroutines in this vent.
Hope it helps..
Cheers,
Simha.
‎2006 Jul 18 1:08 PM
Hi
To create possible values help for input fields that have no Dictionary reference, or to override the help normally linked to the field, you can create an event block for the event
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
For example
REPORT SELECTION_SCREEN_F4_DEMO.
PARAMETERS: P_CARR_1 TYPE SPFLI-CARRID,
P_CARR_2 TYPE SPFLI-CARRID.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CARR_2.
CALL SCREEN 100 STARTING AT 10 5
ENDING AT 50 10.
MODULE VALUE_LIST OUTPUT.
SUPPRESS DIALOG.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS SPACE.
NEW-PAGE NO-TITLE.
WRITE 'Star Alliance' COLOR COL_HEADING.
ULINE.
P_CARR_2 = 'AC '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'Air Canada'.
HIDE P_CARR_2.
P_CARR_2 = 'LH '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'Lufthansa'.
HIDE P_CARR_2.
P_CARR_2 = 'SAS'.
WRITE: / P_CARR_2 COLOR COL_KEY, 'SAS'.
HIDE P_CARR_2.
P_CARR_2 = 'THA'.
4 WRITE: / P_CARR_2 COLOR COL_KEY, 'Thai International'.
HIDE P_CARR_2.
P_CARR_2 = 'UA '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'United Airlines'.
HIDE P_CARR_2.
CLEAR P_CARR_2.
ENDMODULE.
AT LINE-SELECTION.
CHECK NOT P_CARR_2 IS INITIAL.
LEAVE TO SCREEN 0.
If helpful reward points.
Regards
Abhishek
‎2006 Jul 18 1:11 PM
Hi Rajesh,
There are some events are triggered when you create a report program 1st Initialization ,than Top Of page ,at selection screen, Start-of-selection, end-of-selection .Reward If useful ans.
Ankur Garg
‎2006 Jul 18 1:12 PM
Hi,
Use the event AT-SELECTION SCREEN ON S_XXX
Here you can validate what ever you want.
Regs,
Venkat Ramanan
‎2006 Jul 18 1:27 PM
at selection-screen Value Request is for F4 Help.
so use at selection-screen on S_EXGEM.