<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABAP Dynpro - HTML control - access HTML data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166944#M1516657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can do it with script execution :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_GUI_HTML_VIEWER has methods for executing scripts,  "set_script" and  "execute_script"&lt;/P&gt;&lt;P&gt;but you should use inheritance first  because these methods are Protected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In JavaScript this code used for setting a value in an HTML input :&lt;/P&gt;&lt;P&gt; 'document.getElementById('INPUT_FIELD_NAME).value = 'Hello'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a result of them, Here is my class :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_gui_html_viewer_extend DEFINITION&lt;/P&gt;&lt;P&gt;INHERITING FROM cl_gui_html_viewer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;    set_input_value&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ip_input_name TYPE c&lt;/P&gt;&lt;P&gt;      ip_value TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_gui_html_viewer_extend IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_input_value.&lt;/P&gt;&lt;P&gt;    DATA : t_script TYPE TABLE OF char100,&lt;/P&gt;&lt;P&gt;           w_script LIKE LINE OF t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE&lt;/P&gt;&lt;P&gt;    'document.getElementById(''' ip_input_name ''').value ='&lt;/P&gt;&lt;P&gt;    '"' ip_value '"' INTO w_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND w_script TO t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD set_script&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        script = t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD execute_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this class instead of CL_GUI_HTML_VIEWER in your code. &lt;/P&gt;&lt;P&gt;and call method set_input_value to set a value in an HTML input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will be useful for u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Aug 2010 14:00:04 GMT</pubDate>
    <dc:creator>bbalci</dc:creator>
    <dc:date>2010-08-09T14:00:04Z</dc:date>
    <item>
      <title>ABAP Dynpro - HTML control - access HTML data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166943#M1516656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dynpro application with a HTML-control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load a web page into the HTML-control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to fill the fields in the web page automatically?&lt;/P&gt;&lt;P&gt;(For example a javascript file will be executed from ABAP and then a value will be filled into a textfield.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or how can I fill the fields in the web page?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Aug 2010 11:15:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166943#M1516656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-09T11:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Dynpro - HTML control - access HTML data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166944#M1516657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can do it with script execution :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_GUI_HTML_VIEWER has methods for executing scripts,  "set_script" and  "execute_script"&lt;/P&gt;&lt;P&gt;but you should use inheritance first  because these methods are Protected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In JavaScript this code used for setting a value in an HTML input :&lt;/P&gt;&lt;P&gt; 'document.getElementById('INPUT_FIELD_NAME).value = 'Hello'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a result of them, Here is my class :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_gui_html_viewer_extend DEFINITION&lt;/P&gt;&lt;P&gt;INHERITING FROM cl_gui_html_viewer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;    set_input_value&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ip_input_name TYPE c&lt;/P&gt;&lt;P&gt;      ip_value TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_gui_html_viewer_extend IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_input_value.&lt;/P&gt;&lt;P&gt;    DATA : t_script TYPE TABLE OF char100,&lt;/P&gt;&lt;P&gt;           w_script LIKE LINE OF t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE&lt;/P&gt;&lt;P&gt;    'document.getElementById(''' ip_input_name ''').value ='&lt;/P&gt;&lt;P&gt;    '"' ip_value '"' INTO w_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND w_script TO t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD set_script&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        script = t_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD execute_script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this class instead of CL_GUI_HTML_VIEWER in your code. &lt;/P&gt;&lt;P&gt;and call method set_input_value to set a value in an HTML input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will be useful for u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Aug 2010 14:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166944#M1516657</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-08-09T14:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Dynpro - HTML control - access HTML data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166945#M1516658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there also a method how to read the values from the HTML page back to the ABAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try it this way but the error is:  CL_JAVA_SCRIPT, Rcode: (   600 ), Error at line 1    : ReferenceError: document is not defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; js_processor = cl_java_script=&amp;gt;create( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE&lt;/P&gt;&lt;P&gt;  'var string = document.getElementById(''' ip_input_name ''').value;'&lt;/P&gt;&lt;P&gt;  INTO source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE source&lt;/P&gt;&lt;P&gt;    'function Set_String()                  '&lt;/P&gt;&lt;P&gt;    '  { return (string);                   '&lt;/P&gt;&lt;P&gt;    '  }                                    '&lt;/P&gt;&lt;P&gt;    'Set_String();                          '&lt;/P&gt;&lt;P&gt;      INTO source SEPARATED BY cl_abap_char_utilities=&amp;gt;cr_lf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    js_processor-&amp;gt;compile( script_name = 'HELLO_WORLD.JS'&lt;/P&gt;&lt;P&gt;                         script      = source ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    return_VALUE = js_processor-&amp;gt;execute( 'HELLO_WORLD.JS' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 05:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166945#M1516658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-12T05:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Dynpro - HTML control - access HTML data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166946#M1516659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way to get values from an HTML page is submitting the HTML form &lt;/P&gt;&lt;P&gt;just like user pressed a button on a web page,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than page sends a navigation string with field - value pairs&lt;/P&gt;&lt;P&gt;field1=value1&amp;amp;field2=value2  .. like all web navigations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can parse field values from this string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_GUI_HTML_VIEWER has an event SAPEVENT for that,&lt;/P&gt;&lt;P&gt;you can activate and set a handler for that event &lt;/P&gt;&lt;P&gt;and trigger submit with small JavaScript execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the example in link below can be helpful for this :&lt;/P&gt;&lt;P&gt;&lt;A href="http://abap-explorer.blogspot.com/2008/08/html-through-abap.html" target="test_blank"&gt;http://abap-explorer.blogspot.com/2008/08/html-through-abap.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know further problems if you'd have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 06:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166946#M1516659</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-08-12T06:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Dynpro - HTML control - access HTML data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166947#M1516660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can I use this eventing with an existing webpage?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example the webpage will be build up in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a HTML control where I load a webpage and then I want to know which value is specified in a specific field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 05:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-dynpro-html-control-access-html-data/m-p/7166947#M1516660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T05:38:59Z</dc:date>
    </item>
  </channel>
</rss>

