How to ALV Column Group?
Hello all,
Can ALV setting column group as below?
Example
Group : JAN
Column : Qty, Amt, Avg
Group : FEB
Column : Qty, Amt, Avg
Group : MAR
Column : Qty, Amt, Avg
Group : DEC
Column : Qty, Amt, Avg
Regard,
Susan.HRB
Edited by: HRB Susan on Oct 14, 2009 9:23 AM
Edited by: HRB Susan on Oct 14, 2009 9:31 AM
Edited by: HRB Susan on Oct 14, 2009 9:33 AM
Edited by: HRB Susan on Oct 14, 2009 9:41 AM
Edited by: HRB Susan on Oct 14, 2009 9:41 AM
Hello ,
I understand that yours is a requirement related to alv tree display...
You could group the columns at the field where you want to display the tree format and use the function module reuse_alv_tree_display to display the fields in tree format'.
Thanks
Similar Messages
-
Hi All
Can someone please help me regarding this question???
I am desperately trying to create 'dynamic' column header groups - like illustrated below. But with ALV - not table method.
http://picasaweb.google.com/dave.alexander69/Pictures#5246199906532545890
Does anyone have any ideas where to start with Header grouping?
Do I add an instance of CL_WD_TABLE_COLUMN_GROUP?
Many Thanks
Dave AlexanderHi Dave,
I guess that this group column header facility is not available with ALV as how you are asking for. Just check out Thomas Jung's explanation in [here|header group in wd alv].
Regards,
Uday -
How to concatenated columns group by clause
with apps AS (
SELECT 'a' AS APP_ID,1 AS RANK FROM DUAL
UNION
SELECT 'a' AS APP_ID,2 AS RANK FROM DUAL
UNION
SELECT 'a' AS APP_ID,3 AS RANK FROM DUAL
UNION
SELECT 'b' AS APP_ID,4 AS RANK FROM DUAL
UNION
SELECT 'b' AS APP_ID,5 AS RANK FROM DUAL
UNION
SELECT 'c' AS APP_ID,6 AS RANK FROM DUAL
SELECT APP_ID,RANK FROM apps ORDER BY 2;
A RANK
a 1
a 2
a 3
b 4
b 5
c 6
6 rows selected.
concatenated_column
a,1, 2,3
b,4, 5
c,6Few days earlier someone has posted this - i think this might help u---
CREATE OR REPLACE FUNCTION scott.rowtocol(p_slct IN VARCHAR2,p_dlmtr IN VARCHAR2 DEFAULT ',')
RETURN VARCHAR2 AUTHID CURRENT_USER
AS
TYPE c_refcur IS REF CURSOR;
lc_str VARCHAR2 (4000);
lc_colval VARCHAR2 (4000);
c_dummy c_refcur;
BEGIN
OPEN c_dummy FOR p_slct;
LOOP
FETCH c_dummy
INTO lc_colval;
EXIT WHEN c_dummy%NOTFOUND;
lc_str := lc_str || p_dlmtr || lc_colval;
END LOOP;
CLOSE c_dummy;
RETURN SUBSTR (lc_str, 2);
END;
SELECT DISTINCT a.job,
rowtocol
( 'SELECT ename FROM emp WHERE job = '
|| ''''
|| a.job
|| ''''
|| ' ORDER BY ename'
) AS employees
FROM emp a;
JOB EMPLOYEES
SALESMAN ALLEN,MARTIN,TURNER,WARD
CLERK ADAMS,Avik,BARRY,MILLER,Roni,prithwi
ANALYST FORD,SCOTT
PRESIDENT KING
MANAGER BLAKE,CLARK,JONESRegards.
Satyaki De. -
Web dynpro for abap how to create a customize search help in alv column
hi:
Web dynpro for abap how to create a customize search help in alv column and put search help value into alv column?
Are there specific examples ?
thanks!!HI:
I want to created a freely programed help which include date&time,and put help value to alv column.
I have created a freely programed help in web dynpro for abpa application,I refer:
**************** - WebDynpro for ABAP
but have a problem!
If you focus on the the input field in the first row, you get the value help
However if I go to the second row and focus on the same input field in this column, I don't get the value help:
What is a good way to solve similar problems?
thanks -
How To avoid column heading for only total line in ALV list Display
Hi,
How To avoid column heading for only total line in ALV list Display.Hi,
to change colunm header field catlog is built
look at the example below
Changing column text headers
use this to change, hide, or alter the ALV columns
CLEAR: gt_fcat.
READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
*TEXT1 is your field name
ASSIGNING <gtfcat>.
IF sy-subrc = 0.
<gtfcat>-coltext = 'Date Type'.
<gtfcat>-no_out = ' '.
<gtfcat>-tooltip = 'Date Type Text from IT0019'.
<gtfcat>-seltext = 'IT0019'.
keep seltext to '' if u want to hide
ENDIF.
regards
austin -
How to create RunningValue Through Column Groups?
Hi Everybody i´m trying to do this with a Matrix
I want the running value of the product quantity for each month of a year,
resetting the running value
when a new year is reached
I have 2 column groups "Year" and as it´s child group "Month".
2009
2010
January Febrary March January February March
Product
Toolbelt 10 15 20
1 10 50
Well that is the idea...
In the field of the quantity i´m using an expression like this = RunningValue(Fields!Quantity.Value, Sum, Nothing) .
With this expression i get the the running value and it´s great, but
it does not reset thru the years ,
it continues aggregating the quantity value.
So i tried with this expression assuming if i set the SCOPE to the Year group i can achieve this
= RunningValue(Fields!Quantity.Value, Sum, "Year") ,
But surprise!!, this is not giving me the right aggregation , i´m still dig in it and can´t find what it actually aggregates.
Am I doing something wrong?.
All the help is welcome. Thanks.Hi UzielB,
Based on your information, I get your requirement completely, here you want to accumulate the value of month from
Jan to March whin one year, then return to Jan again whin another year. If I misunderstand you please do not hesitate to let me know.
Now the issue you are encountering is that the value does not reset through the different years.
Actually, nomatter it is 2009 or 2010, RunningValue function takes different years as the same scope, so the value does not reset
through the different years. Just like picture3.
To workaround the issue, we might need to utilize the subreport in the main report, for detailed steps please follow
these:
1.
Design the subreport with two column groups
Year, Month and one row group Product.
2.
Type in the expression in the data textbox
=RunningValue(Fields!Yourdatafield.Value,sum,"Product") Here
Product is the row group name.
3.
Add one parameter
Year to the subreport, of course you should add the parameter year behind the where clause in the T-sql. Such as
select * from yourtable where Year=@Year
4.
Delete the
Year column and Product column, here please make sure you just delete the column only rather than deleting the relevant reportitem.
5.
Decrease the height and width of the report to the report control size, then there is no blank space when displayed in the main report.
6.
Drag a matrix to the main report, just add one column group
Year.
7.
Then drag a subreport control into the data textbox, and then rigth-click the subreport control->select subreport
properties
8.
In the Subreport Properties dialogbox, please selec the subreport name in the drop-down list of
Use this report as a subreport
9.
Swith to
Parameter tab, click Add button to add a parameter, then select the
Year in the Name drop-down list and
Year datafield in the Value drop-down list.
10.
Click OK.
11.
Now add another table control into the
main report body with one column, and drag the product datafiled into the data textbox. Then group the table by
Product.
12.
Drag this table into the
Rows textbox of the main report. Here make sure the height of the rows in Subreport and table creted in step11 is the same, otherwise the lines in not stay in the same level.
Preview the report, you will see the report like picture2.
If you have any question about the steps, please feel free to ask.
Have a wonderful day
J
Challen Fu -
How to Display Formatted Text IN ALV Column?
HI experts ,
I am displaying ALV with Multiple Column's , One of the Column is TEXT(Fomatted text).
When ALV is Displayed TEXT Column Comes as Continues TEXT . and is Not Formatted .
Now when i want to edit this text i am Calling another View which contains text edit . This Text edit will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
Is there any way where in i can display the Formatted text in ALV Column ?
Any body have any clue with this ...
Thanks in Advance
Patil
Edited by: Badarinarayan Patil on Feb 22, 2008 3:45 PMHi Juergen,
I found Your blog and found it really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
Some suggestion will be greatly appreciated.
Thankyou
Simone -
How to get the difference between two columns in a column group
Hi All,
My first time here and really new to programming. I would like to get the difference between 2 columns that are inside
a column group.
Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
PeriodNumber
Account 1 2
1) Cash 10,000 15,000
2) Receivables 12,000 11,500
3) Equipment 5,000 5,500
Total Assets 27,000 32,000Hi yabgestopa,
From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
Dim Shared Num1 As Integer
Dim shared Num2 As Integer
Public Function GetAmount(Amount as Integer, Type as String)
If Type = "1" Then
Num1=Amount
Else
Num2=Amount
End If
Return Amount
End Function
Public Function GetDif()
Return Num1-Num2
End function
Right-click the second column to insert a third column with Outside Group-Right.
Then use the expressions below in the matrix.
=Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
=code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
=Code.GetDif()
The report looks like below.
If you have any questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to hide ALV column in webdynpro
Hi frnds,
I want to hide one columns in ALV output on webdynpro , give the procedure ...
Thanks & Regards,
Rajesh.jProcedure is :
a) Get ALV Model reference
b) Get list of ALV Columns
c) Loop at each column and set visibility
Code would be something like this
I'm storing ALV model reference in view attributes wd_this->alv_config_table of type ref to CL_SALV_WD_CONFIG_TABLE.
Data: lo_cmp_usage type ref to if_wd_component_usage.
DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column TYPE REF TO cl_salv_wd_column,
lt_column type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref.
*create an instance of ALV component
lo_cmp_usage = wd_this->wd_cpuse_OVERVIEW_EARNED_ALV( ).
* if not initialized, then initialize
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
* get ALV component
lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_EARNED_ALV( ).
wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
lr_column_settings ?= wd_this->alv_config_table.
lt_column = lr_column_settings->get_columns( ).
loop at lt_column into ls_column.
CASE ls_column-id.
when 'POST_YEAR'.
ls_column-r_column->set_visible( if_wdl_core=>visibility_none ).
ENDCASE.
endloop. -
Hi
i am using alv table in my application. iam sorting the alv table and allowing three columns to be grouped. its displays fine initially but after i sort the columns the grouping is gone.
any suggestions how can i maintain the grouping of the columns even after sorting.
regards
chythanyaHi
iam writing this code to do the column grouping.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv_activity( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_config_model TYPE REF TO cl_salv_wd_config_table.
lo_config_model = lo_interfacecontroller->get_model( ).
lo_config_model->IF_SALV_WD_TABLE_SETTINGS~SET_MULTI_COLUMN_SORT( value = abap_true ).
lr_field = lo_config_model->if_salv_wd_field_settings~get_field( 'CARRID' ).
lr_field->if_salv_wd_sort~create_sort_rule( sort_order = if_salv_wd_c_sort=>sort_order_descending ).
lr_field->if_salv_wd_sort~set_grouping_allowed( value = ABAP_true ).
clear: lr_field.
lr_field = lo_config_model->if_salv_wd_field_settings~get_field( 'CONNID' ).
lr_field->if_salv_wd_sort~create_sort_rule( sort_order = if_salv_wd_c_sort=>sort_order_descending ).
lr_field->if_salv_wd_sort~set_grouping_allowed( value = ABAP_true ).
regards
chythanya -
How to get column values on item added event receiver
Hi,
I have two columns in a document library and one is people or group column and the other one is choice column with check boxes.
I want to know how to read column values on Item Added event receiver, so that I can create if statements based on those values.
Thank you,
AA.Hi AOK2013,
Have you had a look at this Microsoft tutorial: http://msdn.microsoft.com/en-us/library/office/gg981880(v=office.14).aspx
Essentially, you want to use the AfterProperties property to access the changed field value.
E.g.
var personvalue = properties.AfterProperties["YourPersonFieldName"]
Regards, Matthew
MCPD | MCITP
My Blog
View
Matthew Yarlett's profile
See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
Upload and Crop User Profile Photos -
How do I restore Groups to Contacts from time machine?
How do I restore groups to Contacts using time machine? I somehow managed to duplicate many groups and contacts in Contacts, so I deleted everything and tried to restore them using time machine backup from a few days before. It restored all my contacts, but none of my groups. If you select a group and click restore it will restore all the contacts in the group, but not the group itself. I had many groups with many contacts in each and would really prefer not to do this manually. I can see the groups in the time machine backup, but cannot figure out how to restore them. I know from researching online that with Address Books and previous operating systems you could go to ~Library/Applications Support/AddressBook and restore the whole file, but either this operating systems hides the necessary files or Contacts is set up differently than AddressBook was. I am using OS 10.9.5 and Contacts version 8.0 on a MacbookPro 13 inch mid 2010.
Here is what I have tried:
1. Finder>Go>(Option)Library>Address Book(highlighted)with files showing in right column. Opened Time Machine and Address Book folder is there. Tried to go back to several previous dates from several months ago. None will highlight in order for the Restore button to light up.
2. Finder>Mac HD (under Devices)>(Option)Library>Address Book (same as above). Again, cannot go anywhere back in time to highlight a date for Restore button to light up.
Note: I was able to use Time Machine to restore my Contacts with no problem. However, they are All Contacts only and did not restore my Groups. I do know how to make groups again and highlight and drag them back, but wanted to see if there was a way to restore the groups. I will post another question as to why my Time Machine won't let me restore the Address Book as well as the Contacts. Thank you for your time and patience. -
How to create a group mailing list?
how to create agroup mailing list?
i have followed instructions on "how to create a group mailing list" & get a total blank when i hit return after entering the group name in addressee column. this is after i created a new group under address book, & then drug over individual names into the group. what am i doing wrong?
-
SSRS 2008 R2 - Add moving average to column group
I have a column group of dollar amounts. The row is a year/month. I would like to add a moving average column to the right of the last 6 months. My SQL Server data source is already complex enough and I'd really prefer not to add a column
there. Is there anything I can do within the report itself? Some way to reference the previous records in a matrix?
Thank you!Hi mateoc15,
According to your description, you have a matrix in your report. Now you want to calculate the average value of last 6 month. Right?
In Reporting Service, we can put custom code into report to deal with complicated logic. Add one more column/row inside of group and call the functions defined in custom code. For your requirement we modified Robert’s code to achieve your goal. We tested
your case in our local environment with sample data. Here are steps and screenshots for your reference:
Put the custom code into report:
Private queueLength As Integer = 6
Private queueSum As Double = 0
Private queueFull As Boolean = False
Private idChange As String=""
Dim queue As New System.Collections.Generic.Queue(Of Integer)
Public Function CumulativeQueue(ByVal currentValue As Integer,id As String) As Object
Dim removedValue As Double = 0
If idChange <> id then
ClearQueue()
idChange = id
queueSum = 0
queueFull = False
CumulativeQueue(currentValue,id)
Else
If queue.Count >= queueLength Then
removedValue = queue.Dequeue()
End If
queueSum += currentValue
queueSum -= removedValue
queue.Enqueue(currentValue)
If queue.Count < queueLength Then
Return Nothing
ElseIf queue.Count = queueLength And queueFull = False Then
queueFull = True
Return queueSum / queueLength
Else
Return (queueSum) / queueLength
End If
End If
End Function
public function ClearQueue()
Dim i as Integer
Dim n as Integer = Queue.Count-1
for i=n To 0 Step-1
queue.Dequeue()
next i
End function
Add one more row inside of group, call the function defined in custom code.
Save and preview. It looks like below:
Reference:
Moving or rolling average, how to?
If you have any question, please feel free to ask.
Best Regards,
Simon Hou (Pactera) -
How to add column dynamically based on user input in oracle?
**how to add column dynamically based on user input in oracle?**
I am generating monthly report based on from_date to to_date below is my requirement sample table
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
100001.............John...........02-OCT-12...............6
100002.............chris...........01-OCT-12...............4
Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
below is my code
create or replace
procedure MONTHLY_LVE_NEW_REPORT_demo
L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
--L_LEAVE_TYPE_CODE IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
L_DEPARTMENT_CODE IN VARCHAR2,
--L_MONTH IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
MONTHRPT_CURSOR OUT SYS_REFCURSOR
AS
O_MONTHRPT_CURSOR_RPT clob;
v_return_msg clob;
BEGIN
IF (L_BUSINESS_UNIT IS NOT NULL
AND L_FROM_DATE IS NOT NULL
and L_TO_DATE is not null
-- AND L_DEPARTMENT_CODE IS NOT NULL
THEN
OPEN MONTHRPT_CURSOR FOR
select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
from
SELECT DISTINCT a.employee_code,
a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
a.DEPARTMENT_CODE,
a.DEPARTMENT_DESC,
B.LEAVE_TYPE_CODE,
B.LVE_UNITS_APPLIED,
B.CREATED_DATE as CREATED_DATE,
DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
b.status
from SSHRMS_EMPLOYEE_DATA a
join
SSHRMS_LEAVE_BALANCE C
on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
and C.STATUS = 'Y'
left join
SSHRMS_LEAVE_REQUEST_TRN B
on
B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
and B.STATUS in ('A','P','C')
and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
join
SSHRMS_LEAVE_REQUEST_TRN D
on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
and D.LEAVE_TYPE_CODE in ('CL')
AND D.LEAVE_TYPE_CODE IS NOT NULL
group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
else
v_return_msg:='Field should not be empty';
end if;
END;
my code actual output
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
100001....................John............02-OCT-12.................6
100001....................chris...........01-OCT-12.................4
how to add column dynamically based on from_date to to_date?
Thanks and Regards,
Chris Jerome.You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);
Maybe you are looking for
-
How can I scan with HP 5600 all in one?
Hi! I have an HP 5600 all in one. I recently switched to an iMac Leopard. The printer driver does not have any scanning support. Is there any other driver available to get this support? Or will I have to get a compatible printer to be able to use sca
-
Address Book quirky search behavior in Snow Leopard vs. reg. Leopard?
Address Book in 10.5.8 Leopard always allowed quick location of an entry by typing the first few characters of the last name. Gets me the precise name or close to it. AB in Snow L. doesn't do the same. In SL when typing same first 3-4 characters, AB
-
Freight condition not appear in MIRO
Hi, The freight condition is shown under PO - Item - Condition,however when try to do MIRO,it was not shown there. Anyone know the reason? Thanks.
-
The track pad zoom feature doesn't work with the latest version of Firefox. It did on the previous version. I used to use Firefox as my default browser, but no longer use it very much due to the incompatibility of this version on my Macbook Pro.
-
My DV6 easily gets hot.
hi sifu, I need help about my DV6 6001-TX. I using the Speccy to monitor my memory, processor and CPU heat. When I use my DV6 to operate 3D studio max 64bit .the CPU heat and graphic heat is only around below 56 C. but the prosessor can easily up to