‎2008 Apr 24 3:19 AM
Hi,
I need to read 4 from the output 'F04' that is the last character and add 1 to it.
Can some one tell me the syntax for it.
Thanks,
Subha
Edited by: subhashini reddy on Apr 24, 2008 4:22 AM
‎2008 Apr 24 3:39 AM
Hi Subha,
If the output is char type
data: p(3) type char.
take a another character type one char length
data: o type char.
let the output you are getting is 'FO4'
if need 4 then o = p+2(1).
thats it..
Regards
sg
‎2008 Apr 24 3:33 AM
Hi,
Write like this .
Regards,
Venkat.O
DATA: l_data1 TYPE char3 VALUE 'F04',
l_data2 TYPE char3.
l_data2 = l_data1+2(1).
l_data2 = l_data2 + 1.
WRITE / l_data2.
‎2008 Apr 24 3:39 AM
Hi Subha,
If the output is char type
data: p(3) type char.
take a another character type one char length
data: o type char.
let the output you are getting is 'FO4'
if need 4 then o = p+2(1).
thats it..
Regards
sg
‎2008 Apr 24 3:42 AM
data: output type c length 3 value 'F04',
result type i.
result = output+2 + 1.
Cheers,
Sougata.
Subha,
We would like to be rewarded with points You can do this by choosing the radiobutton on the left hand side of the page. You should do this to show your appreciation for our time. Once your problem is solved, reward points and then mark the answer as solved.
Sougata.
Edited by: Sougata Chatterjee on Apr 27, 2008 10:08 AM
‎2008 Apr 27 4:42 AM
this make sure its gonna be 'F04' 3 characters every time.. its its 'FX04' if then also u need to change to 'FX05'... u need to decide...
so solution for it is...
vl_data = 'F04'.
data: vl_len type i.
vl_len = strlen( vl_data).
vl_len = vl_len - 1.
vl_data = vl_data+(vl_len).
vl_temp = vl_data+vl_len(1)
vl_temp = vl_temp + 1.
clear: vl_len, vl_temp.
concatenate vl_data vl_temp to vl_data.