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

Validating a selection-screen field

Former Member
0 Likes
1,078

Hi all,

I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?

I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.

I am not getting how to validate a field which is declared as parameter?

regards and thanks in advance.

Anil.

6 REPLIES 6
Read only

Former Member
0 Likes
759

Hi Anil

Your requirement seems to be confusing...

Do you need to validate Sales Order Number and Plant for the range of customers or Sales Order Number and Plant individually???

Kind Regards

Eswar

Read only

0 Likes
759

I want to validate sales order no and plant individually.Plant nos are from 1-10.

Customer numbers are from 100-1000.

How can i do this?

regards and Thanks in advance,

Anil

Read only

0 Likes
759

Hi,

IS it select-options?

data: c_min like kna1-kunnr default '00000100',

c_max like kna1-kunnr default '00001000'.

SELECT-OPTIONS SO_kunnr FOR kna1-kunnr

DEFAULT c_min TO c_max

OPTION BT SIGN I.

Does this help??

Regards

Subramanian

Read only

0 Likes
759

We should not hard code that.If the customers who are in between 150-200 are not having any orders ,will the code work properly?

regards and thanks in advance,

Yours,

Anil.

Read only

Former Member
0 Likes
759

Make sure that u are validating against the header table.

say eg if u wnat t validate matnr in marc, then do as below.

SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
AT SELECTION-SCREEN.

*Validate material no details
  PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
  SELECT SINGLE matnr INTO v_matnr
         FROM <b>mara</b>
         WHERE matnr IN s_matnr.

  IF sy-subrc NE 0.
    MESSAGE i128.
    LEAVE LIST-PROCESSING.
  ENDIF.

ENDFORM.

Dont select from marc.

Hope this is clear.

Read only

Former Member
0 Likes
759

Anil,

If your selection-screen has a parameter of Plant and Select option of VBELN. You can validate these fields only as shown above, why do you bother about Customer Nos.