cancel
Showing results for 
Search instead for 
Did you mean: 

Field Display in web Page

Former Member
0 Kudos

Hi,

I have a BSP page that basically displays the data in an ABAP Internal table in my web page. Its a simple loop and display.

One of the fields is an Amount field and needs to be displayed in the format : 123,454,452.89 . But in my web report its displaying with the comma as: 123454452.89

How can i make it to display with a comma?

Raj

<% Loop at it_result into wa_result.%>

<tr>

<td> <%= wa_result-VAL_TYPE %> </td>

<td> <%= wa_result-CONTROL_RULE%> </td>

<td> <%= wa_result-CONTROL_AMOUNT%> </td>

<td> <%= wa_result-COMPARE_RULE%> </td>

<td> <%= wa_result-COMPARE_AMOUNT %> </td>

<td> <%= wa_result-DIFFERENCE %> </td>

</tr>

<%

Endloop.

%>

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Try:

<% page->to_string( wa_result-COMPARE_AMOUNT ). %>

I'm doing that from memory, but I'm fairly sure the to_string is in the page object.

This will use the user's current number format to output the amount.

Former Member
0 Kudos

Thomas I am getting this message.

Statement "PAGE->TO_STRING(WA_RESULT-CONTROL_AMOUNT)" is not defined.

Apart from the below 2 statments I did not define anything else in the layout of my bsp page.

<%@page language="abap" %>

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

I am a bw developer and am trying to display an abap report along with my other bw web reports here.

Pls suggest.

Raj

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It compiles fine:


          <% page->to_string( wa_results-control_amount ). %>

the spacing is important.

Perhaps you should try to display your table using the TableView element instead. It is <htmlb:tableView>. It will take care of all inner formmating for you and give you a much nicer looking display.

Former Member
0 Kudos

Thomas Great!

Thanks for the suggestion. Full points to u.

Raj

Answers (0)