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

query

Former Member
0 Likes
783

hi folks,

I having a problem with the query.

data g_eeamt(9) type c,

g_eepct(4) type c.

select eeamt eepct from pa0169 into g_eeamt g_eepct where pa0169-bplan = 'RT04' and begda le pybegda and endda ge pyendda.

what is the problem here?

Thanks

Vinu

7 REPLIES 7
Read only

Former Member
0 Likes
739

Hi,

Try this..

select eeamt eepct from pa0169 into <b>(g_eeamt,g_eepct)</b> where pa0169-bplan = 'RT04' and begda le pybegda and endda ge pyendda.

Thanks,

Naren

Read only

Former Member
0 Likes
739

What's the problem? No data?

Rob

Read only

0 Likes
739

I see, it doesn't compile. Try:

DATA: g_eeamt(9) TYPE c,
      g_eepct(4) type c.

SELECT eeamt eepct
  FROM pa0169
  INTO (g_eeamt, g_eepct)
  WHERE bplan = 'RT04'
    AND begda LE pybegda
    AND endda GE pyendda.
    
endselect.    

Rob

There were still some problems, but s/b OK now

Message was edited by: Rob Burbank

Read only

0 Likes
739

Yep, I having some problems in the query

select eeamt eepct from pa0169 into (g_eeamt, g_eepct) where bplan = 'RT04' and begda le pybegda and endda ge pyendda.

endselect.

because eeamt (dec) and eepct (Curr) where as the variables are char type.

How can i do that?

Thanks

Vinu

Read only

Former Member
0 Likes
739

Hi,

Modiy the variables g_eeamt, g_eepct of the same type of the fields that you are selecting..

THanks,

Naren

Read only

0 Likes
739

Ultimately I need to have them, stored as char variables for further validation.

Read only

Former Member
0 Likes
739

Hi,

Declare the variables like this..

DATA: g_eeamt_char(17) TYPE c,

g_eepct_char(6) type c.

DATA: g_eeamt like pa0169-eeamt.

DATA: g_eepct like pa0169-eepct.

SELECT eeamt eepct

FROM pa0169

INTO (g_eeamt, g_eepct)

WHERE bplan = 'RT04'

AND begda LE pybegda

AND endda GE pyendda.

ENDSELECT.

g_eeamt_char = g_eeamt.

g_eepct_char = g_eepct.

Thanks,

Naren

Message was edited by: Narendran Muthukumaran