UDF to check the amount value

Hi
I have a scenario where i have to check the amount value sholuld be greater than Zero or not, if it is not greater than zero i have to raise an exception and skip that record ..
i wanna do that using UDF..How we do that
venkat

Hi paul
I need to Import Any Java packages .
It s giving Error :
Source code has syntax error:  /usr/sap/D06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map08e7dc10452d11dcb4a1e210bc394725/source/com/sap/xi/tf/_MM_ACEAwardInformation_to_TaxBalances_.java:113: operator > cannot be applied to java.lang.String,int if(Amount>0)
My code
public String AmountValue(String Amount,Container container){
int AmountValue =Integer.parseInt( Amount);
try{
if(Amount>0)
create record;
else throw new Throwable("Records not greater than 0...");
}catch(Throwable t){}
venkat

Similar Messages

  • UDF for Checking the field value

    Hi
    I want to check the whether the fiels conatins any value or not in mapping ... if not i want to raise the exception using the UDF
    DO any one have sample code for writing the UDF
    SV

    Hi SV
    what is your requirement first that should br clear.
    i am giving you two UDF
    1) i have written this uDF for string and comparing the field value XYZ
    2) i am entering a string and its returning aa string which starts from the index of your input fixed length
    int len = a.length();
    String res = "";
    String temp = "";
    if ( len >= 10)
    temp = a.substring(0,10);
    if ( temp.equals("XYZ"))
    res = temp;
    else
    res = "";
    return res;
    =======================================
    String fixed = "ABCD";
    String res = "";
    int index = -1;
    index = a.indexOf(fixed);
    if (index == -1)
    res = "NO INDEX FOUND";// or if u wanna set it as null res = "";
    else
    res = b.substring(index4,index12);
    return res;
    ===
    hope these may solve your problem
    Thanks
    Sandeep sharma
    If helpful reward points

  • 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.

  • T.Code for checking the total value of a material

    Hi Experts,
      Can anybody tel me the T.code for checking the total value of a material which is procured in a specified period?
    Thanks in advance
    Channa

    Refer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get PO-GRN-INVOICE Qty & Value details
    Last button on Application tool Bar it is in line of filter, total etc icons
    Also check below reports :
    MC$G - PURCHIS: Material PurchVal Selection
    MC$0 - PURCHIS: PurchGrp PurchVal Selection
    MC$< - PURCHIS: MatGrp PurchVal Selection
    MC$4 - PURCHIS: Vendor PurchVal Selection

  • Any function to check the input value is integer?

    May I know if there's any function to check the input value is integer in Form 4.5?
    Thanks.

    just to add :) - (couldn't resist) :
    create or replace function is_integer ( p_number in varchar2 ) return boolean is
      v_return boolean := true;
      v_number number;
    begin
      v_number := p_number;
      if v_number != trunc(v_number) then
        v_return := false;
      end if;
      return v_return;
    exception
      when others then
        v_return := false;
        return v_return;
    end;
    begin
      if not is_integer(1.1) then
        dbms_output.put_line('is not');
      end if;
      if is_integer(1) then
        dbms_output.put_line('is');
      end if;
      if not is_integer('a') then
        dbms_output.put_line('is not');
      end if;
    end;

  • [SOLVED]problem about wc to check the amount of the processes through

    #problem about wc to check the amount of the processes through ps
    hi.this is the processes current
    $ps
    PID TTY TIME CMD
    2674 tty3 00:00:00 bash
    2689 tty3 00:00:00 mocp
    2746 tty3 00:00:00 ps
    $ps | wc -l
    5
    The problem:since there are 4 lines of ps output here,why wc -l shows the number "5"?
    And if i redirect ps to a file and then check the lines number with "wc -l",it's "4".
    $ps > out
    $cat out
    PID TTY TIME CMD
    2674 tty3 00:00:00 bash
    2689 tty3 00:00:00 mocp
    2753 tty3 00:00:00 ps
    $cat out | wc -l
    4
    Any idea?Thanks.
    Last edited by wanghonglou82 (2011-10-07 06:49:44)

    falconindy wrote:Working as intended. wc is running when you pipe ps to it.
    hi.thank you.
    The clue you bring here sounds reasonable.But a little more confusion to me comes around.I will check the bash rules for digest commands.thanks.

  • Message AU390 when I check the aset values

    Hi Gurus,
    I get the message AU390 when I check the aset values via the asset explorer.
    To sum up the situation, we have created a fixed asset Capitalized on 31.10.2002.
    Then in asset explorer in depreciation area 10 i have the following values:
    Status-- Per.--Old dep.
    Legacy data transfer-2-----2,77
    Posted--3--
    0,72-
    Posted--4--
    0,68
    Posted--5--
    0,68
    Posted--6--
    0,68
    Posted--11----0,68
    Posted--12--
    260,63 (This value is wrong!!!!!)
    I don't understand and don't find where the problem can comes from!
    Could you please advice a solution if you already had this problem.
    Thank you SO much.

    Hi,
    I think in that period (i.e.12) the Depreciation Key has been change (hopefully with a higher depreciation rate) . So SAP will recalculate and do a catch up Depreciation and post in that period.
    Hope this helps
    Thanks & Regards
    Om

  • 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 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

  • 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 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

  • HT2736 How can I check the amount of a gift card

    I purchased several gift cards , now I don't know what the amounts are.  How can I get a card balance amount.

    Unless the card's have their amounts written on them then the only way to know their values is to redeem them onto an account.
    If you've already redeemed the card then the card is now zero, anything that you haven't spent should be on your account

  • Comma not seen in the amount value in SAp Script

    Hi,
    I am printing the folllowing values which contain amounts in SAP Script.
    <Z>Sum total,,,,,,&REGUD-SWRBT(13)&,,&REGUD-SWABZ(9)&,, &regud-swnet(13)&</>
    Both the values are printed as the following
    REGUD-SWRBT  = 20000,000.00
    regud-swnet         = 20000,000.00
    I want the same to be printed as below.
    (ie the comma seperator to be printed in the second set of 3 zeroes as well)
    REGUD-SWRBT  = 20,000,000.00
    regud-swnet         = 20,000,000.00
    Can any one suggest me please.
    Thanks !!
    Regards

    Hi Adarsh,
    Actually the problem here is that the field length of the field SWRBT is only 13 and the extra comma you want, can not be accommodated there.
    You will have to declare a variable of about 14-15 field length and then
    pass this value in it. Definitely the comma will appear.
    Hope this is Useful.
    Thanks,
    Daya.

  • 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

Maybe you are looking for

  • Problem with recognising radeon 6490M graphics card on Pavilion dv6-6176sa

    So, My laptop was having some issues recently with the graphics, it basically wouldn't recognise either the intel or the radeon graphics card. I tried updating all drivers under the sun but nothing worked. In the end I formatted my computer and reins

  • How to resolve Tuxedo 6.5 error  getting on the new HP-Itanium server

    Hi guys, We had tuxedo 6.5 installed on old server which is HP-PA Risc server and Os is HP-UX B11.11. Where as we cloned and migrated that file systems related to Tuxedo to new server which is Configured with HP_Itanium and Os HP-Ux B11.23. We freshl

  • TextEdit no longer opens iCloud docs

    I have been using TextEdit on iCloud for a long time. But suddenly when I try to open a file from the cloud it says it cannot open it. It shows me all the files, and in the Open File window I can click on a file, press the spacebar and see a preview

  • Revenue analysis report: sap report S_ALN_01001159 : missing information

    Hello, Athough profit/loss types were linked to all update types, the profit&loss type for accrued interest update type are not reported for an unkown reason. Does anyone have good or bad experience with the standard version of this report? Any clue

  • X240 VGA connection to TV shows wrong resolution

    Hello, I recently migrated Win8.1 from X240 HDD to SSD, and replaced the stock HDD with the SSD. I managed to reset the system to the original Win8 factory settings, and updated through Windows update to Windows 8.1. I also used Intel Driver Utility