Application Development and Automation 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: 
Read only

selection screen validation

Former Member
0 Likes
1,084

Hi Experts,

I want validate selection screen fields. when user enter values that valuesl validate.

can u tell how can validate that , my selection screen fields are like this

s_objid for hrp1001-objid

s_objik for hrp1001-objid.

1 ACCEPTED SOLUTION
Read only

awin_prabhu
Active Contributor
0 Likes
1,049

Hi friend,

Use like below:

AT SELECTION-SCREEN ON s_objid..

SELECT SINGLE * FROM hrp1001 WHERE objid IN s_objid.

IF sy-subrc <> 0.

MESSAGE e002(00). <--- Error Message

ENDIF.

Hope this helps.

Thanks..

8 REPLIES 8
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,049

Hi,

Use event AT SELECTION-SCREEN to validate the screen field and show appropiate message to user.

Regards,

Tarun

Read only

Former Member
0 Likes
1,049

Hi,

Use atselection output on field.

Read only

former_member242255
Active Contributor
0 Likes
1,049

under the at-selection screen event,

you have to write the code for the checking of the values from the corresponding master tables..

Read only

0 Likes
1,049

hi ,

I know that write the code in at selection screen. but how i can validate can u send code.

thanks

Read only

Former Member
0 Likes
1,049

Hi Srinu


DATA gv_objid TYPE hrp1001-objid.
AT SELECTION SCREEN.

SELECT SINGLE objid FROM PLOGI INTO gv_objid WHERE OBJID IN s_objid.
IF sy-subrc NE 0.

*error

ENDIF.

*similar for s_objik

Pushpraj

Read only

awin_prabhu
Active Contributor
0 Likes
1,050

Hi friend,

Use like below:

AT SELECTION-SCREEN ON s_objid..

SELECT SINGLE * FROM hrp1001 WHERE objid IN s_objid.

IF sy-subrc <> 0.

MESSAGE e002(00). <--- Error Message

ENDIF.

Hope this helps.

Thanks..

Read only

Former Member
0 Likes
1,049

Hi,

Use at selection-screen event to validate the selection screen parameters.

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
1,049

Hi,

Write like this

Validation for Responsible organization

SELECT bukrs FROM T001

INTO l_bukrs

UP TO 1 ROWS

WHERE bukrs EQ p_bukrs.

ENDSELECT.

*error message for wrong Responsile organization

IF sy-subrc NE 0 OR l_bukrs IS INITIAL.

MESSAGE e651 . "Invalid Responsile organization

ENDIF.