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

Read a substring

vigneshR1
Associate
Associate
0 Likes
470

Dear Developers ,

I am new to ABAP.

I need a small help here.

i would like to read the name of the attachment from a particular string.

<xml name="test.doc" displayname="test.doc"'>

Using, String manipulation,

I have to read only content inside the name attribute., which test.doc

I used FIND , nevertheless, is there any way in ABAP to search from Start INDEX to END INDEX to read a substring esle, is there any other better way to do it in ABAP.

thanks

Vignesh

2 REPLIES 2
Read only

bernat_loscos
Explorer
0 Likes
441

Hi Vignesh,

This would be my solution, to split the string at the " character.

Then you recover the data from table using index.

DATA: lt_str TYPE STANDARD TABLE OF string.

l_str_xml = '<xml name="test.doc" displayname="test.doc">'.

SPLIT l_str_xml AT '"' INTO TABLE lt_str.


Hope it helps,


If you want to know more about splitting strings, check the following link:

String Processing - ABAP Development - SCN Wiki


regards

Read only

Former Member
0 Likes
441