How to check the source value is in between a string range in mapping

Hi Consultants,
I am working on IDOC to File scenario. I need to implement a specific requirement of our client. i.e. something like below;
Vendor number can be any thing like 1AA000000 / 1AA000001/1AB000000/... ect till 1ZZ999999.
if the vendor number is in between 1AA000000 -1ZZ999999 then the target value should assign as 'Internal' else should assing as 'External'.
How to compare  that the value of vendor is in between IAA000000 to 1ZZ999999 in mapping?
Appreciate your help.
Thanks in advance.
Regards,
Nausheen

You can try creating an UDF and using the varName.substring(); method. Then you can compare in separated pieces the string. For example
String var = "1AA000000";
if (var.substring(3).compareTo("000000") < 0 && var.substring(3).compareTo("999999") > 0)
  //compare now the "AA" and "ZZ" with the same logic;
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#substring(int, int)
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#compareTo(java.lang.Object)
EDIT: Moreover, those functions are available in the Mapping program creation, but this should give a clue on the order it should be done.
Edited by: Lucas Santos on Mar 29, 2011 7:38 PM
Edited by: Lucas Santos on Mar 29, 2011 7:53 PM

Similar Messages

  • How to replace the char values into numeric in my string?

    Hi Friends,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    I mean How to replace the char values into numeric in my string?
    Thanks,
    Sridhar

    Hi Sridhar,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
    DATA: l_str TYPE string.
    l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
    REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
    IF sy-subrc EQ 0.
      WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
    ENDIF.
    Regards,
    Chen
    Edited by: Chen K V on Jun 13, 2011 12:36 PM

  • How to Check the total value of a field

    Hi,
    I want to check the total value of a field (this total is obtain by using property of that field thru personalization).
    that means , in a table 3 columns are there (col 1, col2 & col3). I personalized the total property as true for col3.
    now i'm getting the total for that field.
    I want to check that total whether it crossed 100 or not.
    How to do this?
    Thanks in advance,
    SAN

    Hi San,
    You can achieve by using OATotalRowBean, search for OATotalRowBean in this forum you should be able to get some sample code.
    public class OATotalRowBean
    extends TotalRowBean
    implements OAWebBean, OAWebBeanConstants
    A special row rendered at the bottom of a table which lets users see totals for columns which are designated for summing.
    Note The total is calculated and displayed only for visible rows.
    When you indicate that you want to total one or more columns, the OA Framework creates an OATotalRowBean and designates it as the columnFooter named child of the OATableBean. If the OATableBean is also configured to insert rows (so it has an "Add Another Row" button), then the total bean becomes an indexed child of the add table row bean (see OAAddTableRowBean), which the OA Framework in turn designates as the table's columnFooter object.
    If you need to access the table's column footer object for any reason, call the OATableBean's getColumnFooter() method. If row insertions are enabled, this method returns an OAAddTableRowBean; otherwise it returns an OATableRowBean.
    For detailed information about creating and working with tables, see OA Framework Developer Guide: Tables.
    With regards,
    Kali.
    OSSi.

  • How to check the numerica value

    Dear Experts,
    Would you please show me the code how to check a character value is numeric or not, include negative sign '-'.
    For example the character value (01.-10) should not be a good numeric value use in later.  the (-1.00) should be a good numeric value.
    Thanks,
    Helen

    Hello,
    Use the FM <b>NUMERIC_CHECK</b>
    Regards,
    Vasanth

  • How to check the occurrence of a character in a string

    Hello Experts,
    I have a scenario where in I have to check the occurrence of a character in a string and based on that I have to pass a data into target field.
    I was wondering whether this can achieved with mapping functions or Do I have to use an UDF.
    Thanks in advance.
    Regards
    Advit Ramesh

    Hi Advit,
    You can achieve this by using standard function indexOf from the text category. Pass in the input string and the character value you want to check for as the input.
    Standard Functions (SAP Library - SAP Exchange Infrastructure)
    If the output is -1, then the character is not in the string, otherwise it is.
    Rgds
    Eng Swee

  • How to check the whole values of a set of map exist in the vector of map?

    Hi Friends!
    I have a set of map; map<int, set<int>>myset;
    and a vector of map; map<int,vector<int>>myvec;
    myset contains;
    1=>11  16  30
    3=>2  11
    6=>2
    7=>9  12  16
    8=>9  13  16
    myvec contains;
    1=>11  15  21
    2=>16
    3=>11  16
    4=>2  13
    5=>11  16  30
    6=>9  5  10
    First, the first value of myset(11  16  30) will be checked with all the values of myvec, if the whole value(11  16  30) available at certain value in the myset, then it gives the key of myvec. So, the output for the first value is 5.
    Next, if you consider the value (2  11) in the myset, there are no matching values that contains whole 2  11 in the particular value in myvec. Therefore, what we do is, delete the last value of the current set, that is 11, and now consider 2 as
    the value and find the matching value from myvec. That is (2  13) and the key is 4.
    Like wise when we find the first possible match, then we print the key of myset immediately, there may be some other possible values available in the values of myset.
    I have written two functions that check the particular whole values of the myset matched with a particular values in myvec.
    bool IsValueInVec(int value, const IntVec& v2)
    IntVec::const_iterator itv=find (v2.begin(), v2.end(), value);
    if (itv!=v2.end())
    return true;
    return false;
    bool AreAllValuesInVec(const IntSet& s1, const IntVec& v2)
    for(set<int>::const_iterator sit=s1.begin();sit!=s1.end();++sit)
    if (!IsValueInVec((*sit), v2))
    return false;
    return true;
    Could anyone help me to solve this?

    You have neither a set of map nor a vector of map.  You have two maps.  Each contains keys of type int.  The mapped values of one are of type set<int>.  The mapped values of the other are of type vector<int>.  If
    you don't understand the types of the objects you are using, you will never be able to use them properly.
    Help you solve what?  Do the two functions you wrote perform as desired?  If not, provide a complete description of how what they do differs from what you want.
    Somewhere in code you have not shown, you need to call AreAllValuesInVec for a particular set and vector.  If this function returns false and if the set contains more than one element, you need to delete the last element of the set and try again. 
    If the set contains only a single element, you need to perform some "failure" processing that you have not described.  When the function returns true, you need to print the key of the map element which contains the vector.  What are you
    having trouble with?

  • HOW TO CHECK THE CHECKBOX VALUE WITH SQLCE DATABASE

    Hai All,
       Good Day! I am using VB in Visual Studio 2008. I have a form with check boxes and one button control. If i selected the check box and then click the button, check the database table field and check box text are equal. if both are equal then
    how to check?
     I have tried it. The code is:
    Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim conn As New SqlCeConnection
    Dim cmd As New SqlCeCommand
    conn.ConnectionString = "DataSource = E:\Vbprojectex\WindowsApplication3\WindowsApplication3\Database1.sdf"
    Try
    cmd.Connection = conn
    conn.Open()
    If CheckBox1.CheckState = 1 Then
    cmd.CommandText = "SELECT Aerator FROM ttabpagelist where Aerator = CheckBox1.Text"
    TextBox1.Text = 1
    End If
    cmd.ExecuteNonQuery()
    Finally
    conn.Close()
    End Try
    End Sub
    End Class
    Thanks & Regards Sasi ................. Go Green

    probably something like (ofc below will never give result since Aerator can't have 2 values, you will have to adjust the second check box column obviously)
    Try
    cmd.Connection = conn
    conn.Open()
    dim strsql as string = "= "SELECT Aerator FROM ttabpagelist "
    Dim whereConcatenator As String = " WHERE "
    Dim Wherestatement As String = String.Empty
    If checkbox1.checked = True Then
    Wherestatement += whereConcatenator
    Wherestatement += "Aerator = " & checkbox1.Text
    whereConcatenator = " AND "
    End If
    If checkbox2.checked = True Then
    Wherestatement += whereConcatenator
    Wherestatement += "Aerator = " & checkbox2.Text
    End If
    cmd.commandtext = strsql & wherestatement
    TextBox1.Text = 1
    End If
    cmd.ExecuteNonQuery()
    Finally
    conn.Close()
    End Try

  • How to check the maximum Value and Last value in Reports CP column

    Hi all
    First of all i am sory that iam posting this question in forms instead of Reports....i had posted it in reports but no one reply and i need uirgent solution so I post here....
    My problem is that in Report I have calculated some values in CP column......Like
    :CP_Total := :Frieght * Rate ...etc
    Know i want to ask that how can I get the last value that will be return the by this column????and also the maximum value that it will return
    Thanks in advance
    Shayan
    [email protected]

    You mast build Summary column out of the query and select maximum to your maximum value of CP in Report level (or last for last value).

  • How to check the integer value with Date Column

    Hi Friends,
    I have a filter called 'Days'. I need to show the data based on the Days filter (Example : 2 Days).
    Example Query:
    Select * from Tb1
    Where EndDate(Value as '03/05/2013' > Days ( value as 2)
    How to handle the above scenario.
    Thanks in Advance....
    Regards,
    LuckyAbdul

    what meanings does it make. how can you compare a date to day count. Or is the inetger value an offset ie say 2 days from today etc?
    If yes you can use like below illlustration
    DECLARE @DayOffset int
    SET @DayOffset = 2
    SELECT *
    FROM TAble
    WHERE ENdDate >= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),@DayOffset+1)
    refer
    http://visakhm.blogspot.in/2010/01/some-quick-tips-for-date-formating.html
    Please clarify with an example what you're expecting if its different from the above.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to check the source query of tabular form ....

    Hi All ,
    is there any way to change the source query of tabular form ......
    ya ... i could see it in the source but it is normal sql query ....
    where as to generate the addrow functionality the sql query must be
    Select empno , ADD_ITEM.TEXT(1,empno), ename ,ADD_ITEM.TEXT(2,ename)................
    then where can i find this query .?
    i could see that ADD button is calling ADDROW process and which inreturn calling ADD function ....
    can any one tell me , where to see the code for this ADD function ....
    as i checked it in db ..... it is not there at all.

    You can have a look here for the manual tabular forms:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • HOW TO CHECK THE SUM VALUE AS NAGETIVE OR POSITIVE

    Hi All,
      I  have a requirement where i got a flat file where in the footer i got sum which may be positive or negative..(most of the time it is wrong)
    So, in the mapping i calculate the sum and then send this to ouput, but the sign feild is not comming right.
    If the incoming flat file is contains a negative( sum is also wrong) amount then i got a nagative sign in the output( but the sum is right )
    For example ::
    If the file contains a sum of      <b> 100.00-</b> in the footor.
    Xi takes the file calculate the right amount( <b>Suppose 50.00</b> ) but in the output file it is showing us as <b>50.00-</b>
    I have a sign feild in the mapping in both inboud and outbound message type. I just want to show the right amount (which it is showing after calculating) with the right sign(which it is not showing.)
    I will be glad for suggestion.\
    Thanks.

    Thanks guys,
    it's solved...

  • How to check the tables we have created in JDBC??

    I have created a table called COFFEE2 in a datasource called temp which is in SQL server...How to check the table values??
    i went into administrative tools and odbc cource then i could see the data source i have created but how to see the table??
    Can anyone help??
    thanx

    Hmm.. not sure that I understand the problem.
    Call getConnection on the DataSource, and then execute the select query on the connection.
    Kaj

  • How to verify the  Source systems connectivity with BWQ System.

    Hi All,
    I have diff source systems. And my requirement is to check the source systems connectivity with BWQ (BW Quality sys). please any body tell me the steps how to check the source system connectivity ?
    Thanks & Regards,
    Manju

    Hi Manjula,
    If you encounter problems when establishing a connection to your target server, check the following:
    A message box appears while performing one of the following actions:
          Setting connection by choosing Apply to local session.
          Testing connection settings by choosing Test settings.
          Creating SAP TSQL objects
    If errors occurred, they are displayed in the respective message box.
       Check developer trace files in ST11.
      Test connection:
         For RFC related errors, check the RFC connection via SM59
         For database multi-connect errors, check if you can connect to the target SQL Server with the SQL Server Query Analyzer. Also check if the DBCON entries are correct.
    Regards,
    RK

  • How to check the value in Table CDPOS

    Mostly I can't see the following fields value in the table CDPOS,
      (1) CDPOS-VALUE_NEW
      (2) CDPOS-VALUE_OLD
    In fact, it should have values, so how to check the values, is there any special method needed?
    Thanks and best regards.

    Ferry Lianto,
    Thank you very much for your expertise.
    It's helpful to get some contents via FM:CHANGEDOCUMENT_READ_POSITIONS, the problem is, to some kind of DELETION operation, the log in table CDPOS is very simple, I still don't know which contents were deleted even though I found records in table CDPOS.
    Is there any other suggestions?
    Thanks and best regards.

  • SAPUI5 : How to set the date value format for DateTimeInput?

    Hi SAPUI5 experts:
    I'd like ask 2 things regarding the control: sap.m.DateTimeInput
    1: Here is I want to do: show the current date (May 1, 2014) in the control in format as "01-05-2014". But by default the following code shows "May 1 2014". How can I show it as "01-05-2014"?
    var oDateTimeInput = new sap.m.DateTimeInput({});
    oDateTimeInput.setDateValue(new Date());                   //shown as "May 1 2014"
    2. Can someone explain what difference is between the following settings of DateTimeInput?
       ValueFormat
       DisplayFormat
    Please write a short code example.
    Thanks very much in advance!
    Br,
    Dong

    Hi,
    to understand ValueFormat and DisplayFormat, you can refer this example from ui5 testsuite sap.m.DateTimeInput and check the source code.
    in one of the example, this is how valueformat and displayformat is used.
    // free style date value assingment according to valueFormat
                                                    dti3 = new sap.m.DateTimeInput({
                                                                    value : "05-29, 2012",
                                                                    valueFormat : "dd-MM, yyyy",
                                                                    displayFormat : "dd MMMM, yyyy",
                                                                    width : "20%",
                                                                    change : function(e) {
                                                                                    console.log(dti3 + " : " + e.getParameters().newValue + " # " + e.getParameters().newDateValue);
    also in both cases, Default value is taken from locale settings.
    Regards,
    Chandra

Maybe you are looking for

  • Question for those with memory issues on k8n neo plat

    I have been having issues with my memory on the k8n neo platinum board since i built the system last month and i just recently discovered a fact I had overlooked. I Have discovered that  if i test the system while it is cool (having sat turned off ov

  • Safari 4.0.1 crashes a few seconds after starting

    Hello, Safari is having problems to start up as following: the apple start page appears, shows only an incomplete view (only the side and top panels) and then crashes showing "The application safari quit unexpectedly". The application has no add-ons

  • Calling a web service using a wsdl

    I am trying to access a web service from a button in Lifecycle Designer.  I have successfully done the following: 1.  added a Data Connection that connects to the web service via a wsdl file 2. dragged the request, response, and button items onto the

  • Make custom theme available for the "Create new app" wizard

    Hi all, I have a general problem. Imagine you have created a theme for ApEx. The theme makes applications look as demanded by the design principles of a company. The company now wants everyone developing ApEx applications to use the developed theme.

  • Nokia 5310 not starting up properly

    Hey everyone, I thought my phone had run out of battery, so connected to charger and tried to turn on. Did turn on, but just showed white screen with 'NOKIA'. This screen then disappears after about 6 seconds and goes blank. This happens every time i