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 string at special character #

Former Member
47,601

Hi,

I have a string which has values(9) splitted at '#'. Now I want to send the values into one work area of set of fields(9 fields,which is equal to the value present in the string) splitted at at '#$'.Can any one seggest?

Edited by: Julius Bussche on Jul 4, 2009 1:25 PM

Subject title improved.

5 REPLIES 5
Read only

Former Member
11,303

ya you have declr the two variable

data: name(17) type c ,

temp(8) type c.

data: or_name type c value 'SDN $ COMMUNITY'.

SPLIT ORNAME AT '$' INTO NAME TEMP.

BY

IMUTHU.

Read only

0 Likes
11,303

Thanks Muthu,

But I have a different structure for my internal table.How to move the splitted values to individual fields dynamically.

Read only

Former Member
0 Likes
11,303

ya you have declr the two variable

data: name(17) type c ,

temp(8) type c.

data: or_name type c value 'SDN $ COMMUNITY'.

SPLIT ORNAME AT '$' INTO NAME TEMP.

BY

IMUTHU.

Read only

Former Member
0 Likes
11,303

Please be more specific about your requirement.

Give the String example and also how you want your output to be.

Regards

Karthik D

P.S.: Give a more meaningful subject line in the future

Read only

Former Member
11,303

Hi Jjammy ,

DATA : BEGIN OF WA_TEMP,
        C1(20) TYPE C,
        C2(20) TYPE C,
        C3(20) TYPE C,
        C4(20) TYPE C,
        C5(20) TYPE C,
        C6(20) TYPE C,
        C7(20) TYPE C,
        C8(20) TYPE C,
        C9(20) TYPE C,
       END OF WA_TEMP.

PARAMETERS : P_STRING TYPE STRING DEFAULT 'abc1#abc2#abc3#abc4#abc5#abc6#abc7#abc8#abc9'.

SPLIT P_STRING AT '#' INTO WA_TEMP-C1 WA_TEMP-C2 WA_TEMP-C3 WA_TEMP-C4 WA_TEMP-C5 WA_TEMP-C6 WA_TEMP-C7 WA_TEMP-C8 WA_TEMP-C9.

WRITE : / WA_TEMP-C1 ,
        / WA_TEMP-C2 ,
        / WA_TEMP-C3 ,
        / WA_TEMP-C4 ,
        / WA_TEMP-C5 ,
        / WA_TEMP-C6 ,
        / WA_TEMP-C7 ,
        / WA_TEMP-C8 ,
        / WA_TEMP-C9.

check out above code...

now you can move the values in the WA_TEMP work area to any internal table using either MOVE statement or Assign (=).

For Example

var1 = WA_TEMP-C1 .

please be more specific about your requirement...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya