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: 

split the string into 3 & more parts

Former Member
0 Kudos

hello boss,,

how to split the string following string

[)>06P1PSN74AHC1G00DBVR6P2PJQ3000V00333171T0425289Z294WTKYD080131T8010069CHS20LSHE21LUSA22LCHS23LCHN EG43Z1/260C/UNLIM;//;012108L1520

like this

1. [)>06P

2. 1PSN74AHC1G00DBVR6P2PJ

3. Q3000

plz help me to find out...

little urgent ................

6 REPLIES 6

Former Member
0 Kudos

SPLIT L_STR AT '*'

INTO TABLE IT_FILDATATMP.

LOOP AT IT_FILDATATMP INTO WA_FILDATATMP.

CASE SY-TABIX.

WHEN '1'.

WHEN '2'.

WHEN OTHERS.

EXIT.

ENDCASE.

ENDLOOP.

Reward if useful

Former Member
0 Kudos

data:    lt_split     type table of char100

split your_string at '*' into table lt_split.

Edited by: Florian Kemmer on Feb 26, 2008 11:15 AM

Former Member
0 Kudos

hi,

write this:

DATA: va_string1 type string,

va_string2 type string,

va_string3 type string,

va_string4 type string.

SPLIT var1 AT '*' into va_string1 va_string2 va_string3 va_string4.

regards.

Former Member
0 Kudos

data: begin of wa,

txt type string,

end of wa.

data: itab like table of wa.

var1 ='[)>06P1PSN74AHC1G00DBVR6P2PJQ3000V00333171T0425289Z294WTKYD080131T8010069CHS20LSHE21LUSA22LCHS23LCHN EG43Z1/260C/UNLIM;//;012108L1520'.

split var1 at '*' into table itab.

loop at itab into wa.

write / wa-txt.

endloop.

Former Member
0 Kudos

Hi,

You can use the SPLIT statement to split the string into the desired no. of parts based on the delimiter ' *'.You can place all the parts in an array declared as a internal table with single field.

Go through the following code :

TYPES:

BEGIN OF test,

str(500) TYPE c,

END OF test.

DATA:

itab TYPE TABLE OF test,

wa TYPE test.

var2 ='[)>06P1PSN74AHC1G00DBVR6P2PJQ3000V00333171T0425289Z294WTKYD080131T8010069CHS20LSHE21LUSA22LCHS23LCHN EG43Z1/260C/UNLIM;//;012108L1520'.

SPLIT var2 AT '*' INTO TABLE itab.

LOOP AT itab INTO wa.

WRITE wa-str.

ENDLOOP.

Hope this helps.

Please reward points for helpful answers.

Regards,

Kaveri

Former Member
0 Kudos

Hi all ,

thanks for ur help . i am facing one more issue. could u plz help me.

We are implementing bar code scanning MIGO process..

we are capture vendor data from BAR CODE Label and do migo according to data which encrypted in bar code .

while we captured the bar code the data come like. so we are unable to segregate the data's.

[)>06P1PSN74LVCC4245APWR6P2PBQ2000V00333171T2224925Z184WTKYD051031T5286002WCF20LTID21LDEU22LMLA23LMYSEe43Z1/250C/UNLIM;//;040505|L1520

i am using HPP-IT4600 Scanner,but our vendor side the get like below form.

[)>|06|P|1PSN74LVCC4245APWR|6P|2PB|Q2000|V0033317|1T2224925Z18|4WTKY|D0510|31T5286002WCF|20LTID|21LDEU|22LMLA|23LMYS|Ee4|3Z1/250C/UNLIM;//;040505|L1520||

i do not know how to do get like above,or i want to change any scanned properties

plz do the need ful

Edited by: jana sap on Mar 19, 2008 7:19 AM