Getting 'second reporting supervisor' without hierarchy
Hi all
Just I hope that someone can help me with this... Just describing it it feels complicated, but here we go.
An Employee table contains information about Employees and their Bosses
EmpID, BossID
emp01, emp02
emp02, emp03
I want to create a report displaying the Supervisor and the 'Second reporting supervisor; i.e. the boss's boss, like:
Employee, Boss, 2nd Boss
emp01,emp02,emp03
Any advice? Points awarded!
Basically you need to create the denormalised structure in the physical model using aliaseses on the base table, and join accordingly.
Dim_Emp >--- Dim_Emp_Boss >---- dim_Emp_boss_boss
This assumes you know the number of levels in your structure.
The alternative is to do some transformation of your table into a HIER_DN table which gives all the levels.
Similar Messages
-
Get second-highest element in hierarchy
It's Friday afternoon and my brain isn't working well, and some of you people I'm sure will have the answer in a flash....
I have a typical hierarchical table, here's an example below;
with codes as
(select 17 icode, -1 parent_code,'Group Services' descrip from dual
UNION
select 18, -1, 'Counselling' from dual
UNION
select 20, -1, 'Career Decision Making' from dual
UNION
select 21, 20, 'Career Assessment' from dual
UNION
select 22, 20, 'Academic Assessment' from dual
UNION
select 27, 22, 'Fee' from dual
UNION
select 28, 22, 'Transportation' from dual
UNION
select 33, 28, 'In-Province' from dual
UNION
select 34, 21, 'Fee' from dual
UNION
select 35, 21, 'Transportation' from dual
UNION
select 39, 35, 'Daily' from dual),
intervs as
(select 17 interv from dual
union select 18 interv from dual
union select 27 interv from dual
union select 33 interv from dual
union select 34 interv from dual
union select 39 interv from dual)
select interv,x.*
from intervs
INNER JOIN (select l1.icode k1,l1.descrip d1,
l2.icode k2 ,l2.descrip d2,
l3.icode k3 ,l3.descrip d3,
l4.icode k4,l4.descrip d4
from codes l4
left outer join codes l3 ON l3.icode = l4.parent_code
left outer join codes l2 ON l2.icode = l3.parent_code
left outer join codes l1 ON l1.icode = l2.parent_code)
x ON x.k4 = intervs.interv
What I would like to get for each intervs.interv is the k/d pair that is the second highest element in the hierarchy, or if there is no higher level in the hierarchy I'll take that.
So in the data that the above displays, I'd like 22 - academic assessment for #33,
21 Career Assessment for #34, and 18 and 17 would come back as themselves.
Thanks in advance,
Jonor you can use the tradtional sql, it can run in most database
select * from scott.emp t11,
--get the second highest sal
select deptno, max(sal) sal
from
( --get the highest sal
select t1.deptno, t1.empno, t1.ename, t1.sal from scott.emp t1,
( select deptno,max(sal) max_sal
from scott.emp e
group by deptno
) t2
where t1.deptno=t2.deptno
and t1.sal<t2.max_sal
order by t1.deptno asc,sal desc
) t
group by t.deptno
order by t.deptno
) t22
where t11.deptno=t22.deptno
and t11.sal=t22.sal; -
Infopath - Get information about direct reports users without code
Hi, Is it possible to do this?
Thanks in advance!Hi Hemendra,
he needs to get direct reports users field to figure out if current user have anyone reporting to him, which as a field if NOT null then current user is a manager to someone.
unfortunately direct reports users OOTB can't be retrived by UserProfileService, where only the following user data are retrivable:
UserProfile_GUID
FirstName
LastName
PreferredName
WorkPhone
AccountName
Department
Title
Manager
AboutMe
Office
PersonalSpace
PictureURL
UserName
QuickLinks
WebSite
PublicSiteRedirect
SPS-Dotted-line
SPS-Peers
SPS-Responsibility
SPS-Skills
SPS-PastProjects
SPS-Interests
SPS-School
SPS-SipAddress
SPS-Birthday
SPS-MySiteUpgrade
SPS-DontSuggestList
SPS-ProxyAddresses
SPS-HireDate
SPS-LastColleagueAdded
SPS-OWAUrl
SPS-ResourceAccountName
SPS-MasterAccountName
Assistant
WorkEmail
CellPhone
Fax
HomePhone
hope this helps
If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer. Aabed Yassine. -
How to get a report in pdf format.
Hi Experts,
Could any one let me know that, how to get the report in PDF format.
Once a report is generated it should be displayed in pdf format or downloaded in pdf format.
Thanks in Advance,
Regards,
Irfan HussainHi,
Check out this code:
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
Regards,
Gayathri -
Reporting by org hierarchy with drill down by each level of reports to...
Hello,
I'm trying to determine how to aggregate reporting by org hierarchy. Utlimately to report on opportunities at the highest level (CEO; all opportunities below CEO) then a second drill down report that shows summary by Level 2 (all those who report to the CEO), then again by Level 3 drill down which would be those who report to somone in Level 2. In all instances I want the report to show all records that ultimately roll up to that level (thus include direct reports alll of their direct and indirect reports )
Level 1
CEO $10,000,000 200 Optys
Level 2
Sales Leader 1 $ 3,000,000
Sales Leader 2 $ 2,000,000
Sales Leader 3 $ 1,500,000
Sales Leader 4 $ 3,500,000
Level 3
<ul><li>- rollup of all that report to Sales Leader 1 (and so on) aggregated by first level of direct reports ($3,000,000)
Sales Mgr 1.1 $ 1,000,000
Sales Mgr 1.2 $ 500,000
Sales Mgr 1.3 $ 750,000
Sales Mgr 1.4 $ 250,000</li>
</ul>
I'd appreicate any help you can send my way.
Thanks, AaronHi Aaron,
I have come across this and found that using the "Reports To" hierarchy and "Territory Team" hierarchy are not sufficient. I implemented this as a solution for one of our clients and it works very well:
I have modified the user entity and renamed 4 standard fields:
• Business Unit renamed to "Primary Line of Business"
• Business Unit Level 1 renamed to "BU Group"
• Business Unit Level 2 renamed to "Business Unit"
• Business Unit Level 3renamed to "Team"
Not all fields go through into analytics so I had to use these fields which are available in the Opportunity-Product History subject area. The downside is that they have to be text boxes so restrict access to who can populate these. From this you can get 4 hierarchy levels and drill from one to the next. The record owner then becomes the lowest level in your report and it can look something like this:
Level 1
Primary Line of Business
Level 2
BU Group
BU Group
Level 3
Business Unit
Business Unit
Business Unit
Level 4
Team
Team
Team
Team
Level 5
Sales Person 1
Sales Person 2
Sales Person 3
Sales Person 4
Sales Person 5
Obviously it would appear side by side in the report..
Thanks -
Requirement to print data of first and second report of an ALV at once
Hi,
I have an interactive ALV report in which on double click of any of the record on first report, its details get displayed in second report. My requirement is to print all the data (of first and second report) at once.
Kindly tell me how can I achieve this functionality.
Regards,
Seema NahariaHi Seema,
Try with this FM 'REUSE_ALV_HIERARCHICAL_LIST_DISPLAY'.
Regards,
Sujatha B. -
Error in report for activated hierarchy
Hello Experts,
I have following problem in my report:
I have created 1 hierarchy for 0cust_sales infoobject other than Standard hierarchy.to get this hierarchy in place have done following steps:
created authorization object with 0cust_Sales + Authorization for hierarchy infoobject 0TCTAUTHH and actiavted it in required data target.
created authorization value for above hierarchy and maintained in the user role.
then created 1 report where hierarchy for 0cust_Sales is active and 1 authorization variable has been created for that hierarchy and restricted 0cust_Sales.
in my data target already 1authorization object is active which is based on 0sales_off.
in my report where I have assigned 0cust_Sales hierarchy, 0sales_off hierarchy is also maintained.
Problem comes when am executing the report where 0cust_sales hierarchy is not active with message - NO MASTER MAINTAINED FOR 0CUST_SALES HIERARCHY.
My problem is, I want 0cust_sales hierarchy only in 1 report but as auth object of 0cust_Sales is active on data target, error comes whenever report NOT CONTAINING 0CUST_SALES hierarchy is executed.
How to deal with the situation where hierarchy required only for 1 report..please guide meThanks Ingo. We are going to open the case.
Do we need to pull consistent detail objects of all the13 levels in the hierarchy to the WebI query ?
For Example, I have pulled all 13 level dimension objects (Blue), Org unit Key (Detail Green Object) for only L03,L04 and Org Unit Medium Name (Detail Green Object) for L08,L09.
Do I need to pull all 13 dimension (Blue Object), all 13 Org Unit Key and all 13 Org Unit Medium Name? I mean do we need to select consistent detail objects consistent across the levels?
Thanks
Jai -
How to get a Report for a past date.
Hi
Is there a way to get a report for a past date in SAP B1. For example I want to take a print out of Customer Receivables Aging Report for 30.06.2008 (Not the current Report.) without rolling back to that date from a backup.
Thank you very much
SanjayaHi Sanjaya,
You can get the past dated or the backdated aging report by taking the relevant dates in the Aging report selection criteria window.
For backdated aging report you can refer to Note No. 800294
Example:
Today is the 12.12.2007, I need to see the ageing report for open customer receivables on 30.11.2007. Between the 30.11.2007 and 12.12.2007 some of the then open invoices have been paid.
Reports => Financials -> Ageing -> Customer Receivables Ageing
Set 'Ageing Date' last date of the period, here 30.11.2007.
Set 'Posting Date' from '01.01.2007' (= Start of fiscal year) to
'30.11.2007'.
Bring tab 'By Journal Postings' into the foreground.
Tick boxes 'Display Customers with Zero Balance' and 'Consider
Reconciliation Date'.
Click on 'OK'.
This setting will generate an ageing report showing all AR invoices posted between 01.01.07 to 30.11.07 that are not reconciled on 30.11.2007.
You can refer to the following thread as well :
Re: Vendor Ageing & G/L account
Hope it helps.
Kind Regards,
Jitin Chawla -
Ora-06503/rep-1401 with my second report
hello :D
im making my second report (new to reports, self studying)
i encountered REP-1401-'cf_itemtypeformula': Fatal PL/SQL error occured.
then i tried to trace the error by putting srw.message() in parts of the code to try to figure out the problem
here is cf_itemtype currently
function CF_itemtypeFormula return Char is
itype char(60);
begin
srw.message(1000,'item type is'||:p_itemtype);
--return ' ';
if :p_itemtype = '%-ALL' then
itype:=' ';
srw.message(1005,'itype code is'||itype);
return itype;
else
srw.message(1003,'item type is'||:p_itemtype); --it prints this one
itype:='AND il.itty_code= itty.code and itty.item_type = '''||:p_itemtype||''' ';
--itype:=' ';
srw.message(1005,'itype code is'||itype); --and never reaches this line i think.
return itype;
end if;
exception
when value_error then
srw.message(1007,'value error');
end;
i think the error is because of this line
'AND il.itty_code= itty.code and itty.item_type = '''||:p_itemtype||''' '
because when i comment it out and uncomment itype:=' '; the srw.message(1005,'itype code is'||itype); works
thanksHi,
You just need to increase the length of itype.
Or even better option is to return the value directly without assigning to a local variable.
return ('AND il.itty_code= itty.code and itty.item_type = '''||:p_itemtype||''' ');Your over all function without the SRW messages will be like, you don't even need Exception handler:
function CF_itemtypeFormula return Char is
begin
if :p_itemtype = '%-ALL' then
return (' ');
else
retrun ('AND il.itty_code= itty.code and itty.item_type = '''||:p_itemtype||''' ');
end if;
end;Also I have doubt about your if statement, I dont understand what you are trying to do by this.
> if :p_itemtype = '%-ALL' then
May be you just need to check if :p_itemtype is null
so may be your above IF clause will be like
> if :p_itemtype IS NULL then
Edited by: Arif Khadas on Apr 21, 2010 10:37 AM -
I bought a song on itunes a while ago and I couldn’t back up my ipod because I needed more storage. Once my ipod was updated, ALL of my memory was deleted (since it wasn’t backed up) and I couldn't get my song back without paying for it again. Is there a way to retrieve it without paying for the second time?
Just follow these instructions:
Downloading past purchases from the App Store, iBookstore, and iTunes Store -
i accidentally deleted iPhoto on my mac and it says the the app was downloaded with a different apple id and now i can't get the app back without paying $14.99
Did you install it yourself are somebody else for you?
If you installed them yourself, but do not remember which AppleID you used, try all AppleIDs you might have used in turn.
If somene else set up your Mac for you, ask the person to reinstall it. If you bought the mac second hand, the previous owner needs to contact Apple to transfer the iLife apps. If that is not possible, delete the apps that you cannot update and buy them using your AppleID. -
How to get the Reports of Change Tracking Table in MDM?
Hi!
Please tell me how to get the reports of Change Tracking Table in MDM which is a System table, directly from MDM without using any interface.
Thanks in advance for the reply.
With Best Regards
Devendra PandeyHi Devendra,
MDM can track changes on tables and fields. <u>The level of change tracking, and which tables/fields to track, are configurable in the MDM Console</u>. MDM opens a new database on the same database engine as the MDM repository and writes all change records to this database.
For information of various steps you can visit
<a href="http://help.sap.com/saphelp_mdm550/helpdata/en/45/c7b20339ee570ae10000000a114a6b/content.htm">this URL</a>
Regards,
Krutarth -
First question - I have Acrobat 9 on my desktop and the license seems to have been messed up. I tried to download and fis but I asked me for a disk. I don't have any idea where the "disk" is. Can I get the license update without that disk?
Second question - In anticipation of not being able to do that, I bought (at University bookstore) Acrobat XI Pro - do I need to uninstall the 9.0 Pro version before I try to install the XI version?If you still have your serial number for Acrobat Pro there is a link to the installer here: Download Acrobat products | 9, 8
-
I recently downloaded a whole cd on itunes. However, as it was downloading one of the songs was interrupted and didn't fully download. How do i get the whole song without having to pay again?
Depending upon what country that you are in (music can't be re-downloaded in all countries) then try deleting the incomplete track from your iTunes library and redownload it via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes.
If you aren't in a country where you can re-download music then you will need to contact iTunes Support - try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via the Store > View Account menu option and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that song and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, about 24 hours).
If the 'report a problem' link doesn't work (it's been taking some people to this site on a browser instead of showing a form in iTunes) then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page. -
Howto define report B based on result of Report A without manual triggering
Hello
I would like to create two reports which contains the following:
1. Report A with defined and closed set of filters, after report A finishes to run and retrieve results ->
2. Report B should start running filtered by one column which is result of report A (for example report A retrieved a set of names in column 'employee', I would like report B to start running only based on the result of that column 'employee' of report A), without the need of manual trigger / navigation.
both reports should be presented in the same page.
is it possible ?
can it also been created as iBot (email) ?
thanks
HaimHi, thanks
+@haimz :+
Use a filter in report B with "filter based on another request".
That should work.
Also for not displaying B, you can have a condition, where B section doesn't show up until you have rows returned by A.
I am not sure how to perform the second part of your answer (can you elaborate, please) ?
also is there a way to present the two report together (not in a dashboard) and then to define Report B wait for report A to answer.
Haim
Maybe you are looking for
-
[Solved] Random Freezes Requiring Manual Power off
Since I built this system, I've been getting random freezes that force me to have to manually power off and back on the entire system. I have no idea what's causing it and I've tried everything under the sun that I can think of to resolve it to no a
-
How do I change ownership of an I Phone
I recently moved in with my daughter and she gave me her I phone 4 G, because she got a new phone. I cannot update the I phone 4 in I tunes because it wants the Serial # of the phone and it keep s coming up and saying " Veronica's I phone" How do
-
I want to export images as well as videos (.mov files) by using the Publishing Manager in Lightroom 5.6 under Windows 7, 64 Bit. For this I activated "Include Video Files" in the Publishing Manager and set "Video Format" to "H.264". When publishing,
-
Customized Adobe interactive form as appraisal template
Hi Experts, We want to use customized Interactive adobe forms as appraisal template for appraisee,same should be forwarded to appraiser to his MSS UWL.Can we do this? Also can we change the web layout from BSP to Webdynpro Abap? Please help me to sol
-
The hell called "Transaction Charges" in you TELSRA BILL
Is there anyone else out there other than me who does not really look at his Telstra Bill and thinks "Transaction Charges" (thats that item under "Charges ineleligible for Plan Discount") just another charge by Telstra to make their share holders (eg