Using a variable to set decimal place in SAPScript

Hi Freinds,
is it possible to use variable as decimal indicator anf if yes please how.
&symbol(E.2)& = two decimal
my intension:
&symbol(E.2)& = to replace 2 with variable e. g. &QAMV-STELLEN&
Thanks,
Blacky

Hi Uma,
For Example
If the output of &EDIDC-DOCNUM& = 50000.231
Then:
&EDIDC-DOCNUM(.2)& = 50000.23
Now my intension:
&EDIDC-DOCNUM(.<variable>)& where <variable> = 2
&EDIDC-DOCNUM(.<variable>)& = 50000.23

Similar Messages

  • In VC WEBDYNPRO compiler mode, how to set decimal places to 2

    The compiler mode is webdynpro,
    The ivew table column's data type is num type,
    The column show a curreny data.
    Now the problem is when the num data is like a number as "1000.00",the ".00" will not show,but when the value is "1000.01" ,it show "1000.01". I want it always show  the formatting like "X.XX".
    There is also no formatting property to set in the column like in flash compiler mode then i can set decimal places to 2.
    What should i do?

    Hi,
    You can use Decimal Format Class and declare something like:
    DecimalFormat df = new DecimalFormat("#,##0.00;(#,##0.00)");
    wdContext.currentContextElement().setSueldoTxt(df.format(wdContext.currentOutputSueldoElement().getPe_Betrg()));
    You'll have the two decimals...!!
    Good Luck and regards,
    Maria Margarita Monteverde

  • Set Decimal Places in a swing

    Ok so i know how to set decimal places in a applet and a command prompt type build but in a GUI i am trying to set them and it isnt working my code is:
    doc.insertString(doc.getLength(), strFICA[j] + "\t", textPane.getStyle("regular"));
    i went and added the information
    Decimal Format twoDigits = new Decimal Format("000.0");
    doc.insertString(doc.getLength(), twoDigits.Format (strFICA[j]) + "\t", textPane.getStyle("regular"));
    it gives me the error cannot find symbol
    symbol: method Format(java.land.String)
    Lacation: Class java.text.DecimalFormat
    doc.insertString(doc.getLength(), twoDigits.Format (strFICA[j]) + "\t", textPane.getStyle("regular"));
    ^
    what does this mean and help will be great

    Help given here is voluntary and people do try hard, but your questions are as unintelligible as they are naive. You really need to do some ground work first by reading the tutorials and trying things out for yourself before posting here.
    Those that get the most help are those that demonstrate they are willing to help themselves more than you seem to be.

  • Smart Forms - Set decimal places in display formatting

    Hello,
    i have a variable (quantity 15 field with 3 decimal places) which i want to print via smartforms.
    sap help describes that you have to set (.<number>)
    for example: &field(.2)& to do that.
    this doesn t work at all.
    Does anybody know how you can do that?
    I would appreciate an answer, because that costs me already alot of time.
    thanks alot!
    Jasmin

    Hi Jasmin,
    We use this notation in a smartform to print weights and it works fine. Perhaps you should also mention the total numbers to display before the decimal?
    We have used: &BRGEW(8.0)&
    Regards,
    John.

  • Using URL variable to set initialy selected ds row

    Hello everyone,
    Could anybody suggest a solution or point me to a working
    demo of a script that processes a URL variable and set the current
    row accordingly. I am trying to pass a @id of a particlar row in a
    URL variable to identify a particluar row, I want to be selected
    initially.
    Thanks,
    Nick

    Hy guys,
    Just figured it out myself. Here is the script:
    <script type="text/javascript">
    // define your datasource. I have called it dsGallery. This
    name is used later in the script a few times
    var dsGallery = new Spry.Data.XMLDataSet("gallery.xml",
    "/gallery/photos/photo");
    dsGallery.addObserver({ onPostLoad: function(ds, type) {
    var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("?") > -1 ){
    var strQueryString =
    strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length;
    iParam++ ){
    if (
    aQueryString[iParam].indexOf('id' + "=") > -1 ){
    var aParam = aQueryString[iParam].split("=");
    strReturn = aParam[1];
    // look if a row with a matching @id is present in the
    datasource
    var row = dsGallery.findRowsWithColumnValues({"@id":
    strReturn}, true);
    // If we have a matching row, make it the current row for the
    data set.
    if (row) dsGallery.setCurrentRow(row.ds_RowID);
    break;
    </script>
    Thanks to the folks whose scrips were really helfull in
    building this one.
    Nick

  • How to use a variable value set from custom dll in dataset

    Hi,
    I've inherited a SSRS report that I need to add some functionality to.  I'm setting a variable, ADAuthorizations, from a custom dll 
    ADAuthorizations is a string of all AD groups a user is a member of and I need to use this as a filter in a dataset.  I've tried using this variable as shown in the query below but I'm getting an error "The expression used for the parameter 'Unit_Permissions"
    in the dataset "Unit_Permissions" includes a variable reference.  Variable values cannot be used in query parameter expressions."  Is there another way I should go about doing this?   
    = "SELECT UnitCode, UnitName " &
      "FROM dbo.VW_Unit_Permissions " &
      "WHERE UserId in (" & Variables!ADAuthorizations.Value & ")" &
      "ORDER BY UnitName "
    Thanks,
    Robert

    Please follow below steps,
    1. Create a custom code to get all the users in an array,
    Public Function getUserName() As String()
       dim Users(1) as string
       Users(0) = "user1"
       Users(1) = "user2"
    return Users
    End Function
    2. Create dataset using the below query,
    SELECT UnitCode, UnitName FROM dbo.VW_Unit_Permissions ORDER BY UnitName
    3. Add a parameter @User and set properties : (Datatype as text, Allow multiple values, Visible)
    Under "Available Values" select specify values and set the label and values as expression.
    =Code.getUserName()
    4. Similarly for "Default values" as
    =Code.getUserName()
    5. Go to tablix properties and select the filter tab and set the properties as below,
    - Select Expression "UserId" i.e =Fields!UserId.Value
    - Operator as "IN"
    - Value as =Parameters!User.Value
    6. Preview the report.
    Regards, RSingh

  • How do I use a variable to set movie clip properties?

    I'm building a simple contact page that allows users to
    select a city from a comboBox. I'd like to pass the selected
    comboBox data through a variable that controls a movie clip with
    the same name. (already on the stage)
    locationListener.change = function (loc_obj:Object) {
    var loc_mc = loc_obj.target.selectedItem.data;
    loc_mc._visible = true;
    So far this hasn't worked. I've tested hardcoding the movie
    clip instance name (Atlanta._visible = true) and it works, but I
    can't figure out why using the variable loc_mc won't trigger
    interaction with the movie clip.
    Something simple, I assume. Thanks in advance for any
    help.

    clbeech:
    I tried using your suggestion, but for some reason it doesn't
    recognize it as naming the movie clip instance. I traced the
    variable and confirmed that the correct value (Atlanta) is being
    passed.
    I assume this is because the variable is not declared as a
    MovieClip, but I can't figure out how to convert it inside the
    function.

  • Set decimal places in Grid

    Hi.
    I have a calculation field in my SQL statement that populates the Grid column and it only shows two decimals.  How do I set it to calculate more than two.  I tried it in the SQL Statement....Convert(decimal(18,3),dbo.RDR1.OpenQty * dbo.OITM.SWeight1).  I dont see any oGrid.Columns.Item("Col12") property????

    Hi guys,
    This is the query im using and the last column(Col12) is a calculation field...
    oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT dbo.RDR1.DocEntry, dbo.RDR1.DocDate, dbo.RDR1.ShipDate, dbo.ORDR.CardCode, dbo.OCPR.Name, dbo.CRD1.City, dbo.RDR1.ItemCode, dbo.RDR1.WhsCode, dbo.RDR1.Quantity, dbo.RDR1.OpenQty, dbo.RDR1.Weight1, <b>CONVERT(decimal(19,3), dbo.OITM.SWeight1 * dbo.RDR1.OpenQty)</b> FROM dbo.OITM RIGHT OUTER JOIN dbo.RDR1 ON dbo.OITM.ItemCode = dbo.RDR1.ItemCode RIGHT OUTER JOIN dbo.ORDR INNER JOIN dbo.OCPR ON dbo.ORDR.CntctCode = dbo.OCPR.CntctCode LEFT OUTER JOIN dbo.CRD1 ON dbo.ORDR.ShipToCode = dbo.CRD1.Address ON dbo.RDR1.DocEntry = dbo.ORDR.DocEntry WHERE dbo.ORDR.DocStatus = 'O' ORDER BY dbo.RDR1.DocEntry")
    The decimal points is drawing from "Amount" and I've changed the value in the "Display" Tab in "General Settings" for the "Amount" to 3.  It now displays three decimals places...gr8.  But I dont want it to change the other Documents in the system, just this column on the grid.  I am also going to try and read all the multiple selected values of this column and add them up and display the total at the bottom of the screen.  I am also going to try to group and put the subtotals on the grouping line according to the rdr1.DocEntry.
    The point of this excersize is to group the open orders with its open qty's weights so that they can be selected and processed for delivery based on the tonage of the vehicle available for delivery.
    Adele...How do I set the type of this column to use the "Units" and not the "Amount"?
    I look forward to any help.
    Thanks

  • Double to 2 decimal places

    I am putting a double variable out to a web page and also calculations on that double(a price). I am getting 4 decimal places on the original price and several decimal places on the calculations. Can anyone tell me how to round down to 2 decimal places?
    Thank you.
    Karen

    I generally use a formatter along the lines of the following. You could also use a wrapper class (Double is final, and you can't extend primitives) for Double which would incorperate this formatting. However you only need to use it when you are presenting it (or if you are persisting it to a lower precision data source, where truncation could result in larger inaccuracies creeping in).
    This also changes the ROUND_HALF_EVEN behaviour of DecimalFormat to ROUND_HALF_UP.
    Alternatively you could use BigDecimal (.setScale() to set decimal places) but there is an overhead which may be restrictive.
    class Formatter {
      public static final int DEFAULT_PRECISION = 2;
      public static final String DEFAULT_PATTERN = "#.00";
      public static final String ZEROS = "0000000000000000";
      public static String convertDoubleToString(Double d) {
        return convertDoubleToString(round(d, DEFAULT_PRECISION), DEFAULT_PATTERN);
      public static String convertDoubleToString(double d) {
        return convertDoubleToString(round(d, DEFAULT_PRECISION), DEFAULT_PATTERN);
      public static String convertDoubleToString(Double d, int precision) {
        return convertDoubleToString(round(d, precision), "#." + ZEROS.substring(precision));
      public static String convertDoubleToString(double d, int precision) {
        return convertDoubleToString(round(d, precision), "#." + ZEROS.substring(precision));
      public static String convertDoubleToString(Double d, String pattern) {
        return new DecimalFormat(pattern).format(d.doubleValue());
      public static String convertDoubleToString(double d, String pattern) {
        return new DecimalFormat(pattern).format(d);
      private static final double round(Double d, int precision) {
        double factor = Math.pow(10, precision);
        return Math.round((d.doubleValue() * factor)) / factor;
      private static final double round(double d, int precision) {
        double factor = Math.pow(10, precision);
        return Math.round((d * factor)) / factor;
    }

  • Using a variable in netsh command to set ip address on NIC

    hi friends
    i wrote an script which gets an input & use that variable to set ip address on NIC. but actually it doesn't set ip address. may you please help me.
    my script contains:
    $VMNumber=Read-Host "please enter your VM number (for example 2)"
    Netsh interface ipv4 set address NIC static 192.168.1.$VMNumber

    1. I do not thing that the use of netsh is a right way.
    2. You will need a table with MAC address in first column and IP address in second to correctly map IP address to computer. MAC addresses are unique identification.
    3. Follow this article including comments and adapt scripts to your task
    http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/
    HTH
    Milos
    hi Milos
    thank a lot for your useful answer.
    but let me say that my need has nothing to do with MAC address.
    in my test lab, i need an script which asks the administrators to enter their VM number & it saves this input as a variable & set is as the last octet in their VM IPV4 Address.
    so can we tell it as a rule that variables we create in powershell, can't be used inside non cmdlets (inside legacy cmd commands) ?

  • How to set  two decimal places in currency inr

    hi,
    i want to set two decimal places for my co.code currencu inr.  In t-code oy04 there is no 2 decimal places. Please tell me how set decimal places so that amount in account balances should be in two decimal places.
    thanks
    amol

    Hello,
    If your currency code entry isn't in OY04 customizing step, your currency code has 2 decimal place automaticly. If you want to define a special decimal place without "2", you must define it in OY04.
    Regards,
    Burak

  • Currency Decimal Places setting restore

    Hi Experts ,
    Unfortunately we have changes the setting for currency decimal places in SPRO ==> SAP NETWEAVER ==>GENERAL SETTINGS ==>CURRENCIES ==>SET DECIMAL PLACES FOR CURRENCIES.
    for Currency INR from default 3 decimal places to '4' decimal places, due to this the amounts entered in MM inforecords were changed e.g. the amount which was entered as 15.20 inr changed to 1520.00 inr, After getting reply from Fourm and the senior consultants we have deleted the INR currency from the about setting i.e.from table 'TCURX' after doing this the amounts get corrected i.e. from 1520.00 INR to 15.20 INR.
    But again the same (adverse) change is being seen in amounts for MM Inforecords and SD Condition Records
    If we enter a new record it shows the correct amount.
    How can i correct the previous amounts. It has happen suddenly and what guarantees that this should not happen again.
    Please give me the solution as early as possible. We have to Go-Live in next 2 days..
    Thanks in advance
    Amol

    HI, anand,
    SAP suggest never touch decimal places.
    Regards,
    Satish

  • Problems of setting values% with 2 decimal places in any graphics. What sho

    Guys, I have the xcelsius 2008 and can not make it work chart with values % and 2 decimal places. Already set up everything that I know the spreadsheet and graphics.
    Someone knows what can I do?
    Thanks Anderson - Sao Paulo - Brazil.

    Hi Anderson,
    To get values in % and upto two decimal, follow the below steps:
    Go to Chart properties-> Appearences Tab-> Text tab.
    Select the "Vertical Axis Labels" and go to the Number format present below in the window.
    Change the format to "Percentage" and set decimal places to "2".
    This should work.
    Please revert incase you have any queries.
    Thanks,
    Amit Mathur.

  • How to display 2 decimal places using DecimalFormat?

    Hi, i would like to display an account balance from database using child.getAccountBal(). Before that, i want to use DecimalFormat to display 2 decimal places. I would like to know whether the codes below are correct. Can anybody guide me? Thanks.
    public static double roundTo2DecimalPlaces(double value){
              DecimalFormat df = new DecimalFormat("0.##");
              double d = df.format(value);
              System.out.println(d);
              return value;          
    And inside the jsp page...is that how i call the values?
    Account Balance: <%=roundTo2DecimalPlaces(child.getAccountBal())%>

    DecimalFormat's format method returns a String not a double,
    os you must return a String instead of a double.
    public String roundTo2DecimalPlaces(double value)
         DecimalFormat df = new DecimalFormat("0.00");
         String stringValue = df.format(value);
         return stringValue;
    <%= roundTo2DecimalPlaces(child.getAccountBal()) %>

  • Changing Decimal places in table TCURX

    Hi There
    We have a business requirement to change the decimal places in table TCURX from 3 Decimals to 5 Decimal places. No previous postings have been made in foreign currencies.
    If no transaction data has been posted in foreign currencies yet, will this have an impact?
    What will the impact be?
    Regards

    Hi,
    Refer to this SAP text:
    In the R/3 System tables currency fields are stored as decimal figures with a variable number of decimal places. The decimal point is not stored in the field in the database. Instead, each currency field refers to a currency key field. In this transaction you assign the number of decimal places to this currency key uniquely. Example: If you have set currency USD to have two decimal places and you post an amount of 100 USD, an amount of 10000 USD is stored in the currency field in the database. Not until this
    amount is processed further or is output does the system use the currency key from the reference field to determine the number of decimal places via this table. In this way the table content can be interpreted correctly for further processing or formatted for output with the correct punctuation. If after posting you changed the number of decimal places for USD, for example, to 3, the existing field content of 10000 would be interpreted for futher processing or output as 10 USD (10.000). This would mean that the contents of tables across the system would, for all currency fields containing an amount in USD,
    be interpreted incorrectly by 10 per cent. To change the number of decimal places for a currency already in use, you must convert all the tables in the R/3 System that contain currency fields, so that the data integrity remains. This cannot, however, for both organizational reasons and under the runtime
    aspect be carried out in a productive system. The following changes to the TCURX table can
    thus lead to the loss of data integrity if you make the changes in a productive system or transport them into a productive system:
    o Change to the number of decimal places of an existing currency
    o Deletion of an entry from the TCURX table (corresponds to changing the decimal places to the standard value of two decimal places)
    o Insertion of an entry in the TCURX (corresponds to changing the standard value of
    2 decimal places to a different value), if this is a currency code that already exists
    Uncritical changes are any made to this table during the Customizing of a new installation or the insertion of TCURX even during operations, if the currency codes have just been entered in the TCURC table using transaction OY03, signifying that no postings to these currency codes can have been carried out yet.
    Regards,
    Eli

Maybe you are looking for

  • Ipod Touch Video Out not working with IOS5?

    I normally could play video just fine from my Ipod to my TV and Exercise machine via the ipod plug in on the bottom...however since IOS5...video will play for  secs. on the TV then TV goes blank....sound works and the IPOD Touch displays the normal "

  • Do we have Tool to re-point Dynamic Parameters in multiple crystal Reports

    Hi Experts, Do we have any tool to re-point Dynamic Parameters of Multiple reports in a single shot.source of crystal reports is SAP ECC tables. Thanks, BharathU

  • Restore Database to Windows

    Hi all, I have cold backup from Oracle 10.2.0.1 Solaris[tm] OE (64-bit) on Unix and now they have moved to oracle 10.2.0.4 on windows 2003 64 bit How can i restore full database from cold backup to windows server? Please guide I am totally new to Ora

  • Native JSON support in Next SQL Server Release

    Dear Team,  With 9.3 and upcoming 9.4 release PostgreSQL has started supporting JSON data type. Oracle is following it in their 12c release, when can we expect this in MS SQL? Also will it cover native functions within DB engine which can translate J

  • Problem in Materialized Views

    Hi, I have two servers one is remote database (it resides in public ip) and another one is local database. I have created Materialized view in Local System to replicate the data from remote system to Local System, Local system Internally creates Jobs