Query Required for FMS

Dear Expert
           I want the Query for to convert Value in to words,the value is  the document total value.

HI,
Try This It may help you
->> Create 1 UDF in Header on Requrie Documents (ex. Marketing Documents).
->> Create 3 Function in MSSQL Server Management.
->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
for example:
Create UDF in Header on Marketing Documents.
->> Choose Tools on Top menu.
->> User - Defined Fields. -> User Manage Fields.
->> Open the User Manage Fields Widnow.
->> Marketing Documents. -> Title.
->> Select Title and Click Add button in Bottom on User Manage Fields Window.
->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
Create Function in MSSQL Server Management.
Check this Link, (have 3 Functions in Link).
http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
1st Funciton - to Convert one Digit Number to words
2nd Funciton - to convert 2 digit number to words.
3rd Funciton - to convert amt in numbers to words.
->> Open the MSSQL Server Management Window.
->> Choose your Company database and Create NEW Query.
->> Create 3 Function Queries one by one.
->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
2nd New Query tab put the 2nd Function then Run the Function.
3rd New Query tab put the 3rd Function then Run the Function.
Create FMS in Query Generator and Save as Query Manager.
->> Adminstration.
->> Reports. -> Query Generator.
->> Open the Query Generator and put the below FMS query.
for example : Purchase Order Doc. Toal(in wrods).
declare @Doc_total numeric (19,6)
set @Doc_total=$http://OPOR.DocTotal
select dbo.fNumToWords (@Doc_total)
->> Assign the FMS in UDF on Purchase Order.
->> Auto Refresh of Document Total.
Ex.
1. Goto the UDF and Clcik Shift+Alt+F2.
2. Select the SEARCH BY SAVED QUERY.
3. Assign the FMS Query.
4. Select the AUTO REFRESH WHEN FIELD CHENGES.
5. Select Document Total.
6. Check the Display Saved Values
I am including here, source code of functions required for converting Number into words according to Indian or Nepali Numbering style. In Indian or Nepali Numbering style, 100000 is 1 Lakh and 100 Lakhs or 10000000 is 1 Crore. This makes the numbering style different from English and International Numbering Style.
1. Function to Convert one Digit Number to words.
CREATE    Function dbo.fConvertDigit(@decNumber decimal)
returns varchar(6)
as
Begin
declare
@strWords varchar(6)
Select @strWords = Case @decNumber
     When '1' then 'One'
     When '2' then 'Two'
     When '3' then 'Three'
     When '4' then 'Four'
     When '5' then 'Five'
     When '6' then 'Six'
     When '7' then 'Seven'
     When '8' then 'Eight'
     When '9' then 'Nine'
     Else ''
end
return @strWords
end
2. Function to convert 2 digit number to words.
CREATE    Function dbo.fConvertTens(@decNumber varchar(2))
returns varchar(30)
as
Begin
declare @strWords varchar(30)
--Is value between 10 and 19?
If Left(@decNumber, 1) = 1
begin
Select @strWords = Case @decNumber
     When '10' then 'Ten'
     When '11' then 'Eleven'
     When '12' then 'Twelve'
     When '13' then 'Thirteen'
     When '14' then 'Fourteen'
     When '15' then 'Fifteen'
     When '16' then 'Sixteen'
     When '17' then 'Seventeen'
     When '18' then 'Eighteen'
     When '19' then 'Nineteen'
end
end
else  -- otherwise it's between 20 and 99.
begin
Select @strWords = Case Left(@decNumber, 1)
     When '0' then '' 
     When '2' then 'Twenty '
     When '3' then 'Thirty '
     When '4' then 'Forty '
     When '5' then 'Fifty '
     When '6' then 'Sixty '
     When '7' then 'Seventy '
     When '8' then 'Eighty '
     When '9' then 'Ninety '
