Application Development and Automation 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: 
Read only

Query

Former Member
0 Likes
512

Dear gurus,

i am having an input with 001, 002 in the same field (text) .

I want to seperate this field into two by identifyung the comma

i thas to be like this now

reason id = 001

counter = 002

How shall i do this with query

Thanx in advance

senthil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
483
SPLIT V_TAXT AT ',' INTO V_REASONiD V_COUNTER.
4 REPLIES 4
Read only

Former Member
0 Likes
483

hi,

Use the Split command ,

split text1 at ',' into test2 test3.

Reagrds

Arun

Read only

Manohar2u
Active Contributor
0 Likes
483
SPLIT f AT g INTO h1 ... hn.

SPLIT NAMES AT ',' INTO ONE TWO THREE

Read only

Former Member
0 Likes
484
SPLIT V_TAXT AT ',' INTO V_REASONiD V_COUNTER.
Read only

Former Member
0 Likes
483

hi ,

we can do this in 2 way.

<b>Easy way:</b>

using split command.

data: text1(11) type c value '100,200',

text2(5) type c,

text3(5) type c.

split text1 at ',' into test2 test3.

<b>Hard way:</b>

using offset.

data: text1(11) type cvalue '100,200',

text2(5) type c,

text3(5) type c,

len type i.

offset type i.

len = strlen( text1 ).

do len times.

if text1+sy-index(1) = ','.

offset = sy-index - 1.

text2 = text1+1(offset).

offset = sy-index + 1.

text3 = text1+offset(5).

endif