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

Check for quantity field

Karan_Chopra_
Active Participant
0 Likes
3,181

I have a quantity input field

i want to enter only numeric value and it shud give error if i enter some alpha numeric ot special symbol eg. 'ahj#$%'

how can i do it

I have a quantity input field

i want to enter only numeric value and it shud give error if i enter some alpha numeric ot special symbol eg. 'ahj#$%'

how can i do it

14 REPLIES 14
Read only

Former Member
0 Likes
2,281

Hi Karan

Use only type i, or f type for quantity. or use Unit for the quantity.

Please reward points.

Regards

deepanker

Read only

Former Member
0 Likes
2,281

Hi Karan,

You should define Data Type of that field "QUAN" type.....It will not allow or accept any alpha numeric values... Or you have to validate the same at PAI event Or at selection screen for field...

This will help you...

Reward Points...

Cheers,

Sagun Desai...

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

wen i enter invalid values program is terminated

instead of that i want to give error msg

type is quantity only

Read only

0 Likes
2,281

ok give a error messsage in the if condition.

example :-

if input field = alphanumeric

error.

endif.

reward points if it will be helpful.

Read only

Former Member
0 Likes
2,281

Hi,

check this code write it in this way then u can get display the error message.

data: n(10) type N.

parameters: pa_matnr(10) type N.

if pa_matnr eq n.

message e000(zmsmsg).

endif.

write:/ pa_matnr

try this hope u get some idea how to do tht.

regards,

Sana.

reward for useful answers.

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

i need to chk 4 general value not a single value

how can i chk for a type in dat field

the assignment is

ls_plantdata-reorder_pt = int_table-nvalue.

the thing is int_table-nvalue is char type from table control

and ls_plantdata-reorder_pt is quan i cant change int_table-nvalue to quan bt need to chk it b4 assinment only as it gives dump after assignment

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

plz help

Read only

Former Member
0 Likes
2,281

Hi karan,

IF wa_weight-truckno CA '_' OR wa_weight-truckno CA '-' OR

wa_weight-truckno CA '*' OR wa_weight-truckno CA '/' OR

wa_weight-truckno CA '+' OR wa_weight-truckno CA '`' OR

wa_weight-truckno CA '\' OR wa_weight-truckno CA '#' OR

wa_weight-truckno CA '&' OR wa_weight-truckno CA '%' OR

wa_weight-truckno CA '$' OR wa_weight-truckno CA '@' OR

wa_weight-truckno CA '!' OR wa_weight-truckno CA '^' OR

wa_weight-truckno CA '(' OR wa_weight-truckno CA ')' OR

wa_weight-truckno CA '=' OR wa_weight-truckno CA '<' OR

wa_weight-truckno CA '>' OR wa_weight-truckno CA '?' OR

wa_weight-truckno CA ':' OR wa_weight-truckno CA ';' OR

wa_weight-truckno CA '|' OR wa_weight-truckno CA '{' OR

wa_weight-truckno CA '}' OR wa_weight-truckno CA '[' OR

wa_weight-truckno CA ']' OR wa_weight-truckno CA ',' OR

wa_weight-truckno CA '.' OR wa_weight-truckno CA '~' OR

wa_weight-truckno CA '"' .

use this.

Reward Points if useful,

Regards,

Sumanjeet.

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

no i cant use this much of hard coding 4 dat

is there any othe method

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

i need to chk 4 general value not a single value

how can i chk for a type in dat field

the assignment is

ls_plantdata-reorder_pt = int_table-nvalue.

the thing is int_table-nvalue is char type from table control

and ls_plantdata-reorder_pt is quan i cant change int_table-nvalue to quan bt need to chk it b4 assinment only as it gives dump after assignment

plzzz helpp

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

plz help guys

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

plzzzz helppppppppppppppp

is thr no one to help on this???????

Read only

Karan_Chopra_
Active Participant
0 Likes
2,281

plzzz help>>>>>>>>>>

Read only

0 Likes
2,281

Hi

Try this:

codePARAMETERS: P1(24) TYPE C.

DATA: _NUMBER TYPE P DECIMALS 2.

CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.

MOVE P1 TO _NUMBER.

ENDCATCH.

IF SY-SUBRC 0.

WRITE: P1, 'is not number'.

ENDIF.[/code]

-Suthan