end
Select @strWords = @strWords + dbo.fConvertDigit(Right(@decNumber, 1))
end
--Convert ones place digit.
return @strWords
end
3. Function to convert amt in numbers to words. (Built with the help of above 2 functions)
CREATE function dbo.fNumToWords (@decNumber decimal(12, 2))
returns varchar(300)
As
Begin
Declare
@strNumber varchar(100),
@strRupees varchar(200),
@strPaise varchar(100),
@strWords varchar(300),
@intIndex integer,
@intAndFlag integer
Select @strNumber = Cast(@decNumber as varchar(100))
Select @intIndex = CharIndex('.', @strNumber)
if(@decNumber>99999999.99)
BEGIN
RETURN ''
END
If @intIndex > 0
begin
Select @strPaise = dbo.fConvertTens(Right(@strNumber, Len(@strNumber) - @intIndex))
Select @strNumber = SubString(@strNumber, 1, Len(@strNumber) - 3)
If Len(@strPaise) > 0 Select @strPaise = @strPaise + ' paise'
end
Select @strRupees = ''
Select @intIndex=len(@strNumber)
Select @intAndFlag=2
while(@intIndex>0)
begin
if(@intIndex=8)
begin
  Select @strRupees=@strRupees+dbo.fConvertDigit(left(@decNumber,1))+' Crore '
  Select @strNumber=substring(@strNumber,2,len(@strNumber))
  Select @intIndex=@intIndex-1
end
else if(@intIndex=7)
begin
  if(substring(@strNumber,1,1)='0')
  begin
   if substring(@strNumber,2,1)<>'0'
   begin
    if (@strRupees<>NULL and substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise=NULL)
    begin
     Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
     Select @intAndFlag=1
    end
    else
    begin
     Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
    end
    Select @strNumber=substring(@strNumber,3,len(@strNumber))
    Select @intIndex=@intIndex-2
   end
   else
   begin
    Select @strNumber=substring(@strNumber,3,len(@strNumber))
    Select @intIndex=@intIndex-2
   end
  end
  else
  begin
   if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0'  and @intAndFlag=2 and @strPaise='')
   begin  
    Select @strRupees=@strRupees+' and ' + dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
    Select @intAndFlag=1
   end
   else
   begin
    Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
   end
   Select @strNumber=substring(@strNumber,3,len(@strNumber))
   Select @intIndex=@intIndex-2
  end
end
else if(@intIndex=6)
  begin
   if(substring(@strNumber,2,1)<>'0' or substring(@strNumber,3,1)<>'0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and @intAndFlag=2 and @strPaise='')
   begin
    if len(@strRupees) <= 0
    begin
     if convert(int,substring(@strNumber,1,1)) = 1
     begin
      Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
      Select @intAndFlag=2
     end
     else
     begin
      Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
      Select @intAndFlag=2
     end
    end
    else
    begin
     if convert(int,substring(@strNumber,1,1)) = 1
     begin
      Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
      Select @intAndFlag=1
     end
     else
     begin
      Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
      Select @intAndFlag=1
     end
    end
   end
   else
   begin
    if convert(int,substring(@strNumber,1,1)) = 1
    begin
     Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
    end
    else
    begin
     Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
    end
   end
   Select @strNumber=substring(@strNumber,2,len(@strNumber))
   Select @intIndex=@intIndex-1
  end
else if(@intIndex=5)
  begin
   if(substring(@strNumber,1,1)='0')
   begin
    if substring(@strNumber,2,1)<>'0'
    begin
     if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
     begin
      Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
      Select @intAndFlag=1
     end
     else
     begin
      Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
     end
     Select @strNumber=substring(@strNumber,3,len(@strNumber))
     Select @intIndex=@intIndex-2
    end
    else
    begin
     Select @strNumber=substring(@strNumber,3,len(@strNumber))
     Select @intIndex=@intIndex-2
    end
   end
   else
   begin
    if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
    begin
     Select @strRupees=@strRupees+' and '+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
     Select @intAndFlag=1
    end
    else
    begin
     Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
    end
    Select @strNumber=substring(@strNumber,3,len(@strNumber))
    Select @intIndex=@intIndex-2
   end
  end
else if(@intIndex=4)
  begin
   if ( (substring(@strNumber,3,1)<>'0' or substring(@strNumber,4,1)<>'0') and substring(@strNumber,2,1)='0' and  @intAndFlag=2 and @strPaise='')
   begin
    Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
    Select @intAndFlag=1
   end
   else
   begin
   Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
   end
   Select @strNumber=substring(@strNumber,2,len(@strNumber))
   Select @intIndex=@intIndex-1
  end
else if(@intIndex=3)
  begin
   if  substring(@strNumber,1,1)<>'0'
   begin
    Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Hundred '
    Select @strNumber=substring(@strNumber,2,len(@strNumber))
    if( (substring(@strNumber,1,1)<>'0' or  substring(@strNumber,2,1)<>'0') and @intAndFlag=2 )
    begin
     Select @strRupees=@strRupees+' and '
     Select @intAndFlag=1
    end
    Select @intIndex=@intIndex-1
   end
   else
   begin
    Select @strNumber=substring(@strNumber,2,len(@strNumber))
    Select @intIndex=@intIndex-1
   end
  end
else if(@intIndex=2)
  begin
   if substring(@strNumber,1,1)<>'0'
   begin
    Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))
    Select @intIndex=@intIndex-2
   end
   else
   begin
    Select @intIndex=@intIndex-1
   end
  end
else if(@intIndex=1)
  begin
   if(@strNumber<>'0')
   begin
    Select @strRupees=@strRupees+dbo.fConvertDigit(@strNumber)
   end
   Select @intIndex=@intIndex-1
  end
continue
end
if len(@strRupees)>0 Select @strRupees=@strRupees+ ' rupees '
IF(len(@strPaise)<>0)
BEGIN
if len(@strRupees)>0 Select @strRupees=@strRupees + ' and '
END
Select @strWords = IsNull(@strRupees, '') + IsNull(@strPaise, '')
select @strWords = @strWords + ' only'
Return @strWords
End
Regards
Balaji Sampath

Similar Messages

  • Hardware requirements for FMS

    Hello,
      I work on a project where FMS will be used as the main streaming server. We are going to use p2p/multicast technology which is available in FMS. My first question is : What are the approximate hardware requirements for such a server ? REMARK : this server will be connected to a switch with 1G/bits ports
      If we use p2p/multicast technology the maximal number of users which the system can handle is (theoretically)unlimited, is this right ? or I miss something ?
    Thank you

    Hi,
    Thanks for your interest in FMS and multicast.
    The generic system requirements for FMS (which includes multicast) is given @ http://www.adobe.com/products/flashmediainteractive/systemreqs/
    And @ http://kb2.adobe.com/cps/869/cpsid_86913.html
    Yes, as you mentioned, the maximum limit of users in unlimited for p2p, technically.

  • Query required for JE posted with the customer

    Dear Experts,
                   Following is the scenario - Accountant passes Journal Entries once in a while with regard to customers also, i would require a alert for the scenario.
                    Whenever the user posts a JE with regard to a customer alert has to generate to the manager else a query report is required would do.
    Saravanan

    Hi,
    You can use the below as an alert for Manual Journal Entries that has been created the last 2 days with posting to Business Partner account.
    SELECT t0.transid, t0.shortname
    FROM JDT1 T0 INNER JOIN OJDT T1 ON T0.TransId = T1.TransId
    WHERE shortname <> account and  T1.createdate > getdate()-2 and t0.transtype = 30
    If you want to have a different date range just change the '-2' to the amount of days you want, if you only want entries created today, just remore it. If you prefer it to be by posting date rather than by creaation (system) date, just change createdate to refdate.
    Hope it helps,
    Jesper

  • Query required for below situation.

    Hi All,
    I have two table
    T1 --> deal_site_id, subsection_id
    T2 --> deal_site_id, subsection_id, catalog_id
    requirement is first I need to check all the subsection_id in table T1 depending upon one deal_site_id.
    Then what ever subsection_id I get from table T1 I need to check if those are available in table T2. If they are available then do nothing but if they are not available in table T2 then delete the row from table T1.
    I've tried to write the query like below but stuck with exception.
    DELETE FROM (SELECT * FROM T1 lid inner join T2 ld
    ON LID.DEAL_SITE_ID = LD.DEAL_SITE_ID
    WHERE lid.deal_site_id = 3070
    AND LD.SUBSECTION_ID NOT IN (SELECT DISTINCT liod.subsection_id from T1 liod where liod.deal_site_id = 3070 )
    this is giving me an exception like ORA-01752: cannot delete from view without exactly one key-preserved table
    Please help me to write this query. Thanks in advance.
    Regards,
    Subhadeep
    Edited by: sumajumd on Feb 2, 2012 3:08 AM

    Hi, Subhadeep,
    That sounds like:
    DELETE FROM     t1
    WHERE     deal_site_id     = 3070     -- or whatever
    AND     subsection_id   NOT IN (
                          SELECT  subsection_id
                          FROM    t2
                          WHERE   deal_site_id     = t1.deal_site_id
                          AND       subsection_id     IS NOT NULL     -- If necessary
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as DELETE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.

  • Query required for rule

    Below is the condition for which a query is to be written.
    as of now this the query i have written. am getting the orderids which satisfy this rule but the output should include all those orderids which already satisfy the rule.(i.e the current o/p contains those orderids which share a common circuitid and have same start and end dates. the output required should include this as well as those orderids tat do not share circuitids.
    or
    the o/p should contain those orderids which do not fall into any of these categories)
    The Rule:
    For the Entity Circuit Orders if the Circuit Id is same for two different order IDs then the Order Start Date for the Order Id having Order Status as Installed should be same as the Order End Date for the Order Id having Order Status as Retired.
    Tthe query:
    select order_id from managed_element1 where order_status = 'I' and order_start_date in
    (select order_end_date from managed_element1 where circuit_id in
    (SELECT circuit_id FROM managed_element1 where order_status='R' GROUP BY circuit_id))

    The data is as below
    Order_id circuit_id start_date end_date order_status
    ORDER_67 BORDER_2 03/05/06 05/09/06 R
    ORDER_7 BORDER_6 10/26/06 I
    ORDER_11 BORDER_7 12/05/06 12/06/07 I
    ORDER_1 BORDER_2 05/09/06 05/19/06 R
    ORDER_2 BORDER_2 05/19/06 I
    ORDER_3 BORDER_3 04/03/06 05/20/06 R
    ORDER_4 BORDER_3 05/20/06 I
    ORDER_5 BORDER_4 02/05/06 05/06/06 R
    ORDER_6 BORDER_4 05/05/06 I
    ORDER_7 BORDER_5 10/22/02 02/23/03 R
    ORDER_8 BORDER_5 02/23/03 I
    ORDER_9 BORDER_6 03/12/06 09/26/06 R
    ORDER_10 BORDER_6 09/26/0610/26/06 R

  • Query Requirement for Stock on hand.

    Hi All,
    Actually I am have written a query for showing a running total for an Item with all Sales Order and Purchase Order order by ship date (due date).
    SELECT T0.[ItemCode], T0.[ShipDate],t2.[CardCode],t4.[OnHand],-T0.[OpenQty]*t4.[NumInSale] as StockMovt FROM RDR1 T0 INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry INNER JOIN OITM T4 ON T0.[ItemCode]=t4.[ItemCode] WHERE T0.[ItemCode] =[%0] and T2.[DocStatus] ='o'
    UNION
    SELECT T1.[ItemCode], T1.[ShipDate],t3.[CardCode], t5.[OnHand], T1.[OpenQty] as StockMovt FROM POR1 T1 INNER JOIN OPOR T3 ON T1.DocEntry = T3.DocEntry INNER JOIN oitm t5 ON T1.[ItemCode]=t5.[ItemCode] WHERE T1.[ItemCode]=[%0] and T3.[DocStatus] = 'o' ORDER BY [ShipDate]
    What i require is the additional field which shows the cumulative or running total for each record. Can anyone please help in how it can be achived.
    Thanks & Regards
    Shiva

    Hi Prasanna,
    I made some modification to ur query and its perfectly working. I still have the other query...can you please help me.
    The out put that you have asked for is as follows
    #     ItemCode     ShipDate     CardCode     OnHand     StockMovt
    1     BAS3B     04.06.09     AUCHRA     14,320.00     -108
    2     BAS3B     04.06.09     BLUMER     14,320.00     0
    3     BAS3B     04.06.09     GREENTsup     14,320.00     0
    4     BAS3B     05.06.09     bizzy     14,320.00     -12
    5     BAS3B     05.06.09     BROWNT     14,320.00     -120
    6     BAS3B     18.06.09     GOODVI     14,320.00     0
    7     BAS3B     26.06.09     COLMAN     14,320.00     -15,000.00
    8     BAS3B     30.06.09     GREENTsup     14,320.00     3,000.00
    9     BAS3B     21.07.09     GREENTsup     14,320.00     5,000.00
    10     BAS3B     03.08.09     BEALES     14,320.00     -12
    11     BAS3B     05.08.09     ACORN     14,320.00     -6
    12     BAS3B     16.08.09     JLEWBS     14,320.00     -120
    13     BAS3B     22.08.09     GREENTsup     14,320.00     1,000.00
    14     BAS3B     22.08.09     GREENTsup     14,320.00     2,000.00
    15     BAS3B     25.08.09     BEALES     14,320.00     -6
    16     BAS3B     25.08.09     GREENTsup     14,320.00     2,000.00
    17     BAS3B     27.08.09     BEALES     14,320.00     -6
    18     BAS3B     27.08.09     ELIZAS     14,320.00     -24
    19     BAS3B     01.10.09     GATES     14,320.00     -120
    20     BAS3B     15.01.10     GREENTsup     14,320.00     2,000.00
    Further  to this I need a running total for the stock movement. Basically it nothing but the difference between the last two columns.
    Regards
    Shiva

  • Query required for xml processing.

    This data is present in clob i need to extract the below mentioned field.
    expected query is
    select
    extractvalue( xmltype(table1.column1), '/UserProfileSnapshot/UserInfo/Attribute[@name="Users.Display Name"]' )
    from table1
    first line is incorrect <?xml version = '1.0' encoding = 'UTF-8'?>
    Can anyone please help me in making a query for this incorrect clob data.
    As we cannot change this first line in data.
    "<?xml version = '1.0' encoding = 'UTF-8'?>
    <UserProfileSnapshot key="224" version="1.0">
    <UserInfo>
    <Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
    <Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
    <Attribute name="Users.Xellerate Type">End-User</Attribute>
    <Attribute name="Users.Role">Employee</Attribute>
    <Attribute name="Users.First Name">user</Attribute>
    <Attribute name="Users.Status">Active</Attribute>
    <Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
    <Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Title">MR.</Attribute>
    <Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
    <Attribute name="Country">US</Attribute>
    <Attribute name="State">NY</Attribute>
    <Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
    <Attribute name="Users.Disable User">0</Attribute>
    <Attribute name="Users.Change Password At Next Logon">1</Attribute>
    <Attribute name="USR_CN_GENERATED">0</Attribute>
    <Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
    <Attribute name="Postal Code">10001</Attribute>
    <Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Employee Number">2335</Attribute>
    <Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
    <Attribute name="Users.Last Name">testfuturedate102</Attribute>
    <Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
    <Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
    <Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
    <Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
    <Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Street">500 Madison Ave</Attribute>
    <Attribute name="Users.User ID">31967</Attribute>
    <Attribute name="USR_UDF_CITY">New York</Attribute>
    <Attribute name="Users.Lock User">0</Attribute>
    <Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
    <Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
    <Attribute name="Users.Login Attempts Counter">0</Attribute>
    <Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
    </UserInfo>
    </UserProfileSnapshot>"

    As said in {thread:id=2545133}, the quotes are certainly not the issue.
    This works fine for me on 11.2.0.2 :
    SQL> insert into table1 (column1)
      2  values (
      3  '<?xml version = ''1.0'' encoding = ''UTF-8''?>
      4  <UserProfileSnapshot key="224" version="1.0">
      5  <UserInfo>
      6  <Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
      7  <Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
      8  <Attribute name="Users.Xellerate Type">End-User</Attribute>
      9  <Attribute name="Users.Role">Employee</Attribute>
    10  <Attribute name="Users.First Name">user</Attribute>
    11  <Attribute name="Users.Status">Active</Attribute>
    12  <Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
    13  <Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
    14  <Attribute name="Title">MR.</Attribute>
    15  <Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
    16  <Attribute name="Country">US</Attribute>
    17  <Attribute name="State">NY</Attribute>
    18  <Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
    19  <Attribute name="Users.Disable User">0</Attribute>
    20  <Attribute name="Users.Change Password At Next Logon">1</Attribute>
    21  <Attribute name="USR_CN_GENERATED">0</Attribute>
    22  <Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
    23  <Attribute name="Postal Code">10001</Attribute>
    24  <Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
    25  <Attribute name="Employee Number">2335</Attribute>
    26  <Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
    27  <Attribute name="Users.Last Name">testfuturedate102</Attribute>
    28  <Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
    29  <Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
    30  <Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
    31  <Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
    32  <Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
    33  <Attribute name="Street">500 Madison Ave</Attribute>
    34  <Attribute name="Users.User ID">31967</Attribute>
    35  <Attribute name="USR_UDF_CITY">New York</Attribute>
    36  <Attribute name="Users.Lock User">0</Attribute>
    37  <Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
    38  <Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
    39  <Attribute name="Users.Login Attempts Counter">0</Attribute>
    40  <Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
    41  </UserInfo>
    42  </UserProfileSnapshot>'
    43  );
    1 row inserted
    SQL>
    SQL> select x.*
      2  from table1 t
      3     , xmltable(
      4         '/UserProfileSnapshot/UserInfo'
      5         passing xmltype(t.column1)
      6         columns userdisplay_name varchar2(30) path 'Attribute[@name="Users.Display Name"]'
      7               , user_role        varchar2(30) path 'Attribute[@name="Users.Role"]'
      8       ) x ;
    USERDISPLAY_NAME               USER_ROLE
    testfuturedate102, Mr. user    Employee

  • Query required for the below result format:

    Table(DATA):
    Bank_id Device_type Status date Station_status               
    1011     N          Y     3/23/2012           DOWN
    1011          N          Y     3/23/2012          up
    1011          N          y     3/23/2012          up
    1011          E          Y     3/23/2012          down
    1011          E          I     3/23/2012          down
    1011          W          Y     3/23/2012          up
    1012     N          Y     3/23/2012           DOWN
    1012          N          Y     3/23/2012          up
    1012          N          y     3/23/2012          up
    1012          E          Y     3/23/2012          down
    1012          E          I     3/23/2012          down
    1012          W          Y     3/23/2012          up
    1013     N          Y     3/23/2012           DOWN
    1013          N          Y     3/23/2012          up
    1013          N          y     3/23/2012          up
    1013          E          Y     3/23/2012          down
    1013          E          I     3/23/2012          down
    1013          W          Y     3/23/2012          up
    (SELECT QUERY RESULT SHOULD BE LIKE THIS):Report result:
    Bank_id----Date-----TOTAL---UP_STATUS--DOWN_STATUS-----DEVICE
    1011 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    1012 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    1013 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    N<2>N<1>,E<0>E<2>,W<1>W<0> this mean(INDICATES)
    In N 2 UP 1 DOWN
    IN E 0 up 2 down
    In W 1 up 0 down
    SCRIPTS:
    CREATE TABLE FIMS_TEST
    BANK_ID VARCHAR2(10 BYTE),
    DEVICE_TYPE VARCHAR2(10 BYTE),
    STATUS VARCHAR2(1 BYTE),
    DATE_TS DATE,
    STATION_STATUS VARCHAR2(10 BYTE)
    INSERT SCRIPT:
    SET DEFINE OFF;
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:30:48', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:26', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:55', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'E', 'Y', TO_DATE('03/26/2012 16:33:51', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'I', 'Y', TO_DATE('03/26/2012 16:34:15', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'W', 'Y', TO_DATE('03/26/2012 16:34:39', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:13', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:56', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:36:48', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'E', 'Y', TO_DATE('03/26/2012 16:37:17', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'E', 'I', TO_DATE('03/26/2012 16:37:42', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'W', 'Y', TO_DATE('03/26/2012 16:38:10', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:38:37', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN ');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:23', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:54', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'E', 'Y', TO_DATE('03/26/2012 16:40:19', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'E', 'I', TO_DATE('03/26/2012 16:40:53', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'W', 'Y', TO_DATE('03/26/2012 16:41:17', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    COMMIT;

    thanks in advance
    can any one help me please

  • Query Required For sort

    CREATE TABLE COUNTRIES(CID INT,CNAME VARCHAR(100))
    INSERT INTO COUNTRIES VALUES(1,'AUSTRALIA')
    INSERT INTO COUNTRIES VALUES(2,'INDIA')
    INSERT INTO COUNTRIES VALUES(3,'FRANCE')
    INSERT INTO COUNTRIES VALUES(4,'BERLIN')
    SELECT * FROM COUNTRIES
    o/p
    CID CNAME
    2 INDIA
    1 AUSTRALIA
    4 BERLIN
    3 FRANCE
    here India should be always first position remaining countries values should be in sorted order

    You can use a conditional sorting =>
    SELECT *
    FROM COUNTRIES
    ORDER BY CASE WHEN CNAME = 'INDIA'
    THEN 0
    ELSE 1 END,
    CNAME
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to search in BI 7.1 query designer for the required key figures & chars

    Hi All,
         Can anyone plz tell me how to search in BI 7.1 query designer for the required key figures & characteristics. I have the query being built on a multiprovider which has many cubes.
    So, i have a huge list of key figures and characteristics. I am not able to search for the required one by the name or the technical name.
    How can we search and pick the required object from the enormous list of the Mutliprovider in the Bex Query Designer??
    Thanks
    Phani

    There is not a search feature available. You have to do an educated guess under what dimension your infoobject could be and select.

  • Which authorizations are required for assigning a query to a role?

    Hi everybody,
    we try to set up some roles for "reporting power users". These guys should be alble to define new queries using BEx (works fine) and also should be able to assign these new defined queries to a role, so other users can use these roles.
    The idea is simple, but we're searching for the right authorization object (or - as i suppose - set of authorization objects) that enables the user to assign a query to a role (using that "enter to a role" button in the open / save dialog).
    At the moment, the user can user that button, and the role, he should the query assigned to is shown. After selecting the role and clicking button "create" it take some seconds and a message "error when saving. entry has not been created" is shown.
    Obviously, there is a problem with writing the role (or adding the new information to that role).
    So, could anyone help me and provide me with a list of authorization objects that are required.
    Thanks in advance,
      Alfred

    S_RFC
    S_TCODE
    S_USER_GRP
    S_BDS_D
    S_OD_SEND
    S_RS_AUTH
    S_RS_BCS
    S_RS_COMP
    S_RS_COMP1
    S_RS_FOLD
    S_RS_ICUBE
    S_RS_MPRO
    The above mentioned authorization objects are enough to add in the role and required for the accessing a query.
    particularly, S_RS_COMP, S_RS_COMP1, S_RS_MPRO, S_RS_ICUBE are the most important auth objects which are directly getting involved in authorization of a query in a role.
    SO, you have to assign the respective info area, info cube and info providers names in these auth objects.
    The same scenario , i am using in my project to give access to the queries in all the areas for my end users.
    The values and access/authorizations restrictions is up to your project requirement.
    Hope this would help you.

  • Help required for improving performance of the Query

    Hello SAP Techies,
    I have MRP Query which shows Inventory projection by Calendar Year/Month wise.
    There are 2 variables Plant and Material in free charateristics where it has been restricted by replacement of Query result .
    Another query is Control M Query which is based on multiprovider. Multiprovider is created on 5 cubes.
    The Query is taking 20 -15 Mins to get the result.
    Due to replacement path by query result for the 2 variables first the control M Query is excuted. Business wanted to see all those materials in MRP query which are allocated to base plant hence they designed the query to use replacement Path by Query result. So it will get all the materials and plants from the control M query and will find the Invetory projection for the same selection in MRP query.
    Is there any way I can improve the performance of the Query.
    Query performance has been discussed innumerable times in the forums and there is a lot of information on the blogs and the WIKI - please search the forums before posting and if the existing posts do no answer your question satisfactorily then please raise a new post - else almost all the answers you get will be rehashed versions of previous posts ( and in most cases without attribution to the original author )
    Edited by: Arun Varadarajan on Apr 19, 2011 9:23 PM

    Hi ,
    Please see if you can make these changes currently to the report . It will help in improving the performance of the query
    1. Select the right read mode.
        Reading data during navigation minimizes the impact on
         the application server resources because only data that
        the user requires will be retrieved.
    2. Leverage filters as much as possible. Using filters contributes to
       reducing the number of database reads and the size of the result set,
        hereby significantly improving query runtimes.
       Filters are especially valuable when associated with u201Cbig
        dimensionsu201D where there is a large number of characteristics such as
        customers and document numbers.
    3. Reduce RKFs in the query to as few as possible. Also, define
    calculated & RKFs on the Infoprovider level instead of locally within the query.
    Regards
    Garima

  • Is aggregate DB index is required for query performance

    Hi,
    Cube mange tab when i check for the aggregate DB index it shows red, here my doubt is, is the DB index is required for query performance
    is the check statics should be in green?
    Please let me know
    Regards,
    Kiran

    Hi,
    Yes it improves the reports performance..
    Using the Check Indexes button, you can check whether indexes already exist and whether these existing indexes are of the correct type (bitmap indexes).
    Yellow status display: There are indexes of the wrong type
    Red status display: No indexes exist, or one or more indexes are faulty
    You can also list missing indexes using transaction DB02, pushbutton Missing Indexes. If a lot of indexes are missing, it can be useful to run the ABAP reports SAP_UPDATE_DBDIFF and SAP_INFOCUBE_INDEXES_REPAIR.
    See SAP Help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/1a6473e07211d2acb80000e829fbfe/content.htm
    Thanks
    Reddy

  • Query for calculating raw material requirements for the remaining quantities in sale order.

    Dear SAP Experts,
    Clients requirement :
                                         Client wish to know the quantities of raw materials needs to run the production order inorder to complete the remaining quantities in sale order.
    Need Clarification:
                                  I"m using the below query for this requirement. I wish to know whether this query suits for my clients requirement or not. If its so, I need to know how to group by T4.[Code] (Raw material Name)   and need to get the sum of    T4.[Quantity]  (BOM quantity)      and  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY under each raw material group
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode],T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity] as salesorderQty , T1.[OpenQty], T2.onhand, T4.[Code] as Raw material Name,T4.[Quantity] as BOMQTY,  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] INNER JOIN OITT T3 ON T2.[ItemCode] = T3.[Code] INNER JOIN ITT1 T4 ON T3.[Code] = T4.[Father] WHERE  T0.[DocStatus] ='o' 

    You're posting in the Portuguese B1 space.
    You might want to post in the English one: SAP Business One Application

  • Help Required for Open Sales opportunity query

    Hi Experts
    I need to create a query on Open Sales Opportunity where quotation has not been submitted. also all opportunities with respective sales quotation
    How can i link Opr1 ( Stage), OOPR, oqut table.
    Regards
    Raman

    Thanks Gordon ,
    But this query is for all sales opportunity linked with Sale quotation. also it showing only last quotation .
    In case in 1 sales opportunity i have 3 quotation how can it will manage toh show all quotations linked with one opportunity.
    Regards
    Raman

Maybe you are looking for

  • My MacBook Pro is running really slow.

    Hey. My MBP has been running very slow for some time, and its becoming very frustrating. Straight after I start it up it starts running slow...I have 'Memory Clean' (not sure whether this is helpful or not) and as soon as i my Macbook loads it tells

  • Can't seem to export in iPhoto 9.5

    i tried to export photos to the desktop tonight and it does not work.  I can drag and drop but dont know why i cant export. Tried to quit and reopen and it did not work. i am on my new mbpro with mavericks Thanks Ross

  • Kernel panics despite all fixes

    First, the specs of my system: OSX 10.3.9 G4 Dual 450 with 1gb ram Apple 17" Studio Monitor (clear one) 40 gb Maxtor drive and 120 gb Seagate drive with a 30 gb "Scratch" partition CS2, Office X, Firefox, Apple Mail, Fetch, Dreamweaver, Lotus Notes (

  • Business Partner Role  and Business Partner Grouping

    Hello Everybody! Business Partner Role  and Business Partner Grouping. Which correlation ist between this attributes existing. In which table are this infos stored, In order create I can use e.g. BUPA_CREATE_FROM_DATA but how is the way inversely. Su

  • EP 70 connectivity with ECC 6.0 (SAP NW2004s)

    Hi, I have recently upgrade r3 4.7 (32 bit) to ecc 60 (64bit) We also install EP 70 (NW2004s SR3) I am not able to connect Enerprise Portal 70 to ECC 60 system Also how to put ESS business package in EP regards vikas nagar