02-06-2008 2:55 AM
Hi,
1.On a selection-screen with four select -options as s_vbeln,s_vkorg,s_vtweg,s_spart. I need to validate and write a error message ' enter atleast one field' if it is executed without any values.
2.Also validation should be done that the entered value is correct or incorrect and if it is incorrect it should show the error message concerned to the fields for example if the vkorg value is entered incorrect , it should display'' please enter valid entry' respectively to all the fields.
Can anyone send me a code on how to perform this.
Thanks,
Stalin.
02-06-2008 3:13 AM
TABLES : vbak.
SELECT-OPTIONS : so_vbeln FOR vbak-vbeln,
so_vkorg FOR vbak-vkorg,
so_vtweg FOR vbak-vtweg,
so_spart FOR vbak-spart.
AT SELECTION-SCREEN.
IF so_vbeln IS INITIAL AND
so_vkorg IS INITIAL AND
so_vtweg IS INITIAL AND
so_spart IS INITIAL.
MESSAGE e000(zam) WITH 'Enter atleast one'.
ENDIF.
Regards
Gopi
02-06-2008 3:13 AM
TABLES : vbak.
SELECT-OPTIONS : so_vbeln FOR vbak-vbeln,
so_vkorg FOR vbak-vkorg,
so_vtweg FOR vbak-vtweg,
so_spart FOR vbak-spart.
AT SELECTION-SCREEN.
IF so_vbeln IS INITIAL AND
so_vkorg IS INITIAL AND
so_vtweg IS INITIAL AND
so_spart IS INITIAL.
MESSAGE e000(zam) WITH 'Enter atleast one'.
ENDIF.
Regards
Gopi
02-06-2008 3:38 AM
Thanks Gopi,
But how can check whether the entered values in select-options is a valid entry.If the entry is invalid...it should display' enter a valid entry'..
how to check the valid entry.
Stalin.
02-06-2008 4:09 AM
TABLES : vbak.
DATA : it_vbak TYPE TABLE OF vbak.
SELECT-OPTIONS : so_vbeln FOR vbak-vbeln,
so_vkorg FOR vbak-vkorg,
so_vtweg FOR vbak-vtweg,
so_spart FOR vbak-spart.
AT SELECTION-SCREEN.
IF so_vbeln IS INITIAL AND
so_vkorg IS INITIAL AND
so_vtweg IS INITIAL AND
so_spart IS INITIAL.
MESSAGE e000(zam) WITH 'Enter atleast one'.
ENDIF.
" Similarly you can check for the remaining Select Options as done below
IF NOT so_vbeln[] IS INITIAL.
SELECT * FROM vbak
INTO TABLE it_vbak
WHERE vbeln IN so_vbeln.
IF sy-subrc NE 0.
MESSAGE e000(zam) WITH 'Incorrect Sales Order Number'.
ENDIF.
ENDIF.
Regards
Gopi