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 validation

Former Member
0 Kudos

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

awin_prabhu
Active Contributor
0 Kudos

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

I355602
Advisor
Advisor
0 Kudos

Hi,

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

Regards,

Tarun

Former Member
0 Kudos

Hi,

Use atselection output on field.

former_member242255
Active Contributor
0 Kudos

under the at-selection screen event,

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

0 Kudos

hi ,

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

thanks

Former Member
0 Kudos

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

awin_prabhu
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

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

Regards,

Jyothi CH.

Former Member
0 Kudos

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.