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

The abap code to extract a string

Former Member
0 Likes
3,783

Hi All,

In a Extra-field I've to put in an ABAP code to extract a string (first 10 characters) from another field.

Cuold anyone suggest me the abap code to extract a string?

Thanks

Moderator Message: Please do some research before posting

Message was edited by: Kesavadas Thekkillath

2 REPLIES 2
Read only

yogendra_bhaskar
Contributor
0 Likes
2,194

hi Rossi ,

if you have to extract first 10 character , then simply declare your target variable as of character 10 and assign it .

DATA:

d_string(50) TYPE c,

d_10(10) TYPE c .

move 'Hello world!!!!!!' to d_string.

d_10 = d_string.

WRITE d_10.

regards,

Yogendra Bhaskar

Read only

JJosh
Active Participant
0 Likes
2,194

lv_string1 = "HelloWorld22".

To extract the 1st 10 ...

lv_string2 = lv_string1+0(10).

This is fetch the 1st 10 chars... to lv_string2.