2009 Mar 10 10:56 AM
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.
2009 Mar 10 11:03 AM
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..
2009 Mar 10 11:00 AM
Hi,
Use event AT SELECTION-SCREEN to validate the screen field and show appropiate message to user.
Regards,
Tarun
2009 Mar 10 11:02 AM
2009 Mar 10 11:02 AM
under the at-selection screen event,
you have to write the code for the checking of the values from the corresponding master tables..
2009 Mar 10 11:05 AM
hi ,
I know that write the code in at selection screen. but how i can validate can u send code.
thanks
2009 Mar 10 11:03 AM
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
2009 Mar 10 11:03 AM
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..
2009 Mar 10 11:06 AM
Hi,
Use at selection-screen event to validate the selection screen parameters.
Regards,
Jyothi CH.
2009 Mar 10 11:08 AM
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.