Skip to Content
0
Former Member
Mar 23, 2006 at 03:41 PM

Doubt in Select query

37 Views

Hai,

I have problem in my select query,

My previous select query:

SELECT rrcty

ryear

rbukrs

rzzpspid

SUM( hslvt )

SUM( hsl01 )

SUM( hsl02 )

SUM( hsl03 )

SUM( hsl04 )

SUM( hsl05 )

SUM( hsl06 )

SUM( hsl07 )

SUM( hsl08 )

SUM( hsl09 )

SUM( hsl10 )

SUM( hsl11 )

SUM( hsl12 )

SUM( mslvt )

SUM( msl01 )

SUM( msl02 )

SUM( msl03 )

SUM( msl04 )

SUM( msl05 )

SUM( msl06 )

SUM( msl07 )

SUM( msl08 )

SUM( msl09 )

SUM( msl10 )

SUM( msl11 )

SUM( msl12 )

FROM zzsl5t

INTO TABLE it_erbproj

WHERE rldnr EQ c_rldnr AND

rrcty EQ c_rrcty AND

ryear EQ v_srr_fyear AND

rbukrs EQ v_srr_ccode AND

racct EQ v_racct AND

rzzpspid IN r_zzpspid

GROUP BY RRCTY ryear RBUKRS rzzpspid.

now i want change the above select query as,

If user enters input period 03 means,

i have to select

SELECT rrcty

ryear

rbukrs

rzzpspid

SUM( hslvt )

SUM( hsl01 )

SUM( hsl02 )

SUM( hsl03 )

SUM( mslvt )

SUM( msl01 )

SUM( msl02 )

SUM( msl03 )

only, not to select all the periods.

how can i give fields dynamically.

please suggest me.

Elamaran