02-15-2007 9:18 AM
Hi All,
I have couple of issues regarding manipulation of a field.
I have a field type c which stores some description.
Now my issues here is:
1. If that field contains a string NVS i have to read characters after NVS string in that field and find out if any numeric number like ex: 458899 (or) 778979799 etc.. exits in that field.
2. In the same field we have to check out if any string exits which starts with R and then numeric digit! Like Ex: R0019199 (or) R0019599 etc. Means R plus any numeric number exists in that field!
Can anybody solve this issue!
Thanks in advance.
Thanks,
Deep.
02-15-2007 9:36 AM
1. DATA: pos type i.
IF string CS 'NVS'.
pos = sy-fdpos + 3.
IF string+pos(255) CA '0123456789'.
<Do the processing>
ENDIF.
ENDIF.
2. IF sring+(1) = 'R'.
IF string+1(254) NA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
<Do the processing>
ENDIF.
ENDIF.
Thanks
02-15-2007 9:23 AM
Hello,
Do like this.
DATA: VAR(10).
For first Issue
IF VAR CS 'NVS'.
IF VAR CA '255554515'.
Do some process...
ENDIF.
ENDIF.
For second Issue
IF VAR(1) = 'R'.
IF VAR CA '5544454'.
Do some process...
ENDIF.
ENDIF.
Vasanth
02-15-2007 9:27 AM
if str cs ' NVS'.
split str at 'NVS' into text1 text2.
if text2 ca '0123456789'.
<do coding>
endif.
elseif str cs 'R'.
split str at 'R' into text1 text2.
if text2 ca '0123456789'.
<do coding>
endif.
endif.
regards
shiba dutta
Message was edited by:
SHIBA DUTTA
02-15-2007 9:36 AM
1. DATA: pos type i.
IF string CS 'NVS'.
pos = sy-fdpos + 3.
IF string+pos(255) CA '0123456789'.
<Do the processing>
ENDIF.
ENDIF.
2. IF sring+(1) = 'R'.
IF string+1(254) NA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
<Do the processing>
ENDIF.
ENDIF.
Thanks