‎2007 Sep 04 11:09 AM
Hi All,
I have to read first 4 characters one variable
into other variable .
How to do this?
Thanks and Regards,
Amit.
‎2007 Sep 04 11:13 AM
Hi
Data : var(10) value 'AMERICA'.
WRITE:/ VAR(4). "this will give the first 4 chars
<b>Reward if helpful</b>
‎2007 Sep 04 11:11 AM
‎2007 Sep 04 11:13 AM
Hi
Data : var(10) value 'AMERICA'.
WRITE:/ VAR(4). "this will give the first 4 chars
<b>Reward if helpful</b>
‎2007 Sep 04 11:13 AM
if its a type c vaariable den use:
suppose var2 is ur variable
var2 = var1+0(4).
if its not a type c variable den move it to a type c var
zvar(10) type c.
move var1 to zvar.
zvar = zvar+0(4).
plz reward points if dis helps
Message was edited by:
abapuser
‎2007 Sep 04 11:30 AM
data var2(4) TYPE c.
Var2 = var1+0(4).
Where 0 is the offset and 4 is the length.
Reward if helpful.
Kartavya
‎2019 Jun 08 10:19 AM
Var2 = var1+0(4).
Can we set Var2 = var1+0(n).
n is any number or can we set it into dynamic number?
‎2019 Jun 08 12:32 PM
The guy was here 12 years ago, maybe he'll come back in 12 years...
Can't you read the ABAP documentation, or just try yourself?
‎2007 Sep 04 11:33 AM
HI,
see this code.
data:var(10) type c value 'welcome'.
data:var1(4).
var1 = var.
write:/ var1.
rgds,
bharat.