String data to Sign data

I am using a device where I receive a string data output which has a meaning.
For example:
:000000 -0067U 0004 -0578
:000000 -0067U 0004 -0578
:000000 -0066U 0004 -0579
:000000 -0066U 0003 -0579
:000000 -0066U 0003 -0580
 I need to extract the 9th and 11th character through a string subset.
I have a question, please the attached VI:
1. Is it correct extraction method? any other suggestion?
2. The 9th character actually is the sign of character 11 i.e +(if space) and - (is shown as minus)
Then I have to take this number for e.g -5  or +5 then use in another calculation but problem is how can I convert the _ and +  from string to the number? then how can I make the 9th and 11th character as one number.
Attachments:
string.vi ‏14 KB

Maybe the last part can be simplified. Please see the image.
I modified your input a little bit since your data only contained "minus". I changed row 2 to have a "space" which should be interpreted as positive sign. Moreover, row 4 shows a explicit "plus" sign in the ninth position. Note that both space and plus are correctly interpreted as positive.
Consider sanitizing the input. The 0th-row with "-0587" does not follow the syntax of all the other rows so it should be removed.
Regards,
Attachments:
Solution.PNG ‏24 KB

Similar Messages

  • 'Error while signing data-Private key or certificate of signer not availabl

    Hello All,
    In my message mapping I need to call a web service to which I need to send a field value consist of SIGNED DATA.
    I am using SAP SSF API to read the certificate stored in NWA and Signing the Data as explained in
    http://help.sap.com/saphelp_nw04/helpdata/en/a4/d0201854fb6a4cb9545892b49d4851/frameset.htm,
    when I have tested using Test tab of message mapping  it is working fine and I am able to access the certificate Keystore of NWA(we have created a keystore view and keystore entry to store the certificate) and generate the signed data ,but when I test end to end scenario from ECC system,it is getting failed in mapping with the error
    ' Error while signing data - Private key or certificate of signer not availableu2019.
    Appreciate your expert help to resolve this issue urgently please.
    Regards,
    Shivkumar

    Hi Shivkuar,
    Could you please let me know how you were trying to achieve the XML signature.
    We have a requirement where we have to sign the XML document and need to generate the target document as following structure.
    <Signature>
         <SignedInfo>
             <CanonicalizationMethod />
             <SignatureMethod />
             <Reference>
                     <Transforms>
                     <DigestMethod>
                     <DigestValue>
             </Reference>
        <Reference /> etc.
      </SignedInfo>
      <SignatureValue />
      <KeyInfo />
      <Object>ACTUAL PAYLOAD</Object>
    </Signature>
    I am analyzing the possibility of using the approach that is given in the help sap link that you have posted above. Any inputs will be apprecited.
    Thanks and Regards,
    Sami.

  • How to Plot number and string in one row (data logger counter) ?

    hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Duplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...

  • How can I convert date infomation to a string just includes the date not th

    I just want the date like Thu 08, july 2004 but not the exact time.
    how can I do that.

    The prior code produces a date formatted as Jul 7, 2004
    To get Wed 07, July 2004, try this minor modification:
    import java.text.DateFormat;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    DateFormat format = new SimpleDateFormat("EEE dd, MMMM yyyy");
    Date mydate = new Date();
    String str = format.format(mydate);
    System.out.println(str);

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • Error while signing data-Private key or certificate of signer not available

    Hello All,
    I am new to PI.  I am currently stuck with an issue. The scenario is as explained below.
    We need to check for the service availability before processing the data. So, we test for the RFC connection first from the ECC system. During this process, we access the digital certificate stored in the PI system so that it can be validated and allowed to consume this intended service.
    Error :
    When we trigger the RFC test from the  ECC system, we get an error stating ' Error while signing data -  Private key or certificate of signer not available '. But when we test the same functionality within PI system(Locally), we does not encounter any such error. The certificate is maintained and it appears fine.
    The communication channels are stored with logon credentials.
    Can anyone please help me with this error or provide your valuable inputs. Thanks in advance.
    Regards,
    Shivkumar

    Hello,
    When we trigger the RFC test from the ECC system, we get an error stating ' Error while signing data - Private key or certificate of signer not available '.
    This should be normal behavior since the certificates are not installed in ECC SSL folders of Strust. Why not just install the certificates in the ECC system, perform an ICM restart and do a retest? After all, the certificates would both be the same in PI and ECC.
    Hope this helps,
    Mark

  • Convert a date in String format to a Date

    Hi,
    How can I convert a date in String format to a Date object?
    I have tried:
    import java.text.*;
    import java.io.*;
    import java.util.Date;
    import java.util.Locale;
    import java.sql.*;
    public class casa {
    public static Connection con = null;
    public static Statement s = null;
    public static String sql = null;
    public static String mydate = "01.01.2001";
    /** Creates a new instance of casa */
    public casa() {
    public static void main(String[] args) throws SQLException{
    try {
    DateFormat shortFormat = DateFormat.getDateInstance(DateFormat.SHORT);
    Date date = shortFormat.parse(mydate);
    //Open Database
    con = getConnection();
    s = con.createStatement();
    sql = "select date1 from table1 where date1 <= '"+date+"'";
    ResultSet rs = s.executeQuery(sql);
    while(rs.next()){
    String aba = rs.getString("datum");
    System.out.println("New Datum = "+aba);
    } catch (Exception ex ) {
    ex.printStackTrace();
    closeConnection(s, con);
    //Connection
    private static Connection getConnection() {
    Connection con = null;
    String user ="aouzi";
    String passe ="aouzi";
    String url = "jdbc:db2:EjbTest";
    try {
    //Datenbanktreiber laden
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    //Verbindung herstellen
    con = DriverManager.getConnection(url,user,passe);
    }catch(ClassNotFoundException e){
    } catch(SQLException e){}
    return con;
    //close Connection
    private static void closeConnection(Statement s, Connection con) {
    try {
    s.close();
    } catch (SQLException e) {}
    try {
    con.close();
    } catch (SQLException e) {}
    I'm getting the following errors:
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0180N
    The syntax of the representation of a date/time of day value as character sequence is false. .SQLSTATE=22007

    I'm pretty sure it won't understand what date.toString() returns. If you know what format the database understands, you do it like this:
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yy"); // e.g. 18-Apr-02
    String datestring = sdf.parse(date);
    and use that instead of date in your sql string. Some databases understands it if you do
    "to_date('18-Apr-02')"
    so you could include that in your sql string as well..
    You could also try to make it a java.sql.Date and hope your jdbc driver knows how to convert it to a string that the database understands if you don't know the format:
    con = getConnection();
    PreparedStatement ps = con.prepareStatement("select date1 from table1 where date1 <= ?");
    ps.setDate(new java.sql.Date(date.getTime()));
    ResultSet rs = s.executeQuery(sql);

  • How to insert sign date "now()" in database ?????

    I am a newbie.  Using DW CS5 I have been able to get a number of web pages on my web site to work well.  My problem is with my “sign in form”.  I want to add in the sign in form a hidden field for the date that the user signs up.
    But the signup_date value in the database is not been entered.  I do have a “work around”.  If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”.  However, I want to learn to do it “right”.  My questions:
    1.      What is the “best” way to accomplish my desire results?
    2.      What do the “%s” stand for in the $insertSQL statement?  I think it is an array, but I do not understand this line of code that DW generated.  Can you explain is plain English?
    Below is the important part of the code (I hope I sent enough to explain the problem) for the sign form: (disregard the /////// they are only there to indicate different sections of the code).
    //This is the code from the input form for the hidden field "signup_date"
    </tr>
        <tr>
          <td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="NOW()" />
          <td><input type="submit" name="Submit" value="Join Now!"></td>
        </tr>
      </table>
    //This is the dreamweaver code to insert the date into the data base:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frJoin")) {
      $insertSQL = sprintf("INSERT INTO users (first_name, last_name, email_address, username, info, user_level, signup_date) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['email_address'], "text"),
                           GetSQLValueString($_POST['username'], "text"),
                           GetSQLValueString($_POST['info'], "text"),
                           GetSQLValueString($_POST['user_level'], "text"),
                           GetSQLValueString($_POST['signup_date'], "date"));
    Thanks !!

    I do have a “work around”.  If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”.  However, I want to learn to do it “right”.
    Your "workaround" is actually the correct method. The way that you think is "right", by entering the date into a hidden field, is actually the wrong way. Hidden fields can be manipulated. Inserting data directly into the query is the desired method, like the method you are currently using. It's not a "workaround", it's the correct method. You hidden field is not working because you have not told the page that the NOW() in the hidden field should be processed through php. NOW() is MySQL function. Use php to echo current date in hidden field if you want to use the "wrong" method of processing the date into your query.
    <td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="<?php echo date("Y-m-d H:i:s"); ?>" />

  • Contract Sign Date from VBAK and VBAP and VEDA.

    Hi ,
    I need to fetch the Sales Document from VBAK and VBAP and VEDA with the contract sign date for sales document line item .
    Contract sign date is in selection screen as select options.
    Please let me know how to fetch the sales Document per line item from these 3 tables considering that A sales document could have many line items and each can have a different sign date.
    Thanks
    Sachin

    Hi,
    The link between all the tables VBAK, VBAP and VEDA is VBELN i.e sales document number.
    However, while fetching from VBAP and VEDA you would need to consider POSNR as well.
    As your ABAPer to code the logic using 'for all entries' method.
    Regards,
    Amit
    Edited by: Amit Iyer on Jun 23, 2011 12:28 PM

  • Convert a string to JAva.sql.date..

    I am having a string with the value as follows..
    String fval="03-10-2001"..
    I am using this value in a rs.updateDate method where I need to convert it to a different format as
    2001-10-03...can anybody give me the syntax..

    You should hold dates as Date instances. But if you want to convert between Strings and Dates then you should use a DateFormat:
    String originalDateString = "31-10-2001";
    // Convert the original string to a date
    DateFormat originalDateFormat = new SimpleDateFormat("dd-MM-yyyy");
    Date date = originalDateFormat.parse(originalDateString);
    // Get a representation of the date in the new format
    DateFormat newDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    String newDateString = newDateFormat.format(date);(Excuse the quirky formatting that the Java code filter applies!)
    Hope this helps.

  • How to conver string date to sql date

    Hi,
    i have a html form which will populate the date in the text field using popup window in the mm\dd\yy format .
    In the servlet i first retrieve the value as string object and need to store that one the database. using setDate method of prepared statement
    The date should be of type sql date only.
    so my question is how to convert the string representation of the date to sql date.
    Thanx in advance

    use java.text.DateFormat and java.text.SimpleDateFormat.
    %

  • Convert String to java UTC date then to sql date

    Hi,
    I am trying to convert string (MM/dd/yyyy format) to UTC date time and store in the database.
    This is what I did:
    String dateAsString = "10/01/2007";
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
    formatter.setLenient(false);
    java.util.date dateValue = formatter.parse(dateAsString, new ParsePosition(0));
    dateValue will be Sun Sep 30 20:00:00 EDT 2007 in UTC.
    Now I need to store this date and time to MS SQL database.
    I used the following code:
    java.sql.Date sqlDateValue = new java.sql.Date(parsedToDate.getTime());
    But this code give only the date, not time 2007-09-30
    Can anybody tell me how I can change this java date to sql date (or datetime?) so that I can get both date and time.
    Thanks,
    semaj

    semaj07 wrote:
    Hi,
    I am trying to convert string (MM/dd/yyyy format) to UTC date time and store in the database.
    This is what I did:
    String dateAsString = "10/01/2007";
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
    formatter.setLenient(false);
    java.util.date dateValue = formatter.parse(dateAsString, new ParsePosition(0));
    dateValue will be Sun Sep 30 20:00:00 EDT 2007 in UTC.
    Now I need to store this date and time to MS SQL database.
    I used the following code:
    java.sql.Date sqlDateValue = new java.sql.Date(parsedToDate.getTime());
    But this code give only the date, not time 2007-09-30
    Can anybody tell me how I can change this java date to sql date (or datetime?) so that I can get both date and time.
    Thanks,
    semajTake a look at java.sql.Timestamp:
    http://java.sun.com/javase/6/docs/api/java/sql/Timestamp.html
    Edited by: hungyee98 on Oct 17, 2007 8:57 AM

  • Convert a String to java.sql.Date Format

    Hi,
    I am having a String of containing date in the format 'dd/mm/yyyy' OR 'dd-MMM-YYYY' OR 'mm-dd-yyyy' format. I need to convert the string to java.sql.Date object so that I can perform a query the database for the date field. Can any one suggest me with the code please.
    Regards,
    Smitha

    import java.text.SimpleDateFormat;
    import java.text.ParseException;
    import java.util.Date;
    public class TestDateFormat
         public static void main(String args[])
              SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
              System.out.println(sdf.isLenient());
              try
                   Date d1 = sdf.parse("07-11-2001");
                   System.out.println(d1);
                   Date d2 = sdf.parse("07:11:2001");
                   System.out.println(d2);
              catch(ParseException e)
                   System.out.println("Error format, " + e);
    See class DateFormat and SimpleDateFormat for detail.

  • Contract sign date field hide at header level

    Hi,
    My client want to disable contract sign date at header level only not at item level in the contract.I tried transanction  variant but it is disabling both side header as well as item level.Kindly suggest me.User should only give input at item level only.

    So are we... The BAPI BAPI_CONTRACT_CREATE has the following importing parameters:
    HEADER     TYPE     BAPIMEOUTHEADER
    HEADERX     TYPE     BAPIMEOUTHEADERX
    VENDOR_ADDRESS     TYPE     BAPIMEOUTADDRVENDOR
    TESTRUN     TYPE     BAPIFLAG-BAPIFLAG
    TECHNICAL_DATA     TYPE     BAPIMEOUTTECH
    Change the HEADER and HEADERX parameters as I have indicated in my first post.
    Regards,
    John.

  • JAVA primitive data types - Signed/ unsigned etc.

    1. Are the following data types signed or unsigned in JAVA?
    byte, short, int, long, float, double
    2. I have tried using "Integer" in place of "int" and the program runs perfectly. Why is this so when "Integer" is not a reserved word in JAVA?
    Thanks.

    And to answer your first question, byte, short, int, long, float and double are all signed.
    As a part of the core of the language, Sun developed a series of 'collections' classes; Vector, ArrayList, etc. All of these classes, in the days before generics, were able to store instances of the Object class or anything that derived from it. Therefore, to store an int, a float or a double value into one of these collections classes, it was necessary to wrap it up in an instance of one of those classes that derived from Number. These are the wrapper classes that the previous poster alluded to. Typically, the wrapper class has a similar name to the primitive data type but with a capital latter; int - Integer, double - Double, etc.

Maybe you are looking for

  • Itunes 7 wont open when upgraded

    ive upgraded to the new itunes7 but when the installation is complete and i try to open itunes it simply wont open. no error message is displayed, the software simply wont open. i had no problems whatsoever with the previous itunes software and with

  • What's the maximum number of view criteria that a view object can contain?

    We are making extensive use of view criteria in our view objects, mainly for LOV purposes. Is there a figure on the maximum amount of view criteria a view object can contain. Regards Ollyando Somewhere in Canada

  • Preview in Mountain Lion Doesn't Like Spot Colors

    I upgraded to Moutnain Lion and CS6 at the same time, and one thing I've noticed is that Mac's preview doesn't seem to dig on spot colors. Has anyone else noticed this? It seems to be the case with .ai and PDFs. Not a huge deal; when you open the fil

  • Can I output to usb itunes sound only, not system sounds?

    I use USB speakers for playing music from itunes, but I want all other sounds to come from the computer's built-in speakers. Is this possible?

  • Using ROWTYPE to create undoable record

    Does anyone have any insight on how I would perform the following in forms: Define a %ROWTYPE record On Each Navigation to a new Record Store all the record's values in %ROWTYPE variable An UNDO button on the form would then revert all the values in