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

Split

Former Member
0 Likes
615

Hi ,

I am trying to split a field into two parts.

Please see below.

If I need to get only the first part before the first delimiter (comma), how can I write the syntax?

I wrote it this way u2026

DATA: NAMES(80) TYPE C VALUE 'DMATERIALEAU20080211185126

,TRANSPORTED,MURALIGREERTIN,,MATERIALSEAU,20080211,NONE,1234,

DMATERIALEAU

',

ONE(26) TYPE C,

TWO(80) TYPE C,

DELIMITER(2) VALUE ','.

SPLIT NAMES AT DELIMITER INTO ONE TWO.

write : one ,

/ two .

Output :

One = 'DMATERIALEAU20080211185126,TRA

Please tell me how I can do it properly till the comma...

5 REPLIES 5
Read only

Former Member
0 Likes
595

HI ramana,

YOu String is spread over two lines and probably there is a line break character inbetween.

Othwewise your code looks good.

Have the entire string in one line.

Regards,

Ravi Kanth

Read only

Former Member
0 Likes
595

DATA: NAMES(80) TYPE C VALUE 'DMATERIALEAU20080211185126

,TRANSPORTED,MURALIGREERTIN,,MATERIALSEAU,20080211,NONE,1234,

DMATERIALEAU

',

ONE(26) TYPE C,

TWO(80) TYPE C,

Three(80) TYPE C,

DELIMITER(1) VALUE ','.

SPLIT NAMES AT DELIMITER INTO ONE TWO three.

write : / one ,

/ two,

/ three.

this will work........

<REMOVED BY MODERATOR>

Regards

Anbu

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:23 PM

Read only

Former Member
0 Likes
595

Hi,

Declare the delimiter as one character.

delimeter(1) value ','.

it will work fine then.

Right now it tries to find the delimeter as ', '.

regards,

Advait.

Edited by: Advait Gode on Jun 12, 2008 4:26 PM

Read only

0 Likes
595

Hi All ,

I changed the length of one to 80 an tehn it worked .

Thanks all.

Read only

0 Likes
595

closing this now