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

Find string between two same character

Former Member
0 Likes
3,192

Hi Expert,

    I have requirement  to find a string between two char in XML list where to pick the value 'companyland' ..?

eg: <askl>jdflsjdf<lskfjlsd>fjslfjklsdjf sdf<hello>companyland<hello>.lsjflsjflsjdflksj<fljsdfjskldflsj>

      <alsdfjklsjflsjdfsdf>

Thanks

savitha.

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,874

Please clarify what you have tried yourself so far.

There are simple ABAP commands to work with the strings as well as other options to process XML data specifically. All of this is documented and has been discussed on SCN already, so should be available on Google. Is there any particular reason you were unable to find an answer there?

7 REPLIES 7
Read only

Former Member
0 Likes
1,874

Did you check whether "Search" solves your problem?

eg:

data: lv_xml_data type string.

lv_xml_data = '<a>dasfsdf</a><b>afdsfsafklj</b>'.

search lv_xml_data for 'the string you want to search'. 

-Chandra

Read only

0 Likes
1,874

Hi Chandra,

     search value is not constant it may be different. i think we have to find any string operation.

Thanks

Savita.

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,875

Please clarify what you have tried yourself so far.

There are simple ABAP commands to work with the strings as well as other options to process XML data specifically. All of this is documented and has been discussed on SCN already, so should be available on Google. Is there any particular reason you were unable to find an answer there?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,874

Could you define your requirement more precisely or just read some doc as Character String and Byte String Processing / Expressions and Functions for String Processing.

Regards,

Raymond

Read only

jrg_wulf
Active Contributor
0 Likes
1,874

Hi,

why do you think anyone might feel the urge to help you, when you can't even be bothered to give a meaningful example, or at least an Explanation for what you need.

As Jelena already pointed out, there are loads of threads in scn and all over the web, covering almost every angle of XML processing in abap.

Easily to be found here.

BTW: consider to edit your example, so that one can at least distinguish between tags and values. As it is, it does not nearly represent anything related to XML but is just gibberish.

Best regards - Jörg

Read only

Former Member
0 Likes
1,874

This message was moderated.

Read only

Former Member
0 Likes
1,874

As the tags are XML alike, you could try this:

Execute function module SCMS_STRING_TO_XSTRING with importing parameter TEXT =<tAG>amount</TAG>.

The restult will be in the exporting parameter buffer.

execute function module SMUM_XML_PARSE and use the buffer as input for XML_INPUT.

the table XML_TABLE will have what you need 🙂