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 Problems

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos
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

3 REPLIES 3

gopi_narendra
Active Contributor
0 Kudos
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

0 Kudos

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.

0 Kudos
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