Sapscript compare b/t string & number

Hi,
In sapscript, I write the below comparison but it doesn't understand:
<b>IF &PAGE& = &SAPSCRIPT-FORMPAGES&.</b>
with &PAGE& is of type character & &SAPSCRIPT-FORMPAGES& is an interger.
Can someone show me how to convert (date type) either of the above 2 values to make my comparison working?
Thanks!

Hi Timy,
Check this post, you have answer
Re: Sapscript: &sapscript-formpages& - 1
Reward Points if this helps,
Satish

Similar Messages

  • HI Team, Recently One week back I bought a new iphone 5 from India. They have given me a used mobile which has a different IMEI number when compared to the IMEI number present on the box. Please let me know how to proceed further

    HI Team, Recently One week back I bought a new iphone 5 from India. They have given me a used mobile which has a different IMEI number when compared to the IMEI number present on the box. Please let me know how to proceed further

    When you went back to the place where you purchased this phone, & asked them, what did they say?
    No one here can help you with this, nor can/will Apple. You need to take this up with whoever you purchased this phone from.

  • How do we compare a complex string?

    Hi guys,
    how do i compare the following strings
    input_Variable: User-agent : *
    if i want to ensure that the input_variable has "User-agent" and the character '*'.
    There are 3 possiblities for input_variable:
    1) User-agent: *
    2) disallow: http:///xxxxxxxxxxxx
    3) User-agent:Somename
    The white space between the words could be uneven and same goes with the character case.
    thanks,
    Derik

    Hi.. Derik
    How about this one..
    String input_Variable = "[from your input method]";
    if ( input_Variable.indexOf("User-agent") != -1
    && input_Variable.indexOf("*") != -1 )
    System.out.println("yeah.. authorized..");
    indexOf(String str) method returns -1 when it can't find out a specific string from the source string..

  • Return 2 values (string, number) multiple rows, from java stored function

    I would like to return 2 values (String, number prefered but String, String will work) from a java stored function.
    I was able to successfully return a varray of varchar2 values but I was wondering if it is possible to return 2 values by using a varray?
    Is it even possible? I tried using combinations of types which included a varray of objects (with 2 attributes) or a type as table of objects but I couldn't figure out how in my java code to set these values. Also what would my java function return type be and what Oracle type would map to it?
    Any help and examples or pointers would be great.
    Thanks,
    Dennis

    Thanks to all. I finally figured it out through all the pieces on the web.
    Here is what worked for me. First create 2 oracle types. One object type to represent the "columns" I will pass back:
    CREATE OR REPLACE TYPE COST_OBJ AS OBJECT (COST_NAME NVARCHAR2(50), COST_VALUE number ) NOT FINAL
    note: make sure the "strings" are defined as NVARCHAR2 or Java will puke if it is just VARCHAR2.
    Then create a table type to hold your objects defined as following:
    CREATE OR REPLACE TYPE COST_OBJ_TABLE is table OF COST_OBJ
    Then create the oracle stored function that is a wrapper to the java function:
    CREATE OR REPLACE FUNCTION get_Costs(Name VARCHAR2, evalDate VARCHAR2, fuelCodeID NUMBER) return COST_OBJ_TABLE
    is language java name
    'com.costs.storedProcedures.Cost.getCosts(java.lang.String, java.lang.String, int) return oracle.sql.ARRAY'
    Once that is done, Oracle is ready. The Java function looks something like this:
    public ARRAY getCosts(String name, String evalDate, int fuelCodeID) {
    DBAccess da = getDBAccess();
    // get a handle on the connection
    Connection conn = da.getConnection();           
    // The stuff that will be returned should be as type object array
    // make it to the size of the number of fuelcomponents passed in
    Object[] returnStuff = new Object[3];
    // create the type of struct that is defined on the database
    StructDescriptor structDesc =
    StructDescriptor.createDescriptor("CY_UMAP.COST_OBJ", conn);
    for (int i = 0; i < returnStuff .size(); i++) {
    Object[] costValues = new Object[]{
         "This is object " + i,
         new Integer ( i ) };
    STRUCT cost_obj = new STRUCT(structDesc, conn, costValues);
    returnStuff[i] = cost_obj;
    ArrayDescriptor x_ad = ArrayDescriptor.createDescriptor (
    "CY_UMAP.COST_OBJ_TABLE", conn);
    ARRAY x_array = new ARRAY(x_ad, conn, returnStuff);
    return x_array;
    I hope this helps others.
    Dennis

  • How to send really Chinese word, not the string "&# number " to web browser

    Each Chinese word on page sending to web browser is translated to a string in form "&#<number>" by default, it's a problem when Chinese word is included in url. How to specify sending really Chinese word, not the string "&#<number>" to web browser?

    Thanks that seems to make much more sense, still having some troubles though.
    Ok so now the majority of it seems to be working and it seems to be sending the String just fine. And I'm having it send the String to the BufferedWriter "out" and then using the newLine() method to send a carriage return but the BufferedReader on "in" seems to not detect the carriage return.
    I have it doing a readLine() so that (as I understand it) it should be blocking, waiting until an end of line character so I assume each call of newLine() should have it pick up something but a quick breakpoint shows that it never stops blocking on readLine().
    I assume the connection is fine because the application running as server uses the socket object returned by the accept() method.
    Is there something I've perhaps misunderstood about the BufferedReader's readLine() method?
    Here's the new version of my netbeans project:
    http://rapidshare.com/files/371224512/KerazehDood.rar
    Also on a different line of questioning, I'm just wondering about socket convention.
    I was thinking it'd be useful in a game similar to what I'm attempting to make to not only send player position information but also client keypress information, I was just wondering, if you're doing something like that would it be frowned upon to use two separate ports? I think it would make the implementation far more legible and easy to structure but wasn't sure if applications usually try to stick to only one port or not.
    Thanks.
    Edited by: ThePermster on Apr 2, 2010 10:54 AM

  • How to compare 2 version strings (of the format x.x.x.x where x : {0, 99})

    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production,
    PL/SQL Release 11.2.0.2.0 - Production
    I have a scenario like:
    Table1:
    Name Null Type
    NAME NOT NULL VARCHAR2(64)
    VERSION NOT NULL VARCHAR2(64)
    Data:
    Table1
    Name Version
    A 1
    B 12.1.0.2
    B 8.2.1.2
    B 12.0.0
    C 11.1.2
    C 11.01.05
    I want the output as:
    Name Version
    A 1
    B 12.1.0.2
    C 11.01.05
    Basically ,I want to get rows for each name which having highest version. For this i am using following query:
    SELECT t1.NAME,
    t1.VERSION
    FROM TABLE1 t1
    LEFT OUTER JOIN TABLE1 t2
    on (t1.NAME = t2.NAME and t1.VERSION < t2.VERSION)
    where t2.NAME is null
    Now 't1.VERSION < t2.VERSION' only works in normal version cases but in cases such as:
    B 12.1.0.2
    B 8.2.1.2
    It fails, So i want a PL/SQL script to normalize the version strings and compare them for higher value.

    Hi,
    Here's one way:
    ORDER BY  REGEXP_REPLACE ( REGEXP_REPLACE  ( version
                                           , '(\d+)'
                                , '0000\1'
                    , '0+(\d{5})'
                    , '\1'
                    )This assumes that you never have more than 5 digits in a row. You can easily change that to any fixed number.
    This will not cause an error if you have letters or other symbols in the string.
    This makes no assumptions about how many numbers are in the string, or what characters delimit the numbers.
    Here's how it works:
    The inner REGEXP_REPLACE adds 4 '0's immediately before any substring of digits. This guarantees that all numbers are at least 5 digits long.
    The outer REGEXP_REPLACE removes '0's from the beginning of numbers that are more than 5 digits long, which guaranteees that the numbers will be exactly 5 digits long. '00008' will come before '00012'

  • Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

    Hello,
    I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
    On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
    In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
    But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
    For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
    in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
    (For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
    I didn't find any Essbase Function which do this (conversion number <=>string).
    Is anyone have an Idea ?
    Thanks for your help
    Best regards

    I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
    I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
    It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
    I think you can do what you want though, with something like this...
    IF (@ISMBR("FY08"))
    vYr = 2008;
    ELSEIF (@ISMBR("FY09"))
    vYr = 2009;
    ENDIF;
    IF (@ISMBR("M01"))
    vMth = 1;
    ELSEIF (@ISMBR("M02"))
    vMth = = 2;
    ENDIF;
    "Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
    Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
    Good luck,
    -- Joe

  • How to compare Date/time string

    I read from datalog file including Date/time string ,and want to query the special Date/time string span ,how to compare the data/time string ?

    Hello Joshua,
    To compare date/time you have to extract the different components (day, month, year, hour, minute, second) anyway. Why not "convert to seconds"? I think it's easier to compare one number (where you also can do other math, like calc the difference and so on) than to compare seven (?) parameters with some exceptions... If the dates are read from excel (there was a similar thread some days ago), why not convert to seconds in excel (just a format change)?
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • IF statement (Compare column with String)

    Hi all,
    i want to compare the Content of a Column with a text but i always get an error message because of a Syntax error.
    It the Content of the column Approval Status is Approved the System should write in the calculated column the String "Approved"
    my code:
    =IF([ApprovalStatus]="Approved","Approved"," ")
    can you help me ? what is wrong here?
    thank you in advance

    Hi
    yes, because  you should numeric values
    Approval Status
    Value
    Approved
    0
    Rejected
    1
    Pending
    2
    Draft
    3
    Schedule
    4
    https://farhanfaiz.wordpress.com/2010/12/17/sharepoint-approval-status-value-of-publishing-pages/
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Incrementing a string number for date and time

    There are probably a lot of ways to do this, but I only want to use a bunch of if - else loops if I really need to.
    I have a date and time for input, let's say 2006-04-19 22:00. In Java, if I convert that to 3 integers (year, month, day), it will output 2006-4-19. I need to be able to increment in a loop for every day and month from one date to the next. If I keep it as a string, I won't be able to increment the value though, (at least I'm not sure how). I'm thinking that even if I converted it to an integer and back to a string, that the leading zero would be removed.
    I found a post here that said something about formatting the number with 2 numbers, by using:
    DecimalFormat format = new DecimalFormat("00");
    format.format(1, sb, new FieldPosition(0));
    Or is there a way to use the gregorianCalendar stuff that would output the date with all of the zeros in place, while incrementing and looping correctly?
    Thanks.

    I would get a Date object--you can use java.text.SimpleDateFormat if you're starting with a String--and use that to create a GregorianCalendar. Then you can just call Calendar's add method to add one to whichever field you want. Use the SimpleDateFormat to turn the date back into a String for display again.
    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • Not able to compare varchar filed with number

    tag3 is varchar filed can have number data
    Below works good
    comparison with 0 or 1 works also less than or equal operator works
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)<=24
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=0
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=1
    >
    greater or equal comparison doesn't work
    doesn't work
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>=24
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=2
    any number beyond 1 doesn't work
    Error :ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    Not able to understand the logic of comparing the number with
    same is tried with TO_NUMBER as well
    works good
    select I.* from ob_release_instruction I where to_number(i.tag3) > 0
    Not working ( changed the value to more than 0)
    select I.* from ob_release_instruction I where to_number(i.tag3) > to_number('24')
    Not working
    select I.* from ob_release_instruction I where to_number(i.tag3) > 24
    Above two query is not working throwing below error
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Here is the sample
    tag3 is varchar filed can have number data
    TAG3 VARCHAR2(30 CHAR)
    column has few nulll, alpha numeric and number values
    I want to check entered number is greater than 24 or not
    Below works good
    comparison with 0 or 1 works also less than or equal operator works
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)<=24
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=0
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=1
    greater or equal comparison doesn't work
    doesn't work
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>=24
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)=2
    select TAG3 from ob_release_instruction i WHERE CAST(i.tag3 as NUMBER)>2
    any number beyond 1 doesn't work
    Error :ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:
    *Action:
    Not able to understand the logic of comparing the number with
    same is tried with TO_NUMBER as well
    works good
    select I.* from ob_release_instruction I where to_number(i.tag3) > 0
    Not working ( changed the value to more than 0)
    select I.* from ob_release_instruction I where to_number(i.tag3) > to_number('24')
    Not working
    select I.* from ob_release_instruction I where to_number(i.tag3) > 24
    Above two query is not working throwing below error
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • &SAPSCRIPT-FORMPAGES& not giving correct number

    Hi,
    Iam unable to print total number of pages correctly.
    Please kindly help me.
    I am getting  total pages 4 but need to display 3(exclude terms&conditions page) at page 1 of 3 like that.
    I tried to decrement page counter by 1 in the below perform, it's working fine but the issue is ....
    First time when perform is called system is passing 2 at &SAPSCRIPT-FORMPAGES&, next time getting 3 into &SAPSCRIPT-FORMPAGES&.
    PERFORM CHECK_PAGE IN PROGRAM ZZ_RFQ USING &SAPSCRIPT-FORMPAGES&
    CHANGING &WS_PAGE&
    ENDPERFORM
    Page &PAGE(C)& of &WS_PAGE&
    Thanks,
    Geetha.

    Thanks for the reply Max. Let me explain more on the issue.
    I created a custom field on RFQ for terms & conditions. On th form I have to print terms & conditions on the back of first page when the custom field is checked.
    When I check the custom field on RFQ everything is working fine including page numbers.
    When the cusotm field is not checked system is caliculating terms and confitions also as a page (In spool I see blank page) but not printing as it is back of the first page. Client is ok with it. but the prob is with page numbers getting 1 of 4, 2 o 4, 3 of 4.
    So I tried to call this perform when the field is not checked to reduce the page number. as you said SAPSCRIPT-FORMPAGES is calculated at runtime not able to get right values.
    Any alternative to get right value?
    Thanks,
    Geetha.

  • JDBC string- number conversion in Canadian locale

    How come Oracle JDBC driver thinks "2.1" is an invalid number in Canadian locale? The decimal point in Canadian locale is still "." as used in US locale. It is easy to verify this by changing your locale to English (Canada) and check the "Number" settings on your Windows machine.
    This is definitely a bug. Can antone from Oracle confirm this?
    Thanks.

    It is working now because you have imported oracle.jbo.domain.Number and hence not using java.lang.Number.
    java.lang.Number is a abstract class and hence no constructors, whereas oracle.jbo.domain.Number has many constructors (one of which Srinath suggested to use.)
    you can still make it work with
    oracle.jbo.domain.Number n = new oracle.jbo.domain.Number(businessReqID) ; //if businessReqID is a String.
    You dont need to get the int from the String in order to use this constructor.
    Thanks
    Tapash

  • String/number conversion

    I am trying to convert a number in a string (a SPICE netlist) to a double. The string contains extra letters. Is there a String or double (or float) method that safely converts without vomitting on unwanted characters?
    And by the way, I used to (about 1+ years ago) be able to look at a reference online that gave a detailed description of the Java standard class methods. Know where I might find this?
    -erik

    you can refer the api at
    http://java.sun.com/j2se/1.3/docs/api/

  • Compare  dates  (This String 23/10/02 is less than this string  10/12/03)

    Can someone Please help me with this
    I have a xml licence file with a Expiry Date which I pull out into a String called licenceDate.
    I also set a String called getSystemDate which uses this code to get the system Date.
    DateFormat getSystemDate = new SimpleDateFormat("dd/MM/yy");
    systemDate = getSystemDate.format(new Date());
    And this is what those to look like from System.out.Println();
    This is licence Date from Orders 23/10/02 System Date 10/12/03
    Now what I need to do is Compare the 2 date strings to check if the licenceDate string is less that the getSystemDate.
    If the licenceDate is less the system date it then displays a Dialog that says your licence has Expired.
    Can anyone help me with some code to do this
    All I need is to Compare the to dates.
    Thanks
    Craig

    der Hosenscheisser, I'm not sure if I believe you but just in case you have read the API, look at the method:
    public java.lang.boolean java.util.Calendar.before(java.lang.Object x)

Maybe you are looking for