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

Byte or Character String search

Former Member
0 Likes
798

Can anybody guide how to found the  'Byte or Character String' from any web url through sap wheather the given 'Byte or Character String'  it is avalible or not?

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
740

In your code you could try to use CL_HTTP_CLIENT->RESPONSE->GET_CDATA to get the content of the web page in a string.

You could convert it to a readable format like W3HTML with a call of FM CONVERT_STRING_TO_TABLE. the resultant internal table can be used for display with CL_GUI_HTML_VIEWER->LOAD_DATA and ->SHOW_DATA (instead of direct SHOW_URL) then use standard Abap tools with the loaded internal table.

Look also a demo SAP report like RSDEMO_HTML_VIEWER.

Regards,

Raymond

6 REPLIES 6
Read only

Former Member
0 Likes
740

can u please elaborate  your question.....

Read only

0 Likes
740

Hi ganesh,

i am opening web url throuh sap, In my scenario i have a two input fields in module pool screen  with custom container screen element. In the first input field used to enter web url and second field is used to enter required word to found the given word exist or not in given url and container used to show url.

For example i am opening www.google.com  url in custom container. After that i am given 'Search'  word in second field and  peforming action. In this action i need to find wheather  this 'Search' key  is avalible or not in given url. If not i need to show error message.

Read only

0 Likes
740

Hi Ashok,

You can use string operations "CS" - contains string.

Through this you can check the required substring in URL that was already generated.

Reward if helpful.

Regards,

Mahidhar.

Read only

0 Likes
740

Hi Mahidhar,

In my screnario i am interacting with non sap, so how can i use 'CS'. Can you please provide a sample code how to search given word from given url.

Regards,

Ashok.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
741

In your code you could try to use CL_HTTP_CLIENT->RESPONSE->GET_CDATA to get the content of the web page in a string.

You could convert it to a readable format like W3HTML with a call of FM CONVERT_STRING_TO_TABLE. the resultant internal table can be used for display with CL_GUI_HTML_VIEWER->LOAD_DATA and ->SHOW_DATA (instead of direct SHOW_URL) then use standard Abap tools with the loaded internal table.

Look also a demo SAP report like RSDEMO_HTML_VIEWER.

Regards,

Raymond

Read only

0 Likes
740

Hi Raymond

cl_http_client->response->get_cdata( ) is working. Thanks for giving response.

Regards,

Ashok.