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 syntax

Former Member
0 Likes
6,258

hi,

i want 0100000000100 2006 to get it as 0100000000100. it means i need to split at space.

is this statement right?

SPLIT it_bkpf-awkey AT '' INTO it_bkpf-awkey.

please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,909

Hi,

The Syntax will be

SPLIT it_bkpf-awkey AT SPACE INTO <two turget string in which you will store the split  string>

regards,

anirban

9 REPLIES 9
Read only

former_member787646
Contributor
0 Likes
1,909

Hi,

Try this and check.

SPLIT text AT space INTO it_bkpf-awkey. (SPACE is an ABAP keyword)

Hope this would help you.

Murthy

Read only

0 Likes
1,909

it giving as it_bkpf-awkey ended unexpectedly

Read only

0 Likes
1,909

hi,

i guess u r trying to populate it into body of internal table rather than a variable or work area.

Can u check it_bkpf-awkey is field in the body of internal table, if so change it to work area or any other variable.

revert back if any issues,

Regards,

Naveen

Read only

Former Member
0 Likes
1,909

Have you tried it and did did it work?.

Either way, you've answered your own question. What next?.

Read only

Former Member
0 Likes
1,910

Hi,

The Syntax will be

SPLIT it_bkpf-awkey AT SPACE INTO <two turget string in which you will store the split  string>

regards,

anirban

Read only

Former Member
0 Likes
1,909

hi,

Use SPLIT Keyword.

SPLIT var from space into V1 V2.

String before space will stored in V1.

String After Space stored in V2.

Hope this will help.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,909

Hi Poonam,

try this:

SPLIT it_bkpf-awkey AT SPACE INTO it_bkpf-awkey.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,909

Hi

Split will break the string into two parts with the condition.

SPLIT

'Jatender#Narang'

AT '#'

INTO: str1 str2.

The str1 contains 'Jatender'

and str2 contains 'Narang'.

If helpfull please reward.

Jatender Narang

Read only

Former Member
0 Likes
1,909

Hi,

it giving as it_bkpf-awkey ended unexpectedly

it is expected. because after split in your case you will get two substrings whereas you are providing space for only one. thats why in my above syntax i asked you to provide 2.

after the allocation you may write the first to get your desire output.

Regards,

anirban