05-04-2006 5:39 AM
hello everybody,
kindly help me how to do this:
Vendor 2004 2005 2006
-
-
-
-
xxxxxxx xxx.xx xxx.xx xxx.xx
the year is select-option. the number of year depends on the on year range entered by the user.
how could i write this using the WRITE STATEMENT since the column year depends on the range entered by the user. if the user entered 2004-2007 meaning i have 4 year in the title of the report.
how could i write that the position of the column is VARIABLE.
thanks.
den
05-04-2006 5:43 AM
Hi donna,
1. Simple.
2. we have to use
<b>WRITE : at</b> pos year
where pos = position variable
year = year data.
3. just copy paste in new program
4.
report abc.
data : pos type i.
data : yr(4) type n.
yr = '2003'.
*----
do 5 times.
pos = pos + 6.
yr = yr + 1.
write : at pos yr.
enddo.
regards,
amit m.
05-04-2006 6:16 AM
Hi Donna,
Try the following code.
tables bkpf.
DATA pos type i.
data year(4) type n.
select-options s_year for bkpf-gjahr.
start-of-selection.
pos = 1.
loop at s_year.
if s_year-option = 'EQ'.
WRITE : at pos s_year-low.
pos = pos + 8.
elseif s_year-option = 'BT'.
year = s_year-low.
do .
year = year + 1.
write : at pos year.
pos = pos + 6.
if year = s_year-high.
exit.
endif.
enddo.
endif.
endloop.
Hope that it was helpful.
Thanks,
Susmitha
05-04-2006 7:43 AM
Hi
report zzztest.
tables pa9701.
select-options: syear for pa9701-aYEAR.
DATA: CNT(3) TYPE N.
DATA: CNT1(4) TYPE N.
DATA: CNT2(4) TYPE N.
break-point.
cnt2 = SYEAR-HIGH - SYEAR-LOW.
cnt2 = cnt2 + 1.
CNT1 = SYEAR-LOW.
do cnt2 times.
CNT = CNT + 10.
WRITE AT CNT CNT1.
CNT1 = cnt1 + 0001.
enddo.
try to code like this this will solved your problem
Regards,
Hiren Patel