2013 Sep 10 4:18 PM
hi expert.
i have one big problem.
i want to get sum from table cosp by some strange statement.
when my perdio is 1 i want to get sum from wtg001
when period is 2 i want to get sum from wtg002
.....wtg012.
is it possible to have dynamic select like this:
SELECT
SUM( distinct wtg0xy ) as ZWTG001_110010
cosp~kstar as kstar csku~ltext as ltext
INTO
corresponding fields of tABLE IT_TMP?????
thanks for your advise
2013 Sep 11 5:58 PM
Hi Maryam,
Try like this:
concatenate 'wtg0' lv_period into lv_field.
select distinct ( lv_field ) as ZWTG001_110010
cosp~kstar as kstar csku~ltext as ltext
INTO corresponding fields of itab.
Here, variable lv_period has the period '01' , '02' etc.
BR,
Shankar.
2013 Sep 11 5:58 PM
Hi Maryam,
Try like this:
concatenate 'wtg0' lv_period into lv_field.
select distinct ( lv_field ) as ZWTG001_110010
cosp~kstar as kstar csku~ltext as ltext
INTO corresponding fields of itab.
Here, variable lv_period has the period '01' , '02' etc.
BR,
Shankar.