Find (fix) column number in report list
Dear ABAPers,
Currently I develop a report that can show detail level. I use standard list to display the report.
In this report I have 3 main fields (FIN Doc No, PO No, and OLA No) in one line that if they are double clicked they will go to another different page.
The challege is to find out which one on the list that is double clicked, is it FIN No, PO No, or OLA No.
I use sy-cucol to find the column number but I just notice that sy-cucol will count the column from the beginning of screen shown, not from the very beginning of report. So sy-cucol is number of column relative to SAP left screen side. What I need is number of column fixed from the very beginning of report.
For example:
I write field to list as follow
WRITE: /2 T_OUT-BELNR,
160 T_OUT-EBELN,
182 T_OUT-KONNR.
And the screen listener as follow
IF sy-lsind = 1.
IF sy-cucol > 2 AND sy-cucol < 13.
"user double click on FIN Doc No
"routine for FIN Doc No
ELSEIF sy-cucol > 159 AND sy-cucol < 182.
"user double click on PO No
"routine for PO No
ELSEIF sy-cucol > 181 AND sy-cucol < 200.
"user double click on OLA No
"routine for OLA No
ENDIF.
ENDIF.
However this code doesn't work because when I scroll the screen to right sy-cucol is recalculate from 0 in the very left side of screen. So it means that sy-cucol will differenciate when I scroll the report to the right - left.
Does any body have solution for it? Are there any other system field that can replace sy-cucol?
Thanks
Regards
Hadi
Hi,
Use the statement GET CURSOR FIELD XX to determine the column in the list.
Sample code.
TABLES mara.
DATA it_mara TYPE TABLE OF mara.
DATA wa_mara TYPE mara.
DATA gv_field TYPE char30.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
START-OF-SELECTION.
SELECT *
FROM mara
INTO TABLE it_mara
WHERE matnr IN S_matnr.
IF sy-subrc = 0.
LOOP AT it_mara INTO wa_mara.
WRITE:/ wa_mara-mandt, wa_mara-matnr,wa_mara-mtart.
HIDE: wa_mara-mandt, wa_mara-matnr.
ENDLOOP.
ENDIF.
AT LINE-SELECTION.
CASE sy-lsind.
WHEN 1.
GET CURSOR FIELD gv_field.
WRITE 'TEST1'.
ENDCASE.
Regards,
Vasanth
Similar Messages
-
hi!
i wrote an alv report. i want the first 3 columns of the report to be fixed, and let the option of scrolling to the left or to the right to the rest of the columns.
thanks
yifathi Yifat,
Try The KEY option in your field catalogue..
If this field is set, the ALV Grid Control color-codes the column as a key field and fixes this column during horizontal scrolling
regards
satesh -
Fixed columns in dynamic report ( ?horizontal-break-table:1? )
Hi
I have a dynamic report that could strech over more than one page horozontally. I use the <?horizontal-break-table:1?> tag on my first header column to show this on every page, but I also need to show the last column on every page. That meens that I have a fixed column on each end of my dynamic report, the last one is just a signatur field so its no logic to it , but its important to show it on every page.
Any tips on this ?
PS.
Sry if this is a noob question, this is not really my knowlegde area, but have to fix it anyhow :)
TimRobert,
It sounds like you want a completely populated table regardless of the input data. To achieve you will need to create a "dummy table" in your database, either as an actual table, or by just doing a view, it's your choice. Here is a method for the view:
select '2009-M01' as Dim1
union
select '2009-M02' as Dim1
union
select '2009-M12' as Dim1
Next you'll have to introduce this to your universe as a "dummy table". In WebI, go to Edit Query and click add query, then add Dim1 to your result objects panel. After you run your query you can perform Merge Dimensions on Dim1 to the first dimension from your report, and voila, you'll have a fully populated table.
Thanks,
John -
Algorithm to find non repeating number from the list
Hi,
Can anybody provide me the algorithm for the program:
User has provided a list of 'n' numbers (0-9) with only a single number not repeating at all and rest may repeat odd or even number of times. Now, job is to find out the number which is occuring only single time without repetition....Hi
If n is a smallish number, then something like
int bins[10];
memset bins to zero;
for (int i = 0; i < n; ++i)
++bins[arrayDigits[i]];
for (int i = 0; i < 10; ++i)
if (bins[i] == 1)
printf("digit is %d\n", i);
/* break if certain that i is the only bin == 1 */
break;
(arrayDigits is an array of the 'n' digits).
If n is large, then you'll probably want to break out of that first loop as soon as only one of the bins.
unsigned flag;
unsigned first = 0US;
unsigned second = 0US;
for (int i = 0; i < n; ++i)
flag = 1U << arrayDigits;
if (first & flag)
if (!(second & flag))
/* second occurence of digit */
second |= flag;
/* exit condition is that 'first' has all bottom 10 bit set and
'second' has all but 1 of the bottom 10 bits set */
if (first == 0x3ff)
/* all 'first' bits set */
switch (second)
case ~(1U << 0): /* digit is 0 */
case ~(1U << 1): /* digit is 1 */
case ~(1U << 9): /* digit is 9 */
printf("digit is %d\n", i);
break;
default:
/* do nothing - more than one digit still not at 'first' */
/* else already seen 2 or more of digit */
else
/* first occurence of digit */
first |= flag;
I haven't tested any of the code.
Paul -
HOW TO FIX COLUMN IN BEX REPORT
Hello Gurus,
I have created BEX report in which user want 1st two column (Material and its describtion) to be fixed as if he want to check all relavent result related to Material the first 2 column should not be move it should be fixed and rest other results and other column should move,Hi Wajid,
The VBA code i gave earlier will do this automatically for your users. Please use it. It freezest columns A and B so that columns A and B dont move even if your users scroll to the right. It just stays there.
In your workbook after you have inserted your query, go to Tools->Macro->Visual Basic Editor. Then go to Insert Menu->Module. Double click the module that have been created (probable name is Module1) and then on the code editor paste this code:
Public Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
Range("C1").Select
ActiveWindow.FreezePanes = True
End Sub
Everytime the users refresh your query it will freeze the first to columns. So at least you are sure that the columns A and B are frozen. -
Fixed Column Number CSV variable? How to parse
I have the following variable that is a result of a cfexecute that I would like to populate into a database. There doesn't appear to be a Line Feed but there are only three columns. My question is how can I accomplish parsing the 1st value as Column 1, 2nd value as Column 2, 3rd as column 3 and 4th as column 1, 5th as column two.... etc.
Thank you,That dump looks like it came from BlueDragon, not from ColdFusion?
But anyway, what makes you say there's no line feeds? If it's based on looking at a <cfdump> result you won't be able to tell because a LF character (ie: chr(10)) does not not render as a line break in a browser,it'll just render as a whitespace character. It certainly looks to me like there's a whitespace character between each notional row of data in your CSV there.
I think you should verify what the data actually contains before trying any specific solution here.
That said, it's easy enough to have a loop that increments by three each time, and taking the index as the first column, and the index+1 and index+2 as the second on third columns, treating the string as a comma-delimited list.
Adam -
HT201322 lost my iPad air! I am asking how to find my serial number to report to police
I have lost my IPad and am asking for direction to attain my serial number so I can report to police?
See this -> http://support.apple.com/kb/ht4061
If you have access to your computer, but not your device
Open iTunes.
Open Preferences. (In Mac OS X, choose iTunes > Preferences. In Windows, choose Edit > Preferences.)
Click the Devices tab.
Position the mouse over a backup to display the serial number of the backed-up device. iPhone and cellular iPad models also display the IMEI/MEID and Cellular Data Number: -
BI - Column number in Pivot Table
Hi, I've a problem.
I'm using pivot table view to show a hierarchy. I want insert all values of expanded hierarchy into a Narrative View, but when I try to get values by '@x' signature in the narrative section, I find only the value of the top element of hierarchy and I can't find any column number for the children of hierarchy.
There is a way to find the column number to show in the narrative view all the element of hierarchy?
Could you help me please?
Thanks
AnnalisaHi,
I too faced such a issue, what version are using it?
fyi, MOS team fixes below bugs with obiee11.1.1.5.5BP also 11.1.1.6.5 BP and above.
bug 12662417 - CALCULATED ITEM DISAPPEARS FROM REPORTS (AFTER APPLYING BUG 12587870PATCH)
bug 13794350 - PIVOT TABLE CALCULATED ITEMS GRAND TOTAL IS NOT CORRECT
bug 13956072 - PROBLEM WITH UNION,PIVOT TABLE,AND NEW CALCULATED ITEMS
Thanks
Deva -
Finding out Idoc number of the Invoice List
Hi!
how to find out Idoc numberr if I have number of Invoice List?
For example, I have number of Invoice List for checking it in tcode VF22, but how to get Idoc number of the Invoice List in order to check it in WE02?
Will reward,
MindaugasHi,
Use NAST with the invoice to get the latest record for that output type..
use the table CMFP to get the IDOC number..The combination is
NAST-CMFPNR = CMFP-NR..
Then in the column CMFP-MSGV1 you can find the idoc number
<b>Reward points</b>
Regards -
Displaying the Row and Column number in the report
I am trying to show row and column number in the report (not just web preview). I am using Hyperion Reports Version 7.2.5.168
use a formula column/row. use RANK function in that. (e.g. Rank([A], asc) will sort the rows based on column A values in ascending order)
you can use this rank in your heading.
But frankly this is not so easy. You have to do it in a very intelligent way, so that rank gives you column number/row number any how.
Have a try and let see if you find a appropriate solution.
Regards,
Rahul -
How to fix Width of column in classic report.
Dear Friends
i am using Apex 3.2.
i have created Clasic Report and i have summary column in my report that column have description of issue so i want to fix width of that column nn Classic report .
i have try some code in html expression
<span>style="width: 480px; display: block; white-space: normal; font-size: 11px;">#ACTIVITY_SUMMARY#</span>
{code
after apply abovemention code that display me in my summary like this and not manage width of column.
style="width: 480px; display: block; white-space: normal; font-size: 11px;">Dear Cherryl, Greetings !! Thank you very much for the new query and we are pleased to confirm the availability of one single cabin in all the three categories of cabin on M.V. Mahabaahu. We would like to inform you that both the departures 15th Oct 2013 & 29th Oct 2013 (Golden triangle with Cruise) are operational and attached are the prices for your kind consideration. As a special promotion for the 15th Oct 2013 departure only, we are offering USD 100 per person reduction on the Golden triangle portion combined with the cruise. Kindly review and advise us to block the accommodation accordingly. Regards...pankaj
How to fix Width of column in classic report.
ThanksHi,
I'm working an example in APEX 4.2 so YMMV (your milage may vary!).
For Classic Reports, where the Column Attributes "Display As" is set to Display as Text (escape special characters ...:
1) I find that Column width and Element Width setting have no effect to make the column smaller or larger.
2) Here is one way that works:
- In the Region's Region Definition, under Attributes give the Static ID a name (no spaces), say, class-report.
- In the columns you want to affect, place "<div>#ENAME#</div>" in the columns Column Formatting "HTML Expression". Where "ENAME" here is the actual column name.
I'm using the EMP table as an example.
- Finally, in the page's HTML Header put, for example
<style>
#classic-report td.data[headers="ENAME"] div {
width: 200px;
color: blue;
#classic-report td.data[headers="JOB"] div {
width: 50px;
white-space: nowrap;
word-wrap: break-word;
</style>This makes the ENAME column wider and the JOB column smaller and wraps it.
Much more could be said. If you tweak you will find you can also affect spacing above, below and right/left of the data.
#classic-report .report-standard th.header {
border-left: #9fa0a0 1px solid;
padding: 2px 3px 4px 5px; /* top right bottom left margins */
font-size: 11px;
font-weight: bold;
vertical-align: bottom;
#classic-report .report-standard td.data {
border-left: #9fa0a0 1px solid;
padding: 3px 4px 5px 6px;
font-size: 9px;
}Does this help?
Howard -
The number of display columns in the report reached the limit. Help!!!
Hello Everyone,
This might be dumb question. But why do get this error with a IR report? and what is the solution for this. Please help me with this.
Error
The number of display columns in the report reached the limit. Please click Select Columns under Actions menu to minimize the report display column list.
Oh.. And also i have a blob column.. if the format is not given, then the table is fine.. but happen to get this error only when the blob download format is given.
Thanks and regards
John
Edited by: JB on Mar 30, 2012 11:08 AMHi,
i have set up a small test case on apex.oracle.com and I receive the same error if I use download format.
I have a table
test_blob (id number, name varchar2(10), blobcont blob)
If I create IR like
select
id,
name,
blobcont
from test_bloband then I define download format I hit the error.
If you want this to work you have to change your query to
select
id,
name,
dbms_lob.getlength(blobcont) blobcont
from test_blobAnd then again define download format for blob on blobcont column.
Regards,
Aljaz -
Need to fix the width of a column in interactive report
Hi,
I have a column named 'Comment'. Its have a huge data due to which the lenght of that column in interactive report get increased. I need to fix the length to a desired value.
I used following code in Region Footer:
<style>
table.apexir_WORKSHEET_DATA td[headers=COMMENTS] {
_width: 300px;
min-width: 50px;
max-width: 300px }
</style>
Its solved the problem by fixing the width of the column but the column is not showing the full data now. It is hiding most of its part to fit it in that column.
Please give some idea.
Thanks,
ChandruHi,
I believe you will want to add a height specification to allow for multiple lines. And you may want/need to specifiy how you want lines to wrap.
Add (for example):
height: 60px;
white-space: nowrap;
word-wrap: break-word;
There are defaults and several options for white-space and word-wrap. You may want to look them up and give them a try for comparison.
Howard -
Matrix report with dynamic and fixed columns
Hi all,
I have a matrix report which has dynamic as well as few fixed columns.
It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
the actual layout should be like this
| category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......| 1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......| 1000 | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1000 | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
2234 | 7000This is my query, i have used union to get the row-wise column activity
/* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
SELECT DISTINCT /*ASSET_ID
SUM (cost),
SUM (cip_cost),
SUM (cip_cost_pk),
cat_desc--,sub_cat_desc
,activity
FROM (-- cip cost
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 <> '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
--cip cost pk
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
facc.cost cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 = '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
-- Disposal / Transferred / Retired
( -- retired
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_mass_ext_retirements_v ret
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = ret.asset_id
AND fa.asset_id = fat.asset_id
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
UNION
--transfer
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id
AND transtype = 'TRANSFER')
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
AND facc.asset_type = 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
GROUP BY cat_desc, activity
ORDER BY activityBrgds,
MaxHi all,
I have a matrix report which has dynamic as well as few fixed columns.
It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
the actual layout should be like this
| category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......| 1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......| 1000 | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1000 | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
2234 | 7000This is my query, i have used union to get the row-wise column activity
/* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
SELECT DISTINCT /*ASSET_ID
SUM (cost),
SUM (cip_cost),
SUM (cip_cost_pk),
cat_desc--,sub_cat_desc
,activity
FROM (-- cip cost
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 <> '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
--cip cost pk
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
facc.cost cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 = '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
-- Disposal / Transferred / Retired
( -- retired
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_mass_ext_retirements_v ret
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = ret.asset_id
AND fa.asset_id = fat.asset_id
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
UNION
--transfer
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id
AND transtype = 'TRANSFER')
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
AND facc.asset_type = 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
GROUP BY cat_desc, activity
ORDER BY activityBrgds,
Max -
i lost my ipod and in order to report it missing i need the serial number. Where do I find the serial number without the ipod or the packaging it came in?
- iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
Maybe you are looking for
-
Can't add files filmed in 1080/60i to Premiere Elements 12. I have no problem to add files filmed in 1080/30p. My camera is a Nikon aw1
-
Hello! I am taking into consideration about upgrading my laptop because my gaming FPS hangs around 15-30 if lucky so I think soon I am going to upgrade the Processor so that I can have enjoyment for my gaming or everyday other things I may do on my c
-
Viewing PDF Portfolio using Adobe Acrobat XI Pro in Sharepoint Foundation 2013
When opening a PDF Portfolio, created using Adobe Acrobat XI Pro, in Sharepoint Foundation 2013 the pages are blank in the default Layout view but you can see the contents in File view. How do we correct that so the files appear in both views? Local
-
I upgraded to Mainstage 3 but not Logic X. It seems the pathway for saving patches has changed in Mainstage 3. Here is my problem. I saved presets in Mainstage 3 but Logic 9 will not find them. I click on them and nothing happens to my channel st
-
Have 2ipod 80 gb and 120gb both with dead pixel problems
How to fix them?