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

Error in Select statement

Former Member
0 Likes
749

Hi,

I need to fetch both dynamic as well as static fields. When i tried this query it gives me error.

select trkeynr

(p_stat)

from k810008

into table git_k8

for all entries in git_k7

where trkeynr eq git_k7-trkeynr

and gjahr eq p_year

and perde eq p_period.

==========

Whereas if i simply select only the dynamic fields, it doesnt give any error. like this

select (p_stat)

from k810008

into table git_k8

for all entries in git_k7

where trkeynr eq git_k7-trkeynr

and gjahr eq p_year

and perde eq p_period.

Cant we use both dynamic field selection and static field se

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
722

Hi ,

Instead why dont you try as follows

concatenate trkeynr p_stat into p_stat separated by space .

select (p_stat) from ...

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
722

Hi,

Yes you can use both static as well as dynamic fields in the select statement at the same time. Try using INTO CORRESPONDING FIELDS OF TABLE addition in the select query and check if its working,


select trkeynr
(p_stat)
from k810008
into INTO CORRESPONDING FIELDS OF TABLE git_k8
for all entries in git_k7
where trkeynr eq git_k7-trkeynr
and gjahr eq p_year
and perde eq p_period.

Also make sure you dont enter the same field trkeynr in p_stat.

Regards,

Vikranth

Read only

0 Likes
722

Vikrant,

No, it is not working.

Read only

0 Likes
722

Hi,

As supriya stated use the concatenate statement, It will work

regards

Pavan

Read only

Former Member
0 Likes
723

Hi ,

Instead why dont you try as follows

concatenate trkeynr p_stat into p_stat separated by space .

select (p_stat) from ...

Thanks