‎2008 Dec 13 5:30 PM
hy
i have a field wich is composed from char and num like 'R2004' OR 'R2025' and i would like to split it into two variable the first contain the caracter 'R' and the second contain the number ' 2004' and after that i would like to do
number =number+1(for example 2004 become 2005) and finally i concatenate them and that became :
( R2005;R2006..............).
thanks
‎2008 Dec 13 5:43 PM
Welcome to SCN
Try this way
data: n(4) type n.
data: char(5) type c value 'R2004'.
n = char+1(4).
n = n + 1.
char+1(4) = n.
aRs
‎2008 Dec 13 5:45 PM
it seems u registered today only,
so read the forum rules. U must search the sdn before posting such simple questions.
Do it like this
var = var + 1(4)
u'll get the number in var which will be of char type then u can process further.
‎2008 Dec 13 5:53 PM
Welcome to SCN.
I would suggest you to explore t-code ABAPDOCU as much as possible.Else Press F1 on Split,Concatenate and learn About Offsets of Strings.
Here is Sample code to start with:
REPORT.
DATA: ONE(5) VALUE 'R2004',
number(4),
first.
first = one+0(1).
Number = one+1(4).
number = number + 1.
CONDENSE number NO-GAPS.
CONCATENATE first number INTO one.
write one.