Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding manipulation of a field

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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