cancel
Showing results for 
Search instead for 
Did you mean: 

displaying XML data in Web UI

Former Member
0 Kudos

Hi All,

I have XML string in one of attribute of view controller class, I need to display it in Web UI, how I can achieve it?

which is the HTMLB tag I need to use at .HTM of view...?

Thanks,

VjmHyd

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nitish/Viswanath,

Here I am having one field which is getting populated from one of data base table,

this table have survey questions and answers in XML format.

So I need to display this field content in Web UI...

How I can do this?

Regards,

VjmHyd

Former Member
0 Kudos

Hii,

Is that answer field is related to any context node view of a component .

Oe else you can use thtmlb input field tag.

    <thtmlb:inputField id = "ELEMENT ID"           

                        value         = "<%= lv_xml %>"  

                       tooltip       = "Xml field "
                       disabled      = "FALSE"
                       width         = "90%"

      />

Regards,

Nithish

Former Member
0 Kudos

Hi Nitish,

I need to display XML data which is having multiple lines...

above code is trying to displaying in same line, as well is data formating will it handle itself...

ex - XML data as below

<head><title> XYZ Survey</title></head><body style="font-family:verdana; background-color:#FFFFFF; color:#000000;"><table width="90%"><tr><td align="left" bgcolor="#FFFFFF"></td><td align="left" bgcolor="#FFFFFF"><p>This is a customer response from the xxx<br /><br />

Regards,

Vjmhyd

Former Member
0 Kudos

Hi  ,

Try this text view tag

                  <thtmlb:textView id = "XMLstring2"
                       text       = "<%= lv_xml %>"
                       layout     = "BLOCK"
                       wrapping   = "TRUE"

                   />

Regards,

Nithish

Former Member
0 Kudos

Hi Nitish,

Above tag will perfectly work fine for displaying text...

my question now is :

I am having text data in XML/HTML format and need to display it in Web UI, is it possible to get this displayed in proper output format

i.e. as we know if we try to store the XML code provided below in notepad and try to save as .HTM then try to execute the generated Web link then it will display in user readable format as below.

i.e.

<head> <title>XYZ Transactional Survey</title> </head> <body

style="font-family:verdana; background-color:#FFFFFF; color:#000000;">

<table width="90%"><tr><td align="left" bgcolor="#FFFFFF"></td> <td

align="left" bgcolor="#FFFFFF"><p>This is a customer response from the

XYZ Customer Experience Program.<br /><br />You are receiving this

response for information purposes. Please review the customer survey as

it holds valuable information on the customer's rating of

XYZ.</p></td></tr> <tr> <td align="left" valign="top"

bgcolor="#FFFFFF"></td> <td bgcolor="#FFFFFF"><table width="100%"> <tr>

<td valign="top">1. <b>This section is related to your general

experience with XYZ.</td> </tr> <tr> <td></td> </tr> </table></td>

</tr><tr> <td align="left" valign="top" bgcolor="#FFFFFF"></td> <td

bgcolor="#FFFFFF"><table width="100%"> <tr> <td valign="top">

above should get displayed as below :

This is a customer response from the XYZ Customer Experience Program.

You are receiving this response for information purposes. Please review the customer survey as it holds valuable information on the customer's rating of XYZ.

1. This section is related to your general experience with XYZ.

how to achieve above in Web UI...? which tags will help me...?

regards,

VjmHyd

Former Member
0 Kudos

Hi All,

used the tag <html> </html> in .htm page of bsp.

Thanks,

Vij

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

check out below code you can get to know

<%@page language="abap" %>

<%@extension name="chtmlb" prefix="chtmlb" %>



<%

  DATA: lv_xml               TYPE string,

        lv_visible_row_count TYPE string.



  lv_xml = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).

  if ui->get_searchcollapsed( attribute_path = '' ) eq abap_false.

    lv_visible_row_count = '10'.

  else.

    lv_visible_row_count = '20'.

  endif.



  data: lv_row_sel_event     type string,

        lr_cuco              TYPE REF TO cl_bt108s_l_cucosearch_impl.



  lr_cuco ?= controller->get_custom_controller( 'BT108S_LEA/CucoSearch' ).

  IF lr_cuco->gv_process_mode EQ 'VALUEHELP'.

    lv_row_sel_event = 'SINGLESELECTION'.

  ELSE.

    lv_row_sel_event = 'select'.

  ENDIF.



%>



<chtmlb:configTable xml                   = "<%= lv_xml %>"

                     id                    = "ResultTable"

                     onRowSelection        = "<%=lv_row_sel_event%>"

                     table                 = "//Result/Table"

                     width                 = "100%"

                     downloadToExcel       = "<%= controller->gv_downloadtoexcel %>"

                     actions               = "<%= controller->gt_button %>"

                     actionsMaxInRow       = "6"

                     selectionMode         = "<%=Result->selection_mode %>"

                     selectedRowIndex      = "<%=Result->selected_index %>"

                     selectedRowIndexTable = "<%=Result->selection_tab %>"

                     usage                 = "SEARCHRESULT"

                     visibleRowCount       = "<%=lv_visible_row_count %>"

                     reset                 = "<%= controller->gv_clear %>"

                     showNoMatchText       = "FALSE"/>

otherwise goto BT108S_LEA check out the result view and resultac view....

Former Member
0 Kudos

Hi,

In web UI , where do you want to display- under any context nodes or as a separate input field ??

Regards,

Nithish