Embedding #USER.FULLNAME# in a query

I am trying to retrieve database info on a logged-in user. The user accounts(specifically usernames) on the portal match the ones in my schema.
I am trying to pass #USER.FULLNAME# in my SQL, but the SQL fails.
E.g Select * from <a table> where username = #USER.FULLNAME#

Hi Zubir ,
You are not clear about what you want to do..If it is only doing some thing with the logged in user name you need to do the following
select course_name
from course
where user_id = wwctx_api.get_user
you also need to add the portal30(or appropriate) in the above...
Hope it helps ...If any problem please post it again....
Vishnu Singireddy
null

Similar Messages

  • User entry in a query

    Hi All,
    I have a  query wherein I want to have a user entry but do not want the query result to be affected by it.
    The details of the query are such that in this query I am calculating Sales actuals by posting period (selecting constant months to make a quarter) and sales commitment  by a normal characteristic Fiscal quarter.
    Is it possible that I have a user entry for quarter and have that quarter (selected by the user) displayed in the query but at the same time display the entire data of the query?
    Please advise.
    Thanks and warm regards,
    Sharmishtha

    Hi Anil,
    In rows I have CGL Branch (user netry/multiple values), organizational division(zdivision/user entry) and sales district. In th columns I have Previous to previous year's sales(SALDR NOTECASH restricted with fiscal year/ user entry variable with offset -2) similarly I have previous year's sales. Then I have current year's Q4 sales. For this I have restricted the same key figure with fiscal year/user entry and posting period=jan,feb,mar). This is because ZBDMIS1 does not have ZFIQUART1(fiscal quarter). Then similarly I have to calculate for all the quarters of the current year. Alongside I also have to calculate the commitments for all the quarters. For this I created a cube in which I included ZFIQUART1 (and loaded thru flat file), as customer will give data in quarter. Finally I made query on the multiprovider. Now, in the query I created a new selection for commitment of Q1 and restricted Sales Commitment Value with fiscal quarter = quarter1 and similarly for all quarters.
    But the values of the Sales Commitment val is not coming at all.
    Also I wanted to put quarter as user entry. (just as a display of the selected quarter in columns, we don't want it to filter the data)
    Thanks and warm regards,
    Sharmishtha

  • Record has already been updated by another user. Please re-query and retry

    Hi,
    I want to uncheck the option Send e-mails for canceled notifications in Workflow mailer but getting error in fouth step in workflow Notification mailer:-
    1. Connect to Oracle Applications Manager with SYSADMIN.
    2. select Workflow manager.
    3. Click on EDIT button-->Advanced(Step 1)--->next(step 2)--->next(step 3)---"ERROR"
    This record has already been updated by another user. Please re-query and try again. ORA-06512: at "APPS.FND_SVC_COMP_PARAM_VALS_PKG", line 288 ORA-06512: at line 1
    Regards,

    Pl see if MOS Doc 286418.1 (ORA-06512: At Fnd_svc_comp_param_vals_pkg When Configuring The Java Mailer) can help
    HTH
    Srini

  • CANT execute query with parameter on user defined tables using query genera

    Dear All,
    I have problem when executing query with parameter on user defined tables using query generator.
    It seems SBO cannot accept parameter to query user defined tables.
    I've tried these:
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
    I try to pass the value directly without using parameter and It works
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
    This one works
    SELECT * FROM RDOC T0 WHERE T0.width =[%0]  --- this SUCCESS
    and this one works too
    SELECT * FROM RDOC T0 WHERE T0.width = 595  --- this SUCCESS
    Is there anyone can help me ....???
    Thanks,
    Alfa

    I  generated this code using query wizard ....
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = (N'2' )
    and replaced the (N'2' ) with [%0]
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = [%0]
    and It worked ......
    Thanks 4 all .....

  • How many ways we can create authorization for user groups in sap query reports

    Hi Gurus, I am getting a problem when I am assigning users to user group in sap query report .The users other than created in user groups are also able to add &change  the users .So please suggest me how to restrict users outside of the user group.
    Please send me if u have any suggestions and useful threads.
    Thank You,
    Suneel Kumar.

    I don't think it can be done. According to the link below 'Users who have authorization for the authorization object S_QUERY with both the values Change and Maintain, can access all queries of all user groups without being explicitly entered in each user group.'
    http://help.sap.com/saphelp_46c/helpdata/en/d2/cb3f89455611d189710000e8322d00/content.htm
    Although I think you can add code to your infoset and maybe restrict according to authority group, i.e.:
    Use AUTHORITY-CHECK to restrict access to the database based on user.
    Press F1 on AUTHORITY-CHECK to find out how to use it in the code

  • Unable to run user defined table in Query Generator...

    hi experts,
                         iam unable to run the user defined table in query generator..this is the query iam using...
    Select T0.U_Date from dbo.@ENQHEAD T0 where T0.U_EnqNo='[%0]'
    When i run this query it popups a window & asking EnqNo,when i select any enquiry no it's saying an error like----- Incorrect syntax near '@ENQHEAD'. iam unable to solve the above problem can anybody suggest me sme ideas....
    thanking you,
    shangai.

    Hi Shangai,
    I've just tried to reproduce the issue and found the following query worked correctly for me:
    SELECT T0.[Name] FROM [dbo].[@D01]  T0 WHERE T0.[U_SO]  = '[%0]''
    The only difference I can see is the square brackets [] in my query?
    Regards,
    Niall

  • No of users accessing a bex query

    HI Bw guys,
    we want know no of users accessing our Bex query.Is there any procedure to find out that.Please give the solution for us because we are hurry about this.
    Thanks and regards
    Sreenivas.

    Hi Srinivas,
    If your BI Admin Cockpit is Working Fine and getting loaded to 0TCT_MC01 this cube, then goto  RSRT and Run this Query
    0TCT_MC01/ZQUERY_FRONT_END_OLAP
    The Count shows the number of hit for those queries for that month.
    Similarly there are queries for day wise also.
    Rgds
    SVU

  • Getting user name on a query

    Hi,
    I was trying to get the user that is logged on in a query but I can't. I tried using $user, but this only works in a formatted search, in a form.
    What I want to do is run a query where the user can see its active documents, based on the logged on user.
    Is there any way to use $user in such a query?

    Sergi, here is how to...:
    1. save a query SELECT $[USER]
    2. run it from Queries Manager -> you'll get error
    3. go to Tools -> Queries -> User Queries -> run it.. wwau! it works!
    HTH

  • How to prevent end user to create a Query View and save back to BW Server?

    Dear All :
    Do Someone know that how to setup authorization for Bex Query View Creation? We want to prevent end user to create a Query View to save back to BW Server his favorite folder. when our user run Bex Query, he can base on this query and use Bex Analyzer's save function to save a Query View and save into his favorite folder.
    My question is :
    1. Can we set up a Authorization to prevent end user to save Bex Query View?
    2. Or can I remove Save function from Bex Analyzer to prevent end user use save function, But Developer should not to be prevent .
    Thanks for all of your kindly response.
    Best Regard
    Lawrence Kuo

    Hi.
    Yes, you can do it like you outline in your point 1):
    You need to use the authorization object S_RS_COMP for this. This object let's you control what parts/components of a query the user can do stuff to. So, in your case, you need to have a role for the users, where you do not grant create-access to the component QVW, and then you need another role for developers, where you grant full access or whatever you need for your developers.
    See [this post|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a6c54319-0e01-0010-20a4-fb81ad32f330?QuickLink=events&overridelayout=true&5003637661135] and the [SAP Help entry|http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6859e07211d2acb80000e829fbfe/content.htm].
    You will also need to use the authorization object S_RS_COMP1. If you already have a productive system with users doing reporting, both objects will be maintained in one of the roles already.
    You also want to consider using the object S_RS_PARAM to allow users to create variants for the variabel screen.
    Good luck.
    Jacob

  • Embedding javascript in a sql query

    Hello everybody,
    that is the question, how can a JavaScript function like: getElementById
    can be (if at all be embedded in a sql query? the thing is that when I do the query
    SELECT firstname, lastname etc
    WHERE branchnumber = here is where I want to include the javascript function so that it gets the value from a manually inserted value in a text field that the user enters.
    the item name is P3_X (which is a textfield)
    I would like to put something like
    WHERE branchnumber = getElementById('P3_X').value);
    but it does not parse it ..
    so I may be close but there is something that is not right

    Thank you for your good will Mennam from Turkey. I have found another way of solving it, in the data expresss edition each item you create carries the name you give it, then you make a reference to it on your SQL query, that item can be a combo box, a text field, etc any means for the user to enter data. that works fine.a reference as easy as this one: WHERE ( bookings.branchnumber = :PTEXT )
    Alvaro

  • How to change user group of a query (sq01)

    Hi,
    I'm working with SAP Queries (SQ01) and I don't know how can I change the user group assignation of a query. We did only one user group for all users and queries and know in order to arrange it a bit we've created three user groups.
    We know how to assign users to new user groups but for each query of the old group we neet to move it to one of the new user groups, how could we do this?
    thanks in advance

    Hi
    pls go through these links
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same

  • Calling function using user-defined type from query

    I am in a bit over my head on this, at least at 2:30 in the morning after several hours of intense development. I am working on a function to return financial aging figures by aging date range. I created a user type Aging with a Currency type member for
    each of these.
     Public Type Aging
      Aging0 As Currency
      Aging30 As Currency
      Aging60 As Currency
      Aging90 As Currency
      Aging120 As Currency
     End Type
    I then created a function that accepts the account ID & the as-of date. I have all the rest of the code written to actually calculate all of it, but I am having a fundamental problem figuring out how to call the function. To eliminate any of the complex
    mathematical elements for testing, I have reducted the function to a set of simple explicitly-set values below:
    Public Function GetAging(AccountID As Integer, AsOfDate As Date) As Aging
        GetAging.Aging0 = 0
        GetAging.Aging30 = 0
        GetAging.Aging60 = 0
        GetAging.Aging90 = 0
        GetAging.Aging120 = 0
    End Function
    This all works fine from the immediate window, where I can type this:
    ?GetAging(115,#2015-04-05#).Aging0
    and get the expected response of 0 (I have tested with other values for each member, so I know this part is working correctly).
    But can I and/or how do I call this from a query? I should be able, as a test, to pass in each account # and the current date, just to get the Aging0 element out of my function--something like this:
     SELECT
      AccountID,
      CustomerName,
      GetAging([AccountID],Date()).Aging0
     FROM
      Customer
     ORDER BY
      CustomerName
    I get "The expression you entered has an invalid .(dot) or ! operator or invalid parentheses. But if I remove the ".Aging0", I get this error: Undefined function 'GetAging' in expression. 
    What am I missing here?

    To expand on the answer of Hans, you could use a AgePoint parameter in the function like this:
    Public Function GetAging(AccountID As Integer, AsOfDate As Date, AgePoint As Integer) As Currency
    ' do calculation
    Select Case AgePoint
    Case 0: GetAging = Aging.Aging0
    Case 30: GetAging = Aging.Aging30
    Case 60: GetAging = Aging.Aging60
    Case 90: GetAging = Aging.Aging90
    Case 120: GetAging = Aging.Aging120End Select
    End Function
    then use it in the query like this:
    SELECT
    AccountID,
    CustomerName,
    GetAging([AccountID],Date(), 0),
    GetAging([AccountID],Date(), 30),
    GetAging([AccountID],Date(), 60),
    GetAging([AccountID],Date(), 90),
    GetAging([AccountID],Date(), 120)
    FROM
    Customer
    ORDER BY
    CustomerName
    However, this has the big drawback that the function will be called 5 times for each and every AccountID, so you will probably have bad performance.
    Since you pass the AccountID to the function, you could consider to calculate the results for all AccountIDs in the code and store the results into a table, then join this table into the query.
    Matthias Kläy, Kläy Computing AG

  • How to make user-define value's query

    Dear All,
    In we have 3 user-defined fields in marketing document. When I type in field 1 and field 2, we need line total = field 1 * field 2.
    Would it be possible for me to config it in SAP? I setup a user-define value and have a query for it. Make it updated when field 2 changed. But when I am not clear on how to write the query. I have a query select $[POR1.U_Field1]*$[POR1.U_Field2]
    But I got an error message. It has to be some syn error in my query.
    It is a service type document so that I cannot have a where POR1.Itemcode = ...
    Can anybody help me out? Thanks in advance.
    Regards,
    Yuka
    Edited by: Jie Jin on Mar 23, 2010 7:28 PM

    I use Select $(Por1.Price.number)*$(Por1.U_Numberofunit.number)   //replace ( to [
    The price was been change to null. Then my query is like select *6. Thanks.
    Edited by: Jie Jin on Mar 23, 2010 7:42 PM
    Edited by: Jie Jin on Mar 23, 2010 7:44 PM

  • How can I access user defined column(in query) inside the trigger?

    Hi
    I have 3 unions and each query displays different records on some criteria. I also have a column hard-coded
    Ex:
    select a.col1, a.col2,
    add as update
    from table1 a
    where ...
    union
    select a.col1, a.col2,
    change as update
    from table1 a
    where ...
    union
    select a.col1, a.col2,
    del as update
    from table1 a
    where ...
    And I need to display a column in the report only if update is Add. I was thinking of writing a format trigger for that field. But I do not know how can I access this user defined column named update in the trigger?
    Any help?

    Try ":update" minus the double-quotes. Ex:
        IF :update = 'add' THEN
          RETURN(TRUE);
        ELSE
          RETURN FALSE;
        END IF;
    You'll want to place your hard-coded values in single-quotes. Ex:
        select a.col1, a.col2,
        'add' as update
    - Brian

  • How to Enable the LOV to query for partial user entries in af:query in an ADF search form

    Hi guys,
    I have faced one issue in creating a search form in ADF, in that I have used af:query and table region. and I have attached an lov vo to the base vo for the list of values and given UI hint as Input values with List of values. Now the issue is that I have given auto submit property as true so when I give some value suppose "Jan-14" and tab out it gives me all the correct results. but if I give like "Jan%" and then tab out then it does not give me any value. Could you kindly help me with some solution. I am using Jdev 11.1.1.6.0.
    Thanks,
    Tanmoy

    To enable the LOV to query for partial user entries, we can trap the 'LaunchPopupListener' event and add custom code there. Within the af:query component, just wondering how can we set property the 'LaunchPopupListener' for the search criteria ?

Maybe you are looking for

  • Adapter Module not working in Sender Communication Channel working in recie

    Hi I have written one adapter module. IF i give that Adapter Module in Sender Communication channel its not working. If i give that in Reciever Communication Channel its working. If i mention in both the channels then its working in sender communicat

  • I'm fixing to throw my phone!!!!!!

    Moved for greater exposure

  • R12.1.3 PSU patching conflict question

    12.1.3 running on RH Linux 5.8 and trying to apply PSU patch 17540582 on my 11.2 OH which is currently at 11.2.0.3.5. 17540582->opatch prereq CheckConflictAgainstOHWithDetail -ph ./ Oracle Interim Patch Installer version 11.2.0.3.6 Copyright (c) 2013

  • Workflow approval from mobile in ECC5

    Hi All   We are already having workflow approval in R/3 where it happening from SAP inbox now my client want to migrate to mobile phone. Its it possible from ECC5 we dont have portal. How to implement it. Do we need to install any 3rd party like syba

  • Setting control parameters programmatically - using variables...

    Please excue typos - I lost my glasses the other day and I'm waiting on a new pair to come in. I need to be able to change the 'editable' and 'enabled' properties on a variety of controls programmatically. I'm adding 'after the fact' Role support to