10-11-2007 10:27 AM
hi gurus
i am new to abap . i am writing a functional module for our req. In that importing element value is 'USRAMAN' , i need to seperate 'US' and 'RAMAN' and to store in different data fields .
10-11-2007 10:30 AM
Please refer this....
data : a(2) type c,
b(5) type c,
c(6) type c. "imported parameter in ur case.....
c = 'USRAMAN'.
a = c+0(2).
b = c+2(5).
10-11-2007 10:31 AM
Use SPLIT or
data: data(2),
obj(8).
data = element(2). -
it will have US
obj = element+2(8). -
it will have RAMAN
reward if useful
10-11-2007 10:31 AM
Hi Arumugam,
Use offset to separate words.
Take two variabels V1 and V2,and, do as follows.
DATA: V1(2) TYPE C,
V2(5) TYPE C.
V_DATA = 'USRAMAN'.
V1 = V_DATA+0(2).
V2 = V_DATA+2(5).
Thanks,
Vinay
10-11-2007 10:32 AM
HI arumugam,
As for as i have understood.
create 2 char like
lets say variable (doubt) having value 'USRAMAN'.
data: country(2),
name(5).
country = doubt+0(2).
name = doubt+2(5).
like this you can sseperate a word into two diffrent variables.
reward if usefull.....
10-11-2007 10:32 AM
Hi,
try like this
data : name(10) type c,
name1(10) type c,
name2(10) type c.
name = 'USRAMAN'.
v_name1 = name+0(2).
v_name2 = name+2(5).
REGARDS,
Nagaraj
10-11-2007 10:54 AM
hi guys
thanks for a immediate response.
i my case first 'US' will remain static for all the cases . but next user name is a dynamic one . it can be like this
USRAMAN
USRAJAGOPAL
USRANGANATH
10-11-2007 10:59 AM
then do like this...
data : text1(2),
text2(20),
text3(25) value 'USRANGANATH'.
text1 = text3+0(2).
text2 = text3+2.
write : / text1, text2.
regards
shiba dutta
10-11-2007 10:51 AM
u can split usraman as following:
data: v_name(7) type c value 'USRAMAN',
v_first(2) type c,
v_second(5) type c.
v_first = v_name+0(2).
v_second = v_name+2(5).
write: v_first,
v_second.
pls reward points if useful.