Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Selection-screen

Former Member
0 Kudos

Hi,

In selection screen, i want to validate user-inputs for select-option field.

i tried with 'at selection-screen',

guide me on this

9 REPLIES 9

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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'.

Former Member
0 Kudos

hi

u can use AT selection screenon Value-request for <field>.

Reward point if helpful.

Naveen

Simha_
Employee
Employee
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Use the event AT-SELECTION SCREEN ON S_XXX

Here you can validate what ever you want.

Regs,

Venkat Ramanan

Former Member
0 Kudos

at selection-screen Value Request is for F4 Help.

so use at selection-screen on S_EXGEM.