cancel
Showing results for 
Search instead for 
Did you mean: 

local claculations on HTML Layouts

Former Member
0 Kudos

Hi

We are using the HTML format layouts and I have requirment to calculate the percentages based on two amount fields appearing on the layout. If we were using excel frent-end I am sure that we can do some local calculation by inserting the columns but I am not sure how local calculations can be done on the HTML layouts.

When I insert column in excel it is not being displayed on HTML layout in BSP.

Thanks,Raj.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raj,

Have you taken a look at this How to document, may give some hints as to how you could go about achieving calculations in html format.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to validate key figure values in manual planning - web.pdf

Hope it helps

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Raj,

As an example of creating a button which when clicked returns and message (or it can executes a complex calculation etc):

1. Create a text component with HTML set to 'true'

2. Insert the following javascript which calls a popup:


<script language="JavaScript">
function examplejavascript (){
alert('Hello Raj');
}
</script>

3. Directly below the above mentioned code, insert:


<input type = "button" name = "popup" value = "click me"  size = "15" onclick = "examplejavascript()">

4. Regenerate and execute your web interface

You should have a ugly looking button (you can manipulate the look and feel by adding a class to the button) which throws out a little message when you click it.

Learn and insert any amount of complex javascript using this very simple example.

Good luck,

Rael

Former Member
0 Kudos

Hi Raj,

As mentioned above, you could get in via ABAP in the class structure of your web interface. Alternatively, you can use javascript inserted directly into the text components of your web interface.

If you select 'view source' (right click on your web page) you will be able to see all the source HTML and code for your web interface page. Once you learn how to read it all, you will find that javascript can access (and work with) almost any of the objects you are seeing on your screen.

Watch out, although mosts javascript do not have a front-end performance impact, if you front-end starts to slow down too much, check the efficiency of your coding.....becuase there are instances where it can drain the local CPU.....

Just type 'javascript' into google and your path will begin...

Good luck,

Rael

Former Member
0 Kudos

Thanks a lot Guys. Please let me know if you have a sample code or procedures from your projects that would be helpful to me. Once again thanks for your effor.

Thanks

Raj.