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 the field

Former Member
0 Likes
1,193

I want to maka a select of table febko based on condition that field AZIDT's first seven character is given in the select-options

i.e my selection should be based only on the seven characters of the field which is given by the user

Regards,

jaga.

9 REPLIES 9
Read only

Former Member
0 Likes
1,137

Hi,

U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows

http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm

There are two ways to achieve ur task.

1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following

http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA

http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW

2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this

http://aspzone.com/blogs/john/articles/173.aspx

Everything has been given for validating in javascript.i hope u also validating in javascript only.

For more details on "Regular expressions" search google.

Regards,

rewards point.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,137

Hi,

You can get the first 7 char as follows.

DATA: val(15) type c value 'ABCDEFGHIJKLMNO'.

DATA: CHA(7) type c.

cha = val+0(7).

write: cha.

Regards,

Sesh

Read only

Former Member
0 Likes
1,137

The Visual Composer is a composition tool, you can do the same in very different ways, this is not a fix tool with only one way to do it...

I'm sad you think that this forum do not help you, but maybe with playing a bit with the storyboard you will get the answer that you're looking for.

Also in you case you give us very small details, you asked how to validate an input and we answered you...(with drop-down list or by using validation rules)

Maybe you're asking for a formula but what kind of formula you want ? which datasources you want to use ? what kind of result are you expecting...

So, again, i think we give you the tricks, now you have to adapt it to use in the right way...

Kind Regards,

Luis

Nikhil Bansal

Posts: 331

Questions: 139

Registered: 12/20/06

Forum points: 10

Re: How to validate the input field

Posted: Jun 25, 2007 10:21 AM in response to: Luis Felipe Lanz Reply E-mail this post

Hi Luis,

My question was very simple.

I just want to check if the input field contains the characters 'a-z' or 'A-Z'. If any character is present then say onBlur or onSubmit there should be an error message.

Can you give me a formula for this requirements. Shall be glad if I get.

Regards

rewards point

Read only

Former Member
0 Likes
1,137

Hi Jagadish,

select-options: s_option like .....

value = s_option(7).

and now use this value in select query instead of select option

<b>Regards,

Azhar</b>

Read only

Former Member
0 Likes
1,137

data: val(8) type c.

concatenate s_field '*' into val.

select * from febko

where AZIDT cp val.

reward if helpful

Read only

Former Member
0 Likes
1,137

Hi,

You want to select the AZIDT field values which is equal to first seven characters of select-options then it will useful for you.

First take all values of selection screen given by the user in to one internal table.

And take all values of first seven characters into another internal table .

In select statement take the forall entries of the second internal table and in where condition check the vales.

Read only

0 Likes
1,137

HI shyla ,

can you explain with the code

my table is febko and select option is s_azdit and field is azidt .

Regards,

jaga

Read only

0 Likes
1,137

Hi,

I think you need to use FOR ALL ENTRIES and check the value agisnt LOW and HIGH of select options.

Since you want to compare only first 7 char of a table field may be you have to do it after getting the data from the table into an internal table.

Regards,

Sesh

Read only

Former Member
0 Likes
1,137

HI ,

i want to validate the first seven character of the feild azidt not the first seven character of the select option .

KIndly help.

Regards,

jaga