09-28-2008 7:06 AM
Hi,
I have a internal table with a field message of length 1500.
I have to replace &1 and &2 in the message field with the value of year and Amount.
For example:
ITAB-Message - 'The letter is for the year &1 and the total amount to be payed is &2'.
In this, &1 should be replace with the year value.
and &2 by amount value.
Can you help me in this?
Thanks,
Vimala
09-28-2008 7:48 AM
Try this
REPORT ZPROG .
data: begin of itab,
msg(255) type c,
end of itab.
data: itab1 like itab occurs 0 with header line.
data: year(4) type n value '1995',
amount(4) type n value '4000'.
itab1-msg = 'The letter is for year &1 and total amount to payed is &2'
.
replace '&1' with year into itab1-msg.
replace '&2' with amount into itab1-msg.
write:/ itab1-msg.