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

ABAP PROBLEM!?

Former Member
0 Likes
245

Dear all,

IF there is a blank space in a character string and if I want to Truncate the field when it finds a blank space how should I approch this.

Ex: field = 'SARATOGA S'

and if I have to concider only 'SARATOGA' and leave out the ' S' .

can you please suggest me some sample code.

Regards,

VJ

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
228

Hi VJ,

Use <b>SPLIT</b> statement for your requirement.

DATA:

FIELD TYPE STRING VALUE 'SARATOGA S',

V_FIRST TYPE STRING.

SPLIT FIELD AT SPACE INTO V_FIRST.

WRITE:/ V_FIRST.

Check this link to know morea about SPLIT

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/split.htm

Thanks,

Vinay

1 REPLY 1
Read only

Former Member
0 Likes
229

Hi VJ,

Use <b>SPLIT</b> statement for your requirement.

DATA:

FIELD TYPE STRING VALUE 'SARATOGA S',

V_FIRST TYPE STRING.

SPLIT FIELD AT SPACE INTO V_FIRST.

WRITE:/ V_FIRST.

Check this link to know morea about SPLIT

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/split.htm

Thanks,

Vinay