Creation of variant to paas on list of users using a table
Hello All,
I got a requirement to create a report in FI-GL with the requirement for selection and layout as follows and how to incorporate the same in the
List of Users (through variant) and Doc. Type (user input) :
To exclude transactions, which are not manual journal entries, a table should be created with exclusions.
*This table will contain two types of exclusions:*
Document types which will never been used for manual journal entries, since their nature is system related (SAP R/3 standard). In principle, this table will be fixed
List of Users
which are not related to persons, but to automatic transactions. This table needs to be verified and updated on regular basis.
Could any one suggest me how to do a vaiant for the user through a table and that too this table should ba updated on regular basis.
Hi,
rcc50886 wrote:
We have a situation where we need to allow particular users which are stored in a table.Why don't you simply revoke the CONNECT privilege of the users who shouldn't log in, or lock those accounts? AFTER LOGON triggers can cause huge problems when they don't work right, eg., if for some reason they become invalid.
create table system.ALLOW_RESTRICTED_USERS (username varchar2(30), insert_date date default sysdate );
CREATE OR REPLACE TRIGGER SYS.RESTRICTED_USERS_TRIG
AFTER LOGON
ON DATABASE
DECLARE
BEGIN
IF DBMS_STANDARD.LOGIN_USER NOT IN (SELECT USERNAME FROM system.ALLOW_RESTRICTED_USERS)
-- IF SYS_CONTEXT ('USERENV','SESSION_USER') NOT IN (SELECT USERNAME FROM system.ALLOW_RESTRICTED_USERS)
THEN
RAISE_APPLICATION_ERROR (-20001, 'Unauthorized login');
END IF;
END;
Warning: Trigger created with compilation errors.
SQL> show error
Errors for TRIGGER SYS.RESTRICTED_USERS_TRIG:
LINE/COL ERROR
3/3 PL/SQL: Statement ignored
3/38 PLS-00405: subquery not allowed in this contextHow to use subquery on the above trigger ? or is there any better way to achive required results .... IN (x, y, z) works in PL/SQL, but
... IN (SELECT ...) only works in SQL.
Don't use IN. Use some other way to query the table, some way that will return usable results no matter what (if anything) is in the table, like this:
DECLARE
username_found allow_restricted_users.username%TYPE;
BEGIN
SELECT MAX (username)
INTO username_found
FROM allow_restricted_users
WHERE username = dbms_standard.login_user;
IF username_found IS NULL
THEN
...As mentioned already, don't create your own objects in Oracle-supplied schemas, especially SYS and SYSTEM.
Similar Messages
-
How to find the list of users used transcation from last 2 days plz urgen
hi friendd
i am in need of knowing the list of users used transcation in last 2 days
can any one help me . how to find out the list of users and used trancation in detail or step by step
thanks in advance .i know that i can see in st03 but i dont find any user list or trancations .
apart from that so we have any other transcation to see the user in sap abap box
regards
rajaThis info has been posted before but here you go (this is an alternative way to Bernhards):
ST03N, make sure you are in Expert Mode (not Service Engineer)
Expand Workload
Expand Total
Double Click on the day you want to analyse
You can see transaction details under Transaction Profile -> Standard
You can see what tx a user has started under User & Settlement Statistics -> User Profile
If you are not seeing any data then speak to your Basis administrator about what they are doing with the log files. -
To get list of users using universe designer client tools
Hi Experts,
Is there any way we can get the list of users using universe designer client tool.
Thanks,
Shiva GunturuHi Shiva,
Refer to chapter 12 section "User events enabled for clients"
http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_bip_admin_en.pdf
In XI 3.1 client auditing is a bit limited, you may need to do some testing to determine if it is possible to audit what you are looking for.
Hope it helps
Thanks
Toby
http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_bip_admin_en.pdf -
Populating a drop down list of users using JSON from a REST call
Hi guys,
First post, have just started the mammoth project of turning us paperless.
My first task has been to create a header template - this header to be used on any form we use. I got this done almost without issue, it seems the only complication is to attach the username to the document.
Initially I tried to do this with a text field. I set this up with a calculation script to set this.rawValue = identity.username (also tried identity.name), however further reading taught me that that requires priviledged context (haven't figured out what that is or how to get it yet, but it seems like a 'no' for this method).
My next step has been to attempt to let the user pick their username from a list. "Easy!" I thought, "I just set up a webscript last week to return a configurable list of user details. My web script (it runs off of Alfresco CMS, for the record) is accessed from an URL like https://docs.ourcompany.com:8443/alfresco/service/ourcompany/users?useGroup=[a user group]&filter=[a filter string] and returns JSON like this:
"users" :
"name" : "Chris O'Kelly", "userName" : "ChrisO"
"filter" : "all",
"error" : 0
In the layout:ready script section for my dropdown I have used the following js
function createRequest() {
var result = null;
if (window.XMLHttpRequest) {
// FireFox, Safari, IE>6
result = new XMLHttpRequest();
if (typeof xmlhttp.overrideMimeType != 'undefined') {
result.overrideMimeType('application/json');
else if (window.ActiveXObject) {
// IE <7
alert("No available type");
result = new ActiveXObject("Microsoft.XMLHTTP");
else {
alert("No available type");
return;
return result;
var req = createRequest();
req.onreadystatechange = function() {
if (req.readyState != 4) return;
if (req.status != 200) {
alert("REST call failed");
return;
// Request successful, read the response
var resp = req.responseText;
this.addItem(resp.users.name, resp.users.userName);
req.open("GET", "https://docs.ourcompany.com:8443/alfresco/service/ourcompany/users?useGroup=GROUP_EveryUser&filter=status", true);
req.send();
But when I preview the form I get nothing, no errors, no alerts, no filling of the dropdown. I've read a few conflicting forum posts on whether or not xmlHttpRequest works within liveCycle forms, so I suppose the guts of my question boils down to- does it?Hi!
In the DropDownList set the labelField property to the name of the object property you want to appear.
Ex:
<s:DropDownList labelField="facilityNumber"
includeIn="NewInspection"
dataProvider="{ddFacNum}"
fontFamily="Arial" fontSize="16"
id="ddFacilityNumber"
prompt="Select facility number..."/> -
How to get list of users using IN OIM
Experts,
Is it possible to get the list of users who have logged into OIM in past (for example last six months)? as not all people in my organization uses OIM.
Please suggest if OIM(version 9.1.02) has any such functionality or if it is possible to get it from OIM database.
Thanks,
S MOIM will not store last logon date & time. So this is not possible. If you have access manager integrated environment, then OID will have last logon date & time. in such environment, from OID, you can get these details.
-
Extract list of users in OBIEE 11g
Can someone please tell me what is the way to extract the list of users using OBIEE 11g with their roles and permissions.
Thanks in advance.Check this script
'1: Make an UDML export of the RPD using nqgenudml.exe
'2: Change the filename/location in this script
'3: Run the script from the command line cscript Read_Usergroups.VBS > users.txt
'4: Put the export in a XLS Pivot table
Set objFSO = CreateObject("Scripting.FileSystemObject")
'point this to your UDML EXPORT
Set objFile = objFSO.OpenTextFile("E:\usergroup.txt", ForReading)
Const ForReading = 1
Dim arrFileLines()
dim strRLine
dim strTemp1
dim strTemp2
dim strTemp3
dim intRoles
intRoles = 0
i = 0
WScript.Echo "USER_NAME;FULL_NAME;ROLE;COUNT"
Do Until objFile.AtEndOfStream
strRline = objFile.ReadLine
if left(strRline,12) = "DECLARE USER" then Redim Preserve arrFileLines(i)
strTemp1 = MID(strRLine ,15 , 50)
strTemp1 = MID(strTemp1 ,1 , instr(strTemp1, """")-1)
IF instr(strRline,"}" ) >0 THEN
strTemp2 = MID(strRLine , instr(strRline,"{")+ 1, (instr(strRline,"}") - (instr(strRline,"{")+ 1)))
ELSE
strTemp2 = ""
END IF
arrFileLines(i) = strTemp1 &";" & strtemp2
intRoles = 1
i = i + 1
end if
if intRoles >= 1 then
if instr(strRline,"HAS ROLES (" ) >0 then
intRoles =2
end if
if intRoles =2 and instr(strRline,"HAS ROLES (" ) =0 then
strTemp3 = MID(strRline,instr(strRline, """")+1,50)
strTemp3 = MID(strTemp3,1,instr(strTemp3, """")-1)
WScript.Echo arrFileLines(i-1) &";" & strTemp3 &";1"
end if
if intRoles =2 and instr(strRline,")" ) >0 then intRoles = 0
end if
end ifLoop
objFile.Close
Source : Srinivasan Software Solutions Pvt.Ltd.: [OBIEE 11g] OBIEE Get All Users And Roles From RPD -
Hi All,
I have a transaction for getting the list of users and sending mail to them. I have used XML query to get the list of users using the following URL:
"http://<server:port>/XMII/Illuminator?Service=Admin&Mode=UserList&Group=XMII Administrators&Content-Type=text/xml".
When I am executing the transaction from Workbench, I am getting the list of users but if I run the transaction using a scheduler, I am getting the following as output of XML query.
<?xml version="1.0" encoding="UTF-8"?>
<Rowsets DateCreated="2009-07-14T06:17:51" EndDate="2009-07-14T06:17:51" StartDate="2009-07-14T06:17:51" Version="12.0.4 Build(120)"><FatalError>Premature end of file.</FatalError></Rowsets>
I have added the the necessary roles to Admin service(System Security).
What could be the reason for this??
Thanks,
SophilaSophila - from the WB you are already logged in so the URL works, but from the scheduler there is no user account to permit this fully qualified http request, so the premature end of file error is because the XMLQuery is expecting Rowsets/Rowset/Row xml back but gets the NW login page instead.
Either pass the necessary credentials into the TRX through the scheduler parameters and append them into the URL in your XMLQuery dynamically or just add them as static: &IllumLoginName=XXX&IllumLoginPassword=XXX (this will need to be a user with permission to the Admin service). -
Hi Gurus,
I am trying to programatically query the list of users belonging to a particular user-group, from LDAP.
LDAP is deployed on Weblogic as a 'provider'.
I have the following details of the LDAP instance - host:port, security principal (CN=aaa,OU=bbb,OU=ccc,DC=ddd,DC=com), LDAP password (credential), User Base DN.
I tried the following using BPEL:
<sequence name="main">
<!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->
<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="Assign1">
<copy>
<from>ora:getContentAsString(ldap:listUsers('people','ou=people'))</from>
<to>$outputVariable.payload/client:result</to>
</copy>
</assign>
<reply name="replyOutput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="outputVariable"/>
</sequence>
</process>
and following is the content of the directories.xml that I have created:
<?xml version="1.0" ?>
<directories>
<directory name='people'>
<property name="java.naming.provider.url">ldap://<host>:<port></property>
<property
name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</property>
<property name="java.naming.security.principal">CN=aaa,OU=bbb,OU=ccc,DC=ddd,DC=com</property>
<property name="java.naming.security.authentication">simple</property>
<property name="java.naming.security.credentials">password</property>
<property name="entryDN">User Base DN</property>
</directory>
</directories>
When I run this BPEL process, I get a blank value on my output variable -
<outputVariable>
<part name="payload">
<processResponse>
<result><users xmlns="http://schemas.oracle.com/bpel/ldap"/></result>
</processResponse>
</part>
</outputVariable>
Is there something I am missing here?
Regards,
Arindamslight change in my approach here:
I would like to use welogic provider to connect to this LDAP
so... instead of MyProgram --> LDAP, it should now be MyProgram --> Weblogic/SecurityRealms/myrealm/Providers/myAuthenticator --> LDAP
in this guess, i wont be using LDAP connection details, instead the weblogic host/port and Authenticator name should be sufficient
How can I programatically query the list of users using this approach? -
Showing list of users locked in message
Hi Experts,
I have a substitute table where in all the users and substitutes are stored .
when adding or change new substitue in table it should thorugh the list of users locked in table.
Currently it loops the table and displays for the first user whooever is locked. I need to display the list for users in error message any idea would be great , or any alternative idea will be helpful.
Thanks & Regards,
VenkateshWhenever it finds first locks record and throws error then store that error in another internal table instead of displaying it, it will keep collecting the locked records.. After the loop, you have list of all locked records.
Thanks,
Murtuza -
I have hundreds of products that all have the same variant configurations, and I understandably don't want to pay someone to manually go through the WebTools interface to create all the variants. After looking through the WebTools database, I am planning on creating a little SQL script that will copy the variant information from one product to another.
1) Select all records from Variant table where ConfigPartNo = 'itemtocopyfrom'
2) Create new rows in Variant table that match the previously selected rows, switching out the ConfigPartNo to 'itemtocopyto'
3) For each of the first selected VariantIDs in the Variant table, Select all the records in the PartsVariant table where VariantID = VariantID
4) Duplicate each of those rows, substituting the new VariantID of the parts created in step 2
I can't find anyplace else that is affected by the creation of variants. Will this work, or is there a better way to approach this?
Thanks,
DerekIn case anybody else is interested, I whipped up this in Access VBA today. Basically all the form does is have two list boxes filled with all the products in WebTools. You can only select one from the FROM listbox, but you can select as many products in the TO listbox as you want. This code then loops through all of the selected TO products, duplicating all the variants settings of the FROM column.
My code is only lightly commented and does very little error checking, but it does the job. One thing to note if you end up using this code is that it doesn't check to see if it is duplicating variants, so if you click it twice or run it on a product that already has variants, it will add all of the variants from the FROM product.
Depending on how much I need to use this, I may extend it a little more so that I can choose to copy only certain variant categories rather than all variant categories, but we'll see. If I do anything significant, I'll hopefully remember to come post it here.
If anyone is interested in the original Access database that runs this, just send me an email at derek AT seatability DOT com and I'll send it over to you.
Dim SQL As String
Dim con As ADODB.Connection
Dim rsVariantFrom As ADODB.Recordset
Dim rsVariantTo As ADODB.Recordset
Dim rsPartsVariantFrom As ADODB.Recordset
Dim rsPartsVariantTo As ADODB.Recordset
Dim rsAutoVariantID As ADODB.Recordset
Dim rsPartsMaster As ADODB.Recordset
Dim CopyFromProductID As String
Dim CopyToProductID As String
Dim AutoVariantID As Integer
Dim varItm As Variant
CopyFromProductID = lstCopyFromPartNo.Value
'Open Database Connection
Set con = New ADODB.Connection
con.ConnectionString = "Driver={SQL Server};" & _
"Server=server;" & _
"Database=database;" & _
"Trusted_Connection=yes"
con.Open
For Each varItm In lstCopyToPartNo.ItemsSelected
CopyToProductID = lstCopyToPartNo.ItemData(varItm)
Set rsVariantFrom = New ADODB.Recordset
SQL = "SELECT * FROM Variant WHERE ConfigPartNo = '" & CopyFromProductID & "'"
rsVariantFrom.Open SQL, con, adOpenForwardOnly, adLockReadOnly
Set rsVariantTo = New ADODB.Recordset
SQL = "SELECT * FROM Variant WHERE ConfigPartNo = '0'"
rsVariantTo.Open SQL, con, adOpenDynamic, adLockOptimistic
Do Until rsVariantFrom.EOF
' Copy all the old Variant Fields, only changing the ConfigPartNo to the new ProductID
rsVariantTo.AddNew
rsVariantTo.Fields("ConfigPartNo").Value = CopyToProductID
rsVariantTo.Fields("Description").Value = rsVariantFrom.Fields("Description").Value
rsVariantTo.Fields("ImageURL").Value = rsVariantFrom.Fields("ImageURL").Value
rsVariantTo.Fields("MarketingText").Value = rsVariantFrom.Fields("MarketingText").Value
rsVariantTo.Fields("VariantType").Value = rsVariantFrom.Fields("VariantType").Value
rsVariantTo.Fields("DefaultPartNo").Value = rsVariantFrom.Fields("DefaultPartNo").Value
rsVariantTo.Fields("RequiredFlag").Value = rsVariantFrom.Fields("RequiredFlag").Value
rsVariantTo.Fields("SortOrder").Value = rsVariantFrom.Fields("SortOrder").Value
rsVariantTo.Fields("SynchFlag").Value = rsVariantFrom.Fields("SynchFlag").Value
rsVariantTo.Fields("SynchDate").Value = rsVariantFrom.Fields("SynchDate").Value
rsVariantTo.Update
' Retrieve most recent Autoincrement / Identity value from connection
Set rsAutoVariantID = New ADODB.Recordset
SQL = "SELECT IDENT_CURRENT('Variant')"
rsAutoVariantID.CursorLocation = adUseServer
rsAutoVariantID.Open SQL, con, adOpenForwardOnly, adLockReadOnly, adCmdText
AutoVariantID = rsAutoVariantID.Fields(0).Value
rsAutoVariantID.Close
Set rsAutoVariantID = Nothing
Set rsPartsVariantFrom = New ADODB.Recordset
SQL = "SELECT * FROM PartsVariant WHERE VariantID = '" & rsVariantFrom.Fields("VariantID").Value & "'"
rsPartsVariantFrom.Open SQL, con, adOpenForwardOnly, adLockReadOnly
'Return an empty recordset to add the copied PartsVariant rows
Set rsPartsVariantTo = New ADODB.Recordset
SQL = "SELECT * FROM PartsVariant WHERE VariantID = '0'"
rsPartsVariantTo.Open SQL, con, adOpenDynamic, adLockOptimistic
' Copy all the old PartsVariant fields, only changing the VariantID to the new VariantID
Do Until rsPartsVariantFrom.EOF
rsPartsVariantTo.AddNew
rsPartsVariantTo.Fields("VariantID").Value = AutoVariantID
rsPartsVariantTo.Fields("PartNo").Value = rsPartsVariantFrom.Fields("PartNo").Value
rsPartsVariantTo.Fields("DisplayText").Value = rsPartsVariantFrom.Fields("DisplayText").Value
rsPartsVariantTo.Fields("UseBaseFlag").Value = rsPartsVariantFrom.Fields("UseBaseFlag").Value
rsPartsVariantTo.Fields("BaseAdj").Value = rsPartsVariantFrom.Fields("BaseAdj").Value
rsPartsVariantTo.Fields("SortOrder").Value = rsPartsVariantFrom.Fields("SortOrder").Value
rsPartsVariantTo.Fields("SynchFlag").Value = rsPartsVariantFrom.Fields("SynchFlag").Value
rsPartsVariantTo.Fields("SynchDate").Value = rsPartsVariantFrom.Fields("SynchDate").Value
rsPartsVariantTo.Update
rsPartsVariantFrom.MoveNext
Loop
' Close PartsVariant recordsets and destroy object
rsPartsVariantFrom.Close
rsPartsVariantTo.Close
Set rsPartsVariantFrom = Nothing
Set rsPartsVariantTo = Nothing
rsVariantFrom.MoveNext
Loop
' Set the master record of the item to be a Variant Master
Set rsPartsMaster = New ADODB.Recordset
SQL = "UPDATE PartsMaster " & _
"SET VariantMasterFlag = 'Y' " & _
"WHERE PartNo = '" & CopyToProductID & "'"
rsPartsMaster.Open SQL, con
' Close Variant recordsets and destroy object
rsVariantFrom.Close
rsVariantTo.Close
Set rsVariantFrom = Nothing
Set rsVariantTo = Nothing
Set rsPartsMaster = Nothing
Next varItm
con.Close
Set con = Nothing -
Revision: 10689
Author: [email protected]
Date: 2009-09-29 11:11:24 -0700 (Tue, 29 Sep 2009)
Log Message:
Modify TileBase renderer creation sequence to match those of List and DataGrid.
QE Notes: None
Doc Notes: None
Bugs: SDK-23487
Reviewer: Corey
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/components/TileList, HorizontalList
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-23487
Modified Paths:
flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/controls/listClasses/TileBase. aszeratul289 wrote:
Look for this:
Subsection "Display"
Depth 24
Modes "800x600" "640x480"
ViewPort 0 0
EndSubsection
And change it to this:
Subsection "Display"
Depth 24
Modes "1280x1024" "800x600" "640x480"
ViewPort 0 0
EndSubsection
The resolution for your monitor was missing for that particular depth.
Close. worked after I added the "1024x768" mode as well as "1280x1024". -
How to know on which pages a particular list is being used?
Hi
So we have this site which has not been cleaned up for a while resulting in the creation of many lists many of which are not being used as well. I want to know that where all a particular list is being used i.e on which all pages so that if the list is not
being used, I could delete it. Is there any simple way to do it.
Please share your thoughts:)
Thanks
Supriya SinhaHi Supriya,
OOTB I think you can use SharePoint designer, but I would suggest custom code to iterate to all pages, and get the lists that are associated with these pages.
http://stackoverflow.com/questions/633633/sharepoint-how-can-i-find-all-the-pages-that-host-a-particular-web-part
another one would be if those lists were never used and you can check for list with empty data.
I would use Get-SPLists to get all of the lists to check for zero items.
http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/15/use-windows-powershell-to-manage-lists-in-sharepoint-2010.aspx
http://sharepointrelated.com/2011/11/28/get-all-sharepoint-lists-by-using-powershell/
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you -
Row limitation for list of User Defined Values
Dear all,
I need to make list of User Defined Values at the field in SO. Is there any limitation of row quantity for that ? because the list will grow until thousand..
Regards
WibisanaDear Ho we,
There is no limitation of user define filed for document level and document row level.
At present i think no budy use 1000 UDF at row level so its very difficult to say after creation of 1000 UDF what is impact on system performance.
You have to work try basis.
REGARDS
MANGESH PAGDHARE. -
Variant characterstics search help in sales order using object dependency
Hi Sapients,
we are trying to configure variant configuration in sales order.
TDC related details like grade,profile,tdc no, tdc date, tdc customer, hardness, composition will be entered through a ZPROGRAM and the details will be stored in ZTABLE (ZTDC).Now when we create sales order, after entering the material and clicking on variant configuration, the configuration screen comes up where the grade and profile will come from the material master. User will punch the appropriate TDC number, but a search help needs to be generated for TDC no based on the values of grade and profile, which will show the tdc numbers punched for that particular grade and profile from the Ztable.
Please guide me how to resolve this issue. shall i create dependency based on TDC no. In dependecy what is the code i have to write . Please elaborate in detail as i dont have idea on dependency.
Is it possible through user exit.
ThanksHi,
My thoughts are as follows.
If for a particular combination of grade and profile, there is unique TDC number, then it is possible to use variant table. However if the number is not unique for a combination of grade and profile, then V.Table will not help. Dependency using V.Table will not give the possible list of values, but will automatically update the value based on grade and profile.
If the combination is not unique, you can think of using a FUNCTION (CU67). SAP documentation is very good on using functions and function modules related to this. It is not as difficult as we think it is and we are using functions for some of our functionalities.
So based on this, you can decide on your further actions. -
Difficulty in using a variable to pass a list of names between 2 tables
Hi All,
I am trying to pass a list of names from one table as a variable to another table and trying to find the Highest level they exist at in the hierarchy. I am having some troubles with the variable and need some guidence and also if this should be a procedure or not.
this is what i have now :
Variable man_name Varchar;
exec :man_name = (Select full_name from direct_manager_report)
UPDATE direct_manager_report
Set Manager_level_number =
(Select 'Manager_Level_0' from manager_hierarchy where level_0_manager_name = man_name
UNION
Select 'Manager_Level_1' from manager_hierarchy where level_0_manager_name < > man_name AND level_1_manager_name = man_name
UNION
Select 'Manager_Level_2' from manager_hierarchy where level_1_manager_name < > man_name AND level_2_manager_name = man_name
UNION
Select 'Manager_Level_3' from manager_hierarchy where level_2_manager_name < > man_name AND level_3_manager_name = man_name
Where full_name = man_name;
Let me know what modifications have to be done for this the variable to get the name from table 1 and find the manager level from table 2 and populate it back in table 1.
Any help is appreciated.
ThanksFrank Kulash wrote:
Hi,Thanks for your reply. I am sorry for not providing enough information.
What's wrong with what you have now? I want to pass the manager name (about 2000) from direct_manager_report to the variable which i pass to manager_hierarchy table to find the highest level for each manager
If it doesn't give the right results, then how is anyone except you to know what the right results are?
Variable man_name Varchar;
exec :man_name = (Select full_name from direct_manager_report)Does that really work for you?No thats why i said this is what i have and i am trying to see the best to past the list of manager names to get the level number.
UPDATE direct_manager_report
Set Manager_level_number =
(Select 'Manager_Level_0' from manager_hierarchy where level_0_manager_name = man_name
UNION
Select 'Manager_Level_1' from manager_hierarchy where level_0_manager_name < > man_name AND level_1_manager_name = man_nameIt looks like something is missing on the line above. Did you mean "level_0_manager_name != man_name"?
This site doesn't like to display the <> inequality operator. Always use the other (equivalent) inequality operator, !-, when posting here.
UNION
Select 'Manager_Level_2' from manager_hierarchy where level_1_manager_name < > man_name AND level_2_manager_name = man_name
UNION
Select 'Manager_Level_3' from manager_hierarchy where level_2_manager_name < > man_name AND level_3_manager_name = man_name
Where full_name = man_name;Are you sure the UNION will never return more than 1 row?
Let me know what modifications have to be done for this the variable to get the name from table 1 and find the manager level from table 2 and populate it back in table 1.Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data (in this case, the contents of table1 after everything is finished).
See the forum FAQ {message:id=9360002}Sorry did not realize the missing !. Yes the union will always return one record for each manager name passed. I have tested the select part which hard coding the manager name and it does update the level number correctly. but i am struggling with passing a large list of values as a variable.
This is the output i am looking for in the direct manager report table is :
Manager Name | Manager Level Number
ABC Manager Level 0
XYZ Manager Level 1
This is the structure of the manager hierarchy:
Manager Level 0 Manager Level 1 Manager Level 2...Manager Level 14
ABC ABC ABC ABC
ABC XYZ XYZ XYZ
Let me try the below but hopefully i am more clear on the requirement now.
>
You may want something like this
MERGE INTO direct_manager_report dst
USING (
SELECT dmr.full_name
, 'Manager_Level_'
|| MIN ( CASE dmr.full_name
WHEN level_0_manager_name THEN '0'
WHEN level_1_manager_name THEN '1'
WHEN level_2_manager_name THEN '2'
WHEN level_3_manager_name THEN '3'
END
) AS manager_level_number
FROM manager_hierarchy dmr
JOIN manager_hierarchy mh ON dmr.full_name IN ( level_0_manager_name
, level_1_manager_name
, level_2_manager_name
, level_3_manager_name
GROUP BY dmr.full_name
) src
ON ( dst.full_name = src.full_name )
WHEN MATCHED THEN UPDATE
SET dst.manager_level_number = src.manager_level_number
Edited by: user599926 on Jun 4, 2013 9:41 PM
Maybe you are looking for
-
Display header vertically in ALV report
Hello Experts, I have a requirement in which i need to display the headers of an ALV in vertical order and items in horizantal order. It should appear as below. Parameter | Unit | Week under consideration | % of Net Sales | This we
-
Error when trying to use ExportOptionsTIFF in Illustrator CS6
I am using Illustrator C6 and I am using C# and a com reference to make a windows program but I can't seem to get the export to tiff to work. Here is the method I am using. public static void createTifs() app = new Illustrator.Applicatio
-
Now that I'm running Firefox 4.0.1 (on a Vista 64-bit PC), often when I want to print a web page, the frame around the Windows Print box is too big to fit the screen. The buttons that are critical for controlling print functions, and in particular th
-
I cant email photos from iphoto, i just get an error picture of a camera with exclamation mark
i cannot share photos from iphoto on my macbook pro anymore, since i upgraded to mountain lion. i just get an icon of a camera with an exclamation mark next to it regardless of whether i select one or several pictures
-
Canon 5D CR2 RAW Files Have Visible Artifacts
There's a digital dithering pattern that's clearly visible on CR2 RAW files even with no adjustments in Aperture. Here are two example screenshots from Photoshop. The first is an 800 ISO image and the second is a 50 ISO image. I shoot RAW + JPEG. In