2008 Jun 12 3:03 PM
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...
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
2008 Jun 12 3:07 PM
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
2008 Jun 12 3:08 PM
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
2008 Jun 12 3:14 PM
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
2008 Jun 12 3:33 PM
Hi All ,
I changed the length of one to 80 an tehn it worked .
Thanks all.
2008 Jun 12 3:33 PM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |