Simple Calculations in BPS Web

Hi,
I am using the BPS web layouts (ALV Grid not the Excel Web Component). I would like to add a couple of very simple calculations (difference of columns/percentages etc). Is it possible to do this without using the Excel OWC ?
Thanks
Shailesh

Hi
the simplier way to achieve yor result is to use FOx formula to calculate your results at runtime .
You should create a formula function and add FOX code to it .
Check this link for examples
http://help.sap.com/saphelp_nw04/helpdata/en/d3/8057f830a911d4b2be0050dadfb23f/frameset.htm
Hope it helps
Andr

Similar Messages

  • Web Dynpro Application For developing a simple calculator

    Dear Experts,
    I am trying to develop a simple calculator application in abap web dynpro .
    but i am not able to enable the buttons (1 to 9) . that is what i want is like how it happens in a normal calculator if we press 1 , then in the screen, 1 comes and if 11 then twice we press 1. Like wise i want if the button 1 is enabled then in the input field it should take 1 and if 11 then it should take 11. Kindly give some suggestions to develop this application.
    Regards
    Swarnadeepta

    Hi Swarnadeepta,
    I developed a calculator in web dynpro...please go through the following code. I have made a few changes with respect to modularization but the basic concept is still the same.
    Method to Enter Data on the screen
    METHOD enter_data .
      DATA lv_input TYPE i.
      DATA lv_flag TYPE c.
    ***Read input in the screen 
    wd_this->get_input(
        IMPORTING
          ev_input = lv_input                       " integer
    ***See whether flag is set. If yes save the present value in global attribute gv_previous.
      wd_this->get_flag(
        IMPORTING
          ev_flag = lv_flag                        " wdy_boolean
      IF lv_flag = 'X'.
        wd_this->gv_previous = lv_input.
        lv_input = 0.
      ENDIF.
    ***Modify screen input
      IF lv_input IS INITIAL.
        lv_input = iv_number.
      ELSE.
        lv_input = lv_input * 10 + iv_number.
      ENDIF.
    ***Set the new value of input field
      wd_this->set_input(
        iv_input = lv_input                          " integer
    ***Reset the flag
      wd_this->set_flag(
        iv_flag = ''                           " wdy_boolean
    ENDMETHOD.
    Use the above method on button click
    method ONACTIONONE .
      wd_this->enter_data(
        iv_number = 1                        " integer
    endmethod.
    Method to Register Operations
    method ENTER_OPERATION .
      wd_this->set_flag(
        iv_flag = 'X'                           " wdy_boolean
      wd_this->set_operation(
        iv_operation = iv_operation                      " string
    endmethod.
    Use of above method in operations button
    method ONACTIONADD .
      wd_this->enter_operation(
        iv_operation = 'ADD'                     " string
    endmethod.
    Method to calculate
    method ONACTIONEQL .
    DATA lv_operation TYPE string.
    DATA lv_input TYPE i.
    ***Read screen input 
    wd_this->get_input(
         IMPORTING
           ev_input = lv_input                        " integer
    ***read operation requested
      wd_this->get_operation(
        IMPORTING
          ev_operation = lv_operation                   " string
    CASE lv_operation.
    WHEN 'ADD'.
    lv_input = wd_this->gv_previous + lv_input.
    WHEN 'SUB'.
    lv_input = wd_this->gv_previous - lv_input.
    WHEN 'MUL'.
    lv_input = wd_this->gv_previous * lv_input.
    WHEN 'DIV'.
    lv_input = wd_this->gv_previous / lv_input.
    WHEN OTHERS.
    ENDCASE.
    ***Set the new value of input field
      wd_this->set_input(
        iv_input = lv_input                         " integer
    ***Clear the operation attribute
      wd_this->set_operation(
        iv_operation = ''                     " string
    endmethod.
    Getter Methods example for attribute INPUT
    method GET_INPUT .
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_input TYPE wd_this->element_context-input.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_context IS INITIAL.
      ENDIF.
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `INPUT`
        IMPORTING
          value = lv_input ).
    EV_INPUT = lv_input.
    endmethod.
    Setter Methods example for attribute INPUT
    method SET_INPUT .
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_input TYPE wd_this->element_context-input.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_context IS INITIAL.
      ENDIF.
    @TODO fill attribute
    lv_input = iv_input.
    set single attribute
      lo_el_context->set_attribute(
        name =  `INPUT`
        value = lv_input ).
    endmethod.
    Hope this will be helpful. Let me know if you have any doubt.
    Its working fine for me.
    Regards,
    Sayan

  • Has anyone seen a simple calculator pod that will work in Acrobat Connect Pro?

    I need a simple calculator to total up responses from participants in web meetings. Does anyone know of one that can work as a pod where everyone will see the numbers that are pushed and the calculation display?

    If this one works with you: http://connect.wezupport.se/p39142940/
    I've attatched so you can download it from here - cheers

  • Simple calculations not working in acrobat 9

    I have text form fields made in Acrobat 9 from a previously made pdf, where I need a simple calculation, but I cannot get it to work.
    The form is not for submission, only for personal tracking, so I don't even need validation.
    FieldA (a number they enter) x a number I have entered in the calculation = FieldB
    FieldB x FieldC (a number they enter) = FieldD In FieldB I have a simple javascript Calculation in the form field: FieldA * .115, which should automatically calculate answer into FieldB, when tabbed.
    In FieldD I have a Calculation in the form field: FieldB * FieldC, which should automatically calculate answer into FieldD. All fields are set as numbers.
    I have left the Trigger Action as Mouse Up.
    I don't need to validate, as this is personal use, and is not being submitted.
    I have all fields in the correct tab order.
    I have reader enabled the form. When I open the form in Reader, I can enter the numbers, but no calculations are being performed. It reads 0 in FieldB and FieldD. Any assistance would be greatly appreciated.

    Hello Everyone,
    I use the following VBS code, but to tell the truth, I don't know if it works or not. The main idea was to enable commenting from Adobe Reader. But after execution code, saving document and reopening it in Reader, commenting is still 'Not Allowed'. Is showAnnotToolsWhenNoCollab really capable to allow this and there is only error in my code? Or is the functionality different and this way can never be used for what I want?
    There is another issue that application is not closed on Exit, but is still shown.
    scriptPath = "C:\Acrobat\"
    Set gApp = CreateObject("AcroExch.App")  
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    sampleFilePath = scriptPath & "AR_test_orig.pdf"
    pdDoc.Open sampleFilePath
    pdDoc.OpenAVDoc "myFile"
    gApp.Show
    Set formApp = CreateObject("AFormAut.App")
    'formApp.Fields.ExecuteThisJavascript "app.alert(""hello"");"
    formApp.Fields.ExecuteThisJavascript "Collab.showAnnotToolsWhenNoCollab = true;"
    Set formApp = Nothing
    pdDoc.Save 1, scriptPath & "AR_test.pdf"
    'pdDoc.Close
    gApp.CloseAllDocs
    gApp.Exit
    Set pdDoc = Nothing
    Set gApp = Nothing
    Thanks for any ideas.
    Jan
    PS: I use Acrobat 9.0 Pro

  • Simple calculations in Universe not working for XI 3.0

    Simple calculations in Universe using key figures are not working in XI 3.0(without any Fix Pack)
    Below is the steps I followed.
    1. Using key figure [Jan] I am trying to round the values by deviding it by 1000.
    <EXPRESSION>@Select([Jan])/1000</EXPRESSION>
    This gives me a null cell value.
    2. I tried addition then
    <EXPRESSION>@Select([Jan])+1000</EXPRESSION> result was all the cell values changed to 1000.
    3. Finally without calculation I tried
    <EXPRESSION>@Select[Jan]</EXPRESSION> this also resulted null value
    But without EXPRESSION tag if I try @Select[Jan] it works fine.
    Am I missing anything in above expressions.
    As of now I am creating variable in report to incorporate the rounding.
    Thanks
    Raghu

    It was my mistake while writing the question. Path I have used is correct one only @Select(Key Figures/.
    If i use the above alone, I am able to se the data. But if I use in betwen <EXPRESSION> then it gives null value.
    Note: Pls dont confuse with flower bracket i used it just to avoid coverting it to a html link and also the backslash it was not showing in preview
    I have followed that pdf and created calculation in universe.
    Edited by: Raghavendra Barekere on Feb 6, 2009 6:42 AM

  • How to call a BPS Web Interface with predefined selections

    Hi,
    I have read and try to implement the "How to... call a BPS Web Interface with predefined selections" but it is not working.
    I have one Web Interface called ZXXXXX, then I created one BSP and copied the ABAP code into the Layout screen.
    I checked the ABAP and it concatenates and fill the variable l_url, but the page is not displayed.
    l_url = /sap/bc/bsp/sap/zxxxxx/zxxxxx.htm 
    I have checked that I have no errors in the BPS variables and its values.
    It just opens internet explorer and the page displays "<<<" in the top of the screen.
    I am working with BW7.0 and BPS 3.5.
    If anyone can help me it will be rewarded,
    Thanks a lot,
    Fernando

    I think the problem is in the last part of the code.
    <frameset framespacing=0 frameborder=0 border=0>
    <frame src="<%= l_url%>" name="x" framespacing=0 frameborder=0 border=0
    marginwidth=0 marginheight=0>
    </frameset>
    It is doing nothing in this point, but the ABAP fills correctly the l_url variable.
    Thnks

  • Need help with starting a simple calculator

    I have this simple calculator I just started on, and I'm having just a few problems. First of all, I don't know how to append text to a textfield. Maybe I would have to create a string buffere or something. Then, when the user clicks one of the buttons, the compiler goes crazy, and nothing is displayed.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Calculator extends JFrame implements ActionListener
         JButton[] btnNums;
         JButton btnBack;
         JButton btnClear;
         JButton btnCalculate;
         String[] strNames;
         JTextField txtDisplay;
         public Calculator()
              Container content = getContentPane();
              setSize(210,250);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              /*  construct a JPanel and the textfield that
               *  will show the inputed values and outputed
               *  results
              JPanel jpDisplay = new JPanel();
              jpDisplay.setLayout(new BorderLayout());
              txtDisplay = new JTextField(15);
              txtDisplay.setHorizontalAlignment(JTextField.RIGHT);
              jpDisplay.add(txtDisplay);
              /*  contstruct a JPanel that will contain a back
               *  button and a clear button.
              JPanel jpRow2 = new JPanel();
              btnBack = new JButton("Backspace");
              btnClear = new JButton("Clear");
              btnClear.addActionListener(this);
              jpRow2.add(btnBack);
              jpRow2.add(btnClear);
              /*  construct a string array with all the names of the
               *  buttons, then in a for loop create the new buttons
               *  and add their name and an actionListener to them.
              String[] strNames = {"7","8", "9","/", "4", "5", "6","*", "1", "2", "3","+", "0", "+/-", ".", "-"};
              btnNums = new JButton[16];
              JPanel jpButtons = new JPanel();
              jpButtons.setLayout(new GridLayout(4,4));
                for (int i = 0; i < 16; i++)
                     btnNums[i] = new JButton(strNames);
                   btnNums[i].addActionListener(this);
                   jpButtons.add(btnNums[i]);
              /* construct the final JPanel and add a
              * calculate button to it.
              JPanel jpLastRow = new JPanel();
              btnCalculate = new JButton("Calculate");
              btnCalculate.addActionListener(this);
              jpLastRow.add(btnCalculate);
              /* set the contentPane and create the layout
              * add the panels to the container
              setContentPane(content);
              setLayout(new FlowLayout());
              setResizable(false);
              content.add(jpDisplay, BorderLayout.NORTH);
              content.add(jpRow2);
              content.add(jpButtons);
              content.add(jpLastRow);
              setTitle("Mini Calculator");
              setVisible(true);
         public void actionPerformed(ActionEvent ae)
              for (int i =0; i < 16; i++)
                   if (ae.getSource() == btnNums[i])
                        txtDisplay.setText(strNames[i]);
         public static void main(String[] args)
              Calculator calc = new Calculator();

    First of all, I don't
    know how to append text to a textfield.
    textField.setText( textField.getText() + TEXT_YOU_WANT_TO_APPEND );
    Then,
    when the user clicks one of the buttons, the compiler
    goes crazy, and nothing is displayed.No, the compiler doesn't go crazy, the compiler has done it's job by then. However, you do get a NullPointerException, and the stacktrace tells you that the problem is on the following line:
    txtDisplay.setText(strNames);
    It turns out that strNames is null. I leave it to you to find out why. ;-)

  • Trying to add a simple applet to a web page

    Well, I was trying to add a simple applet to a web page(php nuke Home section), it didn't fin my applet, so I changed it and added it to a simple html file to make it as simple as I could get it.
    This is the code in the html file:
    <applet code="usblock.class" width="400" height="400">The browser doesn't support applets...</applet>The directory: www/usblock.html & www/usblock.java & www/usblock.class - As you can see the files are all in the same directory/folder.
    usblock.java code:
    import javax.swing.*;
    import java.awt.*;
    public class usblock extends JApplet
         public void init()
              JPanel p = new JPanel(new BorderLayout());
              p.add(new JLabel("Heisann"));
              add(p, BorderLayout.CENTER);
    }now as I open the html local on my computer, it workes. As soon as I open the usblock.html from my website, it doesn't.
    It gives me this error here:
    load: class usblock.class not found.
    java.lang.ClassNotFoundException: usblock.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 moreSo I thought it was that it couldn't find the .class file. Well, I went through the How To add applets that I found somewhere on sun.com. It had exactly the same as I had.
    Im figuring the problem is something easy and not hard to detect. But my eyes can't find it somehow. This is my second time trying applets, and I kinda forgot how I got it to work the first time.
    Im just glad for all the help I can get.
    Thanks a lot.
    LordSvae
    PS: Sry for the size of the post, but I'm not sure how much info I was supposed to put in here, so I thought the more the better, right? :S

    Hii,
    I doesn't know the solution but same kind of problem is come with me & I found that the problem is of Path i.e. you need to set a codebase attribute . For tempory solution what i do i simply copy the .class file in to html file dir.

  • Calling Methods inside BPS Web Excel

    Hi,
    Inside the layout2.htm file of a BPS Web Excel BSP application, there is some javascript,
    layout_sheet.style.height
    and
    layout_sheet.style.width
    , which control the height and width of the input and output layout screens.  The code calls the methods
    <%= layout->get_width( ) %>
    and
    <%= layout->get_height( ) %>
    .  What I have done is modified the screen so it dynamically adjusts to fit both the input and output layouts into the users screen, independent of their resolution, since not everyone has the same screen resolution.
    In doing some research, there is another method,
    layout->set_width( )
    , that allows you to set the screen size for future reference. 
    How is it possible to take a value from javascript and submit it to this method?  I have tried to set the javascript inside the parenthesis, but I get a compilation error then.
    I hope I explained this well
    Cheers!!
    Kevin

    Hello Marc,
    We modified the JS3.htm too. just to have the possibility to use an autosave function. For instance if the planner doesn't do anything for 5 mins then save
    This have to be done that way because of the architecture of the Web Interface. I mean Switching between frames means having 2 autosave timer if the coding would have been in a Text component
    Best regards
    Yannick
    Message was edited by: Yannick Sigwalt
    Kevin: Is it possible to get the coding of what you have implemented? sounds really interesting

  • BPS/Web: 'Your previous query is still being processed'

    Hi,
    One of our users get the following message when clicking on a page link in a BPS web application we designed:
    'Your previous query is still being processed'. The user is only clicking once on the link and gets in an endless loop (when monitoring the system, no activity can be seen).
    All our other users are fine. We checked the internet explorer settings of this user and they are identical to all the other users. We know it is not linked to the user ID or the portal.
    Has anyone already seen this ? Any idea where we should look at ?
    Thanks for any help.
    David

    Hello David,
    on one hand you are saying only one user has the problem but on the other hand you write that it's not linked to the user ID?
    If the frontend settings are OK, then it might be a firewall issue. Some of them block ports or filter JavaScript.
    Regards,
    Marc
    SAP NetWeaver RIG, US BI

  • Debug BPS web application interface

    DEar All,
    Would you please let me know how to active a debug in a BPS web applicatin interface.
    I heard that something could be done under transaction se80, but what ?
    Many thanks for your big help !

    Hi,
    Here are the steps for activating the debugging,
    The <b>B</b>usiness <b>S</b>erver <b>P</b>age name is same as the name of the web interface
    Goto SE80 on the left side dropdown select BSP application and give the name of the BSP = interface name.
    Click on utilities->settings select tab ABAP Editor. Within this there are 4 tabs select the last one named Debugging. Select the check box named Actv and key ur user name (it should default to it). Hit Ok.This step is little diff depending on the WAS version.
    Click the display icon on the left side this will display the componenets of BSP. In the tree open the node Pages with Flow logic. There will be a component called PM_PAGE.HTM double click on it. Click on a line that's executable (blue) and then click on the STOP button on the application toolbar.
    This should do the job. let me know if you need more information
    thanks

  • BPS Web Application - How to change function button property dynamically

    We have created BPS web application for sales force, it contains 2 button.
    1. To send Workflow notification to Managers 'Request for Approval' - This would be used by sales person
    2. Button for Manager to approve the Plan 'Manager Approval' - This would be used by the Manager
    We are using Territory Management in CRM to determine who is the manager and sales person.
    We would like to use the same Web application to be used by both sales person as well as the manager. However depending on the user ID, we need to access the Territory Management table in BW to determine whether the person logging in is Manager / Sales person. If it is a Sales Person, we need to display 'Request for Approval' button and hide 'Manager Approval'  button. Similarly, if it is Manager,   'Manager Approval'  button to be displayed and 'Request for Approval' button to be hidden.
    Would appreciate, if any one has faced similar requirement and how to do this.
    Thanks,
    VJ Sudharsan

    Thanks Ananad and Srini for the suggestion. Actually I was working on the direction Anand Suggestion and make it working but I am not sure what I did is correct or not.
    I have a bogus variable that checks for Manager / Sales person and brings back following code in the variable, if it is manager:
    '<style> #Req_Approval_s </style>'
    and I added a new text component of type HTML and code
    <%=descr(VarvlSel2/value)%>
    it works. Is this the correct way of doing the enhancement. Or is there a different place where we can add JavaScript.
    Srini - I am using exit function, can you explain how we can I use BPS authorization to achieve this.

  • Texts on bps web (excel OWC)

    Hello gurus.
    I have a bps web based (excel owc).
    SAP Gui is defined on english, but web is defined as portuguese. How can I redefine as english?
    I have the problem with texts, i define them in english but it doesn´t appear on web...
    Thks.
    Vitor
    P.S. Points will be regarded.

    Hi Vitor,
    I am not sure, I don´t know URL possibilities that much.
    If there is already any parameter in the url showing a language, then just try to change it.
    If not, you can probably just put one at the end of the URL should be something like language=EN.
    regards
    Cornelia

  • BPS Web Interface don't show multiple documents for each cell

    Hi gurus,
    I have an issue... we are trying use text documents from BPS on the WEB interface. Everything works fine, I can input text documents on each cell on the web, and from Query as well.
    I saved several other documents from the query for the very same cell, and I can see these other documents from BPS itself or from the Query by clicking on the title... but on BPS WEB interface, it shows only the last text document saved.
    Is there anything wrong on the configuration, or is it possible for the WEB interface to show the titles so that the user can choose which document he wants to open?
    Thanks in advance,
    Chen

    Hi Luke,
    did you check whether the document attributes are generated for your Characteristics?
    AWB -> Documents -> Administration -> Generated Properties
    There is also a SAP Note 431126, which you might want to consult.
    Regards,
    Eric

  • How to adjust width into BPS web Layout

    Hi gurus,
      I´m working with BPS web Interface. I have a tabstrip control subcomponent composed by 3 differents layouts and the web interface is composed by differents tabstrip.All of this layouts represents the same information but restricted to differents characteristic value.  I need to align the data of those layouts, I mean the first column of the first layout should have the same width as the first column of the second layout etc.
    The idea is adjust the width of the columns of each layout in this tabstrip control. How can I do that? Is possible do that with CSS Styles? If it is possible How can I do that?
    Thanks in advance for your help.

    Hi,
    Try this may be useful for you..
    In the Web interface when you double click the layout , you can see the window at the bottom saying your component name ,planning area etc..at the bottom most you can see the Width and height , there you can increase or decrease .
    before that make excel web component as 'True', then only you can increase or decrease ..
    Regards,
    Siva.

Maybe you are looking for

  • Nano shuts down iTunes

    Hi, I have just got a new iPod nano (2nd Gen 2 gig) and following the instructions, left it connected for 3 hours. Now whenever I try to click on a folder in iTunes to move some music to the Nano manually it shuts iTunes - actually it's not quite a s

  • What is the problem in my Connection Pool ???

    Hello,guys: My using connection pool is in trouble,it always dies and does't output any error messages(can not get an available connection),so I should restart my Tomcat(4.1), The following code in Login.jsp page initializes the pool : <%      Connec

  • OracleCommandBuilder

    When using SQL Server you can use the following code to discover stored procedure parameters. Can the same thing be accomplished in Oracle? Private Shared Function DiscoverSpParameterSet(ByVal connectionString As String, _ ByVal spName As String, _ B

  • How can I change the viewer settings when I publish an Aperture gallery to my iCloud Photostream ?.

    I used to rely on MobileMe to share photo galleries with clients and it worked great, but now with the iCloud, I can create a public album on my iCloud - PhotoStream (that does not need an Apple ID to access) but it seems to be limited to just an asy

  • Backup iPhoto Library to iDisk

    I tried to backup my 2.4 gig iPhoto library to iDisk via the finder. It was so slow as to be unusable. I tried to backup via the browser but it has a 1 gig limitation. Is there any way to split up the iPhoto library to get under the 1 gig limit? It a