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

validation

Former Member
0 Likes
931

SELECT SINGLE charg FROM mcha INTO l_charg

WHERE charg IN s_charg.

regarding this when i am validating the statement it accepting only low value but not high value any suggestions for this

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
906

hi,

u r selecting only

 single

try this.

SELECT charg FROM mcha INTO  TABLE itab
WHERE charg IN s_charg.

rgds

Anver

8 REPLIES 8
Read only

anversha_s
Active Contributor
0 Likes
907

hi,

u r selecting only

 single

try this.

SELECT charg FROM mcha INTO  TABLE itab
WHERE charg IN s_charg.

rgds

Anver

Read only

Former Member
0 Likes
906

since you are using the select option.

so always use the Select charg up to 1 rows from mcha into l_charg where charg in s_charg

endselect.

Message was edited by:

Lakshmi Sekhar Reddy

Read only

Former Member
0 Likes
906

Hi ,

You are only selecting single value from MCHA table into variable l_charg. So you are getting only low value.

Just use the following syntax.

SELECT SINGLE charg FROM mcha INTO table l_charg

WHERE charg IN s_charg.

Regards,

Chetan.

PS:Reward points if this is helpful.

Read only

Former Member
0 Likes
906

can i use variable instead of internal table

Read only

0 Likes
906

If you use the variable.

The better practice is for select options

select charg up to 1 rows from MCHB into l_charg where charg in s_charg

endselect.

If you want all the values for the select option

Use the internal table

select charg from MCHB into table it_mchb where charg in s_charg.

Read only

former_member404244
Active Contributor
0 Likes
906

Hi,

change the select statement.

select charg from mcha into table itab

where charg in s_charg.

Regards,

nagaraj

Read only

Former Member
0 Likes
906

Hi,

Since you are using the addition SINGLE , it fetches only a single record and it uses the value that is present in the Low field..

To correct the statement remove the single addition in your select statement.

Hope this answers your question.

Cheers

Read only

Former Member
0 Likes
906

Hi,

Try this.

IF s_charg[] IS NOT INITIAL.

SELECT charge

FROM mcha

UP TO 1 ROWS

INTO l_charg

WHERE charg IN s_charg.

ENDSELECT.