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

select statment not working with variables

Former Member
0 Likes
793

Hi experts,

Iam trying to select some data using the follwoing code

with radio buttons r6 & r7.

If r6 selected,it takes from parameter and

if r7 selected it takes from select options...

data: l_datbi type a005-datbi,l_datab type a005-datab.

if r6 = 'X'.

l_datbi = pvalid.

l_datab = pvalid.

elseif r7 = 'X'.

l_datab = svalid-low.

l_datbi = svalid-high.

endif.

select vtweg matnr knumh datbi datab into corresponding fields of i_itab

from A004

where kappl eq 'V'

and kschl eq pkschl

and vkorg eq pvkorg

and vtweg in svtweg

and matnr in smatnr

and datab le l_datab #######

and datbi ge l_databi. #######

This select statement is not working.

It is taking only one value at a time.(r6 value or r7value)

What might be the reason...?

reward gurarenteed

maggy

Hi experts,

Iam trying to select some data using the follwoing code

with radio buttons r6 & r7.

If r6 selected,it takes from parameter and

if r7 selected it takes from select options...

data: l_datbi type a005-datbi,l_datab type a005-datab.

if r6 = 'X'.

l_datbi = pvalid.

l_datab = pvalid.

elseif r7 = 'X'.

l_datab = svalid-low.

l_datbi = svalid-high.

endif.

select vtweg matnr knumh datbi datab into corresponding fields of i_itab

from A004

where kappl eq 'V'

and kschl eq pkschl

and vkorg eq pvkorg

and vtweg in svtweg

and matnr in smatnr

and datab le l_datab #######

and datbi ge l_databi. #######

This select statement is not working.

It is taking only one value at a time.(r6 value or r7value)

What might be the reason...?

reward gurarenteed

maggy

5 REPLIES 5
Read only

Former Member
0 Likes
766

Hi Maggy,

You should use "INTO CORRESPONDING FIELDS OF TABLE I_ITAB".

Regards,

John.

Read only

0 Likes
766

Hi John,

I have used "into corresponding"

maggy

Read only

0 Likes
766

Hi Maggy,

Yes you did use INTO CORRESPONDING but it should be INTO CORRESPONDING FIELDS <b>OF TABLE</b>.

Regards,

John.

Read only

andreas_mann3
Active Contributor
0 Likes
766

Hi,

-> here's the same problem:

Andreas

Read only

Former Member
0 Likes
766

Hi,

You are trying to equate your low value with end date and high value with start date..

The correct logic will be,

data: l_datbi type a005-datbi,l_datab type a005-datab.

if r6 = 'X'.

l_datbi = pvalid. "Start Date

l_datab = pvalid. "End Date

elseif r7 = 'X'.

<b>*l_datab = svalid-low. "Wrong</b>

<b>l_datab = svalid-high. "Right</b>

<b>*l_datbi = svalid-high. "Wrong</b>

<b>l_datbi = svalid-low. "Right</b>

endif.

select vtweg matnr knumh datbi datab into corresponding fields of i_itab

from A004

where kappl eq 'V'

and kschl eq pkschl

and vkorg eq pvkorg

and vtweg in svtweg

and matnr in smatnr

and datab le l_datab ####### "This also doesnt look

and datbi ge l_databi. ####### "right to me, please check

Hope this helps..

Sri