Sorting and grouping issue in WDP-ALV table
lr_field->if_salv_wd_sort~create_sort_rule(
EXPORTING
sort_order = if_salv_wd_c_sort=>sort_order_ascending
group_aggregation = abap_true ).
And while binding data, I'm sorting the internal table having data as below
SORT wd_assist->gt_details_table(itab) BY bproc bsubproc function field ASCENDING.And output is as follows
In the above snapshot, The sorting is getting disturbed on colunm: Function......
But required output should be as below
Pls help me how to achieve this?
Thanks
Katrice
Hi Sandesh,
When we use the SALV_WD_TABLE component to display ALV, by default, all columns are arranged in the same order as the attributes in the context node of your
application.
You need to add the following code in the wddomodifyview( ) method of your View.
METHOD wddomodifyview
data:lt_columns type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref,
lo_column type ref to cl_salv_wd_column ,
lo_ref_cmp_usage type ref to if_wd_component_usage,
lo_ref_interfacecontroller type ref to iwci_salv_wd_table ,
lo_value type ref to cl_salv_wd_config_table.
* Get reference to the Component usage of the ALV.
lo_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_ref_cmp_usage->has_active_component( ) IS INITIAL.
lo_ref_cmp_usage->create_component( ).
ENDIF.
* Get reference to the Interface controller of the ALV.
lo_ref_interfacecontroller= wd_this->wd_cpifc_alv( ).
lo_value = lo_ref_interfacecontroller->get_model( ).
* Get the Columns of the ALV
CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
RECEIVING
value = lt_columns.
* Get reference to each column and set the column position
LOOP AT lt_columns INTO ls_column.
lo_column = ls_column-r_column.
CASE ls_column-id.
WHEN 'VBELN'.
lo_column->set_position('1').
WHEN 'MATKL'.
lo_column->set_position('2').
WHEN 'POSNR'.
lo_column->set_position('3').
WHEN 'MATNR'.
lo_column->set_position('4').
ENDCASE.
ENDLOOP.
ENDMETHOD.
Hope this helps you to resolve your issue.
Thanks
KH
Similar Messages
-
Sorting and Grouping -Two months in this query
Hi All,
many thanks for jeneesh
i am doing project for construction company, i face this problem in grouping points according to relation between these points the
Relation is from 1 to 100. If the point between this rang that mean there is relation between these points.
this question already solve but the results not correct when the table has more data.
SQL - sorting and grouping.
from jeneesh and many thanks for him.
This example for more clarifications
for example i have these points
id location percentage comments
1 loc 1,2 20% that mean point 1 and 2 close to each other by 20%
2 loc 1,3 40% that mean point 1 and 3 close to each other byy 40%
3 Loc 8,6 25% that mean point 8 and 6 close to each other by 25%
4 Loc 6,10 20%
5 LOC 11,10 10 %
6 LOC 15,14 0%Also , we can see the relation between these points as follwoing
- points 1,2,3 in one group why becuase 1,2 has relation and 1,3 has relation that mean 1,3 also has hidden relation.
- Points 6,8,10,11 in second group there are relations between them .
- but no relation between 1 or 2 or 3 with any point of 6,8,9,10,11
- as well as no relation between 15, 14 that mean 14 in third group and 15 in fourth group.
whati need?
to group the points that has relation according to percentage value ascending
The most important part is to group the points. SO , the below query the gropuing is not correct.
I have the follwoing table with data
drop table temp_value;
create table temp_value(id number(10),location varchar2(20), percentage number(9));
insert into temp_value values (1,'LOC 1,2',10);
insert into temp_value values (2,'LOC 1,3',0);
insert into temp_value values (3,'LOC 1,4',0);
insert into temp_value values (4,'LOC 1,5',0);
insert into temp_value values (5,'LOC 1,6',0);
insert into temp_value values (6,'LOC 2,3',0);
insert into temp_value values(7,'LOC 2,4',0);
insert into temp_value values (8,'LOC 2,5',30);
insert into temp_value values (9,'LOC 2,6',0);
insert into temp_value values (10,'LOC 3,4',0);
insert into temp_value values (11,'LOC 3,5',0);
insert into temp_value values (12,'LOC 4,5',40);
insert into temp_value values (13,'LOC 4,6',0);
insert into temp_value values (14,'LOC 6,7',40);
insert into temp_value values (15,'LOC 7,2',0);
insert into temp_value values (16,'LOC 8,2',60);
insert into temp_value values (17,'LOC 8,3',0);
insert into temp_value values (18,'LOC 3,1',0);
insert into temp_value values (19,'LOC 9,6',30);
insert into temp_value values (20,'LOC 11,2',0);
insert into temp_value values (22,'LOC 12,3',10);
insert into temp_value values (23,'LOC 19,3',0);
insert into temp_value values (24,'LOC 17,3',0);
insert into temp_value values (24,'LOC 20,3',0);when i used this query , the results is not correct
with t as
(select percentage,loc1,loc2,sum(case when percentage = 0 then 1
when loc1 in (l1,l2) then 0
when loc2 in (l1,l2) then 0
when l1 is null and l2 is null then 0
else 1
end) over(order by rn) sm
from ( select id,location,percentage,
regexp_substr(location,'\d+',1,1) LOC1,
regexp_substr(location,'\d+',1,2) LOC2,
lag(regexp_substr(location,'\d+',1,1))
over(order by percentage desc) l1,
lag(regexp_substr(location,'\d+',1,2))
over(order by percentage desc) l2,
row_number() over(order by percentage desc) rn
from temp_value
order by percentage desc
select loc,min(sm)+1 grp
from(
select loc,rownum rn,sm
from(
select percentage,decode(rn,1,loc1,loc2) loc,sm
from t a,
(select 1 rn from dual union all
select 2 from dual ) b
order by percentage desc,decode(rn,1,loc1,loc2) asc
group by loc
order by min(sm),min(rn);the results
SQL> /
LOC GRP
2 1
8 1
6 2
7 2
4 3
5 3
9 4
1 5
12 6
3 6
11 13
LOC GRP
19 14
17 15
20 22
14 rows selected.SQL>
but the correct is
Location group No
2 1
8 1
4 1
5 1
1 1
6 2
7 2
9 2
12 3
3 3
19 4
17 5
20 6many thanks in advance.
Edited by: Ayham on Nov 30, 2012 3:07 AMThanks,
i want the sorting for each group DESC not all groups to gather
when i used your query i get
SQL> with connects as (
2 select distinct
3 loc1
4 ,loc2
5 ,dense_rank() over (order by connect_by_root(loc1)) grp
6 from temp_value
7 start with
8 percentage != 0
9 connect by nocycle
10 (prior loc2 = loc1
11 or
12 prior loc1 = loc2
13 or
14 prior loc1 = loc1
15 or
16 prior loc2 = loc2)
17 and
18 percentage != 0
19 )
20 , got_grp AS
21 (
22 select
23 loc
24 ,dense_rank() over (order by grp) grp
25 from (
26 select
27 loc
28 ,max(grp) keep (dense_rank first order by grp) grp
29 from (
30 select
31 loc1 loc
32 ,grp
33 from connects
34 union
35 select
36 loc2
37 ,grp
38 from connects
39 )
40 group by
41 loc
42 )
43 )
44 SELECT loc
45 , grp
46 FROM got_grp
47 ORDER BY COUNT (*) OVER (PARTITION BY grp) DESC
48 , grp
49 , loc
50 ;The output is
LOC GRP
1 1
2 1
4 1
5 1
8 1
6 3
7 3
9 3
12 2
3 2
10 rows selected.but i want it like this
Loc Grp
2 1
8 1
4 1
5 1
1 1
12 2
3 2
6 3
7 3
9 3So , the sorting for each group Separate based on the percentage column.
many thanks
Edited by: Ayham on Nov 30, 2012 9:43 AM -
Using member sorting and grouping with two reports sharing rows
Hi!
I have a problem with one report and I need some help or advise here.
I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
PRODUCT MATERIAL AMOUNT
TOTAL PROD_A-X 100
PROD_A_A MAT1 22
PROD_A_B MAT1 50
PROD_A_A MAT2 28
TOTAL PROD_B-X 120
PROD_B_A MAT1 30
PROD_B_A MAT2 50
PROD_B_B MAT2 40
This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
Thank you very muchHi!
I have a problem with one report and I need some help or advise here.
I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
PRODUCT MATERIAL AMOUNT
TOTAL PROD_A-X 100
PROD_A_A MAT1 22
PROD_A_B MAT1 50
PROD_A_A MAT2 28
TOTAL PROD_B-X 120
PROD_B_A MAT1 30
PROD_B_A MAT2 50
PROD_B_B MAT2 40
This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
Thank you very much -
Sorting and Grouping in Projects View
In Projects view, when either of two of the three grouping options is selected, there are two sorts in effect: the groups themselves are sorted, and the contents of each group are sorted. These sorts are handled differently, depending on the grouping selected and the sort order selected.
(It appears that there is a bit of the old Apple voodoo in here. The results are arbitrary , but they seem to have been carefully chosen to meet most users expectations. That is to say -- and this is an Apple programming trait -- the arbitrariness is faithful to the expected users' needs, not to logic.)
There are four sorts available, and three groupings
Sorts:
. Name
. Date -- Oldest First
. Date -- Newest First
. Library
Groupings:
. Ungrouped
. Group by year
. Group by folder
So that's twelve possible ways to display Projects in Projects view.
Let's look at a few of them. I'm going to refer to the groups as "Year groups" or "Folder groups" and to the contents of the groups as "Projects". So there is sorting of the groups, and sorting of the contents of the groups (same as "within the group"). These I'll refer to as "Groups sorting" and "Projects sorting".
Sort: Date -- Newest First
Grouping: Group by Year
Result: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
Sort: Date -- Oldest First
Grouping: Group by Year
Results are as expected; a reversal of the "Newest First" sort, but with the same groups: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
Sort: Name
Grouping: Group by Year
Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are sorted alphabetically, descending.
Sort: Library
Grouping: Group by year
Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector. (Note that this last is literal: a Project named "Aardvark Close-ups" if it's in a Folder named "Zoography" will be listed after all the projects in "Yellow Paintings" and all the Projects in "X-rays, thoracic" if those Projects are in alphabetical order by Folder name in the Library. You can see all the Projects in your Library listed on the Library tab of the Inspector by "{Option}+clicking" the disclosure triangle next to "PROJECTS & ALBUMS" twice.)
Sort: Date - Newest First
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, newest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder.
Sort: Date - Oldest First
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, oldest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
Sort: Name
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted alphabetically by name, descending. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
Sort: Library
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector (see note above). Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are listed in the order they appear in the Library).
Ernie [asked:|http://discussions.apple.com/thread.jspa?threadID=2816124&tstart=0]
+I see those icons but note that those projects in folders will be in different sections arranged alpha, and then date within. Am I correct on that?+
The answer is, it depends.
If "Group by year" is selected, the Groups-sorting will always be by date, regardless of the sort order specified. The Groups-sorting order will follow whatever is specified for the Projects sort order (or default to "oldest first").
If "Group by folder" is selected, the Groups-sorting will always be alphabetical, descending, regardless of the sort order specified. (So if you use Projects view, take care in naming your Folders. Use prefixes if needed to force a desired alpha sort.)
If "Ungrouped" is selected, there are no Groups and perforce no Groups-sorting.
That's all I have to say on this topic (today).
Message was edited by: Kirby KriegerIn Projects view, when either of two of the three grouping options is selected, there are two sorts in effect: the groups themselves are sorted, and the contents of each group are sorted. These sorts are handled differently, depending on the grouping selected and the sort order selected.
(It appears that there is a bit of the old Apple voodoo in here. The results are arbitrary , but they seem to have been carefully chosen to meet most users expectations. That is to say -- and this is an Apple programming trait -- the arbitrariness is faithful to the expected users' needs, not to logic.)
There are four sorts available, and three groupings
Sorts:
. Name
. Date -- Oldest First
. Date -- Newest First
. Library
Groupings:
. Ungrouped
. Group by year
. Group by folder
So that's twelve possible ways to display Projects in Projects view.
Let's look at a few of them. I'm going to refer to the groups as "Year groups" or "Folder groups" and to the contents of the groups as "Projects". So there is sorting of the groups, and sorting of the contents of the groups (same as "within the group"). These I'll refer to as "Groups sorting" and "Projects sorting".
Sort: Date -- Newest First
Grouping: Group by Year
Result: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
Sort: Date -- Oldest First
Grouping: Group by Year
Results are as expected; a reversal of the "Newest First" sort, but with the same groups: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
Sort: Name
Grouping: Group by Year
Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are sorted alphabetically, descending.
Sort: Library
Grouping: Group by year
Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector. (Note that this last is literal: a Project named "Aardvark Close-ups" if it's in a Folder named "Zoography" will be listed after all the projects in "Yellow Paintings" and all the Projects in "X-rays, thoracic" if those Projects are in alphabetical order by Folder name in the Library. You can see all the Projects in your Library listed on the Library tab of the Inspector by "{Option}+clicking" the disclosure triangle next to "PROJECTS & ALBUMS" twice.)
Sort: Date - Newest First
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, newest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder.
Sort: Date - Oldest First
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, oldest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
Sort: Name
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted alphabetically by name, descending. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
Sort: Library
Grouping: Group by folder
Result: Folder groups are sorted alphabetically by name, descending. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector (see note above). Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are listed in the order they appear in the Library).
Ernie [asked:|http://discussions.apple.com/thread.jspa?threadID=2816124&tstart=0]
+I see those icons but note that those projects in folders will be in different sections arranged alpha, and then date within. Am I correct on that?+
The answer is, it depends.
If "Group by year" is selected, the Groups-sorting will always be by date, regardless of the sort order specified. The Groups-sorting order will follow whatever is specified for the Projects sort order (or default to "oldest first").
If "Group by folder" is selected, the Groups-sorting will always be alphabetical, descending, regardless of the sort order specified. (So if you use Projects view, take care in naming your Folders. Use prefixes if needed to force a desired alpha sort.)
If "Ungrouped" is selected, there are no Groups and perforce no Groups-sorting.
That's all I have to say on this topic (today).
Message was edited by: Kirby Krieger -
Sorting and Grouping by multi-value Choice columns - any options?
I found out the hard way that SharePoint doesn't support sorting or grouping lists by Choice columns that are set to "Allow Multiple Values." I'm stunned by this missing capability, and my project has come to a complete halt without it. It's like Microsoft only implemented hafl the feature -- you can put data in, but then you can't do anything with it. You can't even use the column in a formula in another column, so you can't parse it.
I'm not posting just to gripe though. Does anyone have any suggestions for alternatives? What do you do when you need to let people make multiple selections, and then you want to sort or group by those values? Are there any add-on products that allow this? At this point my only option seems to be to not allow multiple choices, but that's taking away a rather significant feature.
Thanks for any ideas,
SteveHi Paul,
Thank you for the reply and the additional questions. For my situation I want to use the multi-value choice to indicate a "belongs to" relationship, as in "this item belongs to projectA, projectB, and project C. Because there are more than 10 projects, I didn't want to create a separate Yes/No checkbox for each one.
For viewing the information, I'm looking primarily for a "group by" function. So if an item belongs to projectA, projectB, and projectC, it would appear three times, once under the grouping for each project. What I don't want is for a row that only belongs to projectA to be grouped separately from a row that belongs to both projectA and projectB. I want to see all the rows that belong to projectA grouped together, regardless of whether they also belong to other projects.
I'll look into using a grid control, but if you have any other suggestions I'll certainly listen.
Steve -
Swatches CS3 - Sorting and grouping possible?
Hello,
a simple question. Is it possible to sort or group swatches?
If the answer is yes, how do I do it?
Thanks,
MattYou can select and drag them up and down the panel.
k -
How can I do a Header Group Using Group columns for WD ALV tables
Hi
I want to group columns into a header group.
Eg:
from Date
Availability
to date
Any ideas if it is possible with WD ALV tables?Hi,
Try to use the if_salv_wd_field_settings for the column grouping of the Model object.
Also check the class CL_SALV_WD_FIELD.
Regards,
Lekha. -
Hello All,
I am facing a issue in assigning users to groups in shared services. Version 11.1.1.3
Actually users are present in LDAP and groups i created in Native Directory. Now i am writing Maxl .. Alter user ... add to group.... but its throwing a error that user doesnot exist, though the user exists in LDAP. I tried assigning users in groups manually, it worked. Can any one tell me how to do it through MAXL or any other way as i dont want to do it manually because there are 100s of user.
2) Can any one please tell me the use of Updateuser and provisioning user utility. In what scenario we use them?
Thanks,
AbhiThere is a way through Maxl an example being
create or replace user 'essuser' type external;
alter user 'essuser' add to group essgroup;
or
create or replace user 'essuser@LDAPNAME' type external;
alter user 'essuser@LDAPNAME' add to group essgroup;
Cheers
John
http://john-goodwin.blogspot.com/ -
TableModel with SORT and GROUP BY functions solution.
Hello all,
I'd like to represent an EnvelopeTableModel. This class is developed to incapsulate another TableModel and allow user to reorder and group data without changing original values and orders.
It allows to perform multi column sortings and grouping and
supports following group functions: EMPTY, COUNT, MIN, MAX, SUM, AVG.
Here you can download the library, demo version and documentation.
http://zaval.org/products/swing/
It would be great to know all your opinions.
With best regards
Stanislav LapitskyAbout 1) and 3).
These suggestions are almost the same. These features will change GUI component but i want to improve TableModel instead of JTable.
Using the model user can use JTable for data representation.
Of course I can improve JTable component and add multiline row/column headers with ability to reorder/group data from component and a lot of another widgets but it isn't my goal.
About 2) What do you mean "crosstab"?
Thanks for your 2-cents :-).
With best regards
Stas -
Hello Friends,
I have made an ALV report where I am sorting on the second column which is a field called 'SUPPLIER_ID'.
I am to group the supplier_id, so that only the first row shows the supplier id, and those rows with the same id should not be shown. But am having trouble with this.
check Supplier ID field2 field3
xxxxx xxx xxx
xxx xxx
xxx xxx
xxxxxx xxx xxx.
These are the steps I do in the code.
1. I build the fieldcatalogue
2. then I select the data
3 . set the sort order
DATA: x_sort TYPE slis_sortinfo_alv.
CLEAR x_sort.
x_sort-fieldname = 'SUPPLIER_ID'.
x_sort-tabname = 'GT_OUTTAB'.
x_sort-up = 'X'
x_sort-spos = 2.
APPEND x_sort TO t_sort.
4. Then I call the Reuse function.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = t_fieldcat
i_callback_pf_status_set = l_status
i_callback_program = l_repid
it_sort = x_sort
TABLES
T_OUTTAB = gt_outtab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
But all the rows show the supplier ID, what am I doing wrong?
best regards B
Edited by: Baljinder Singh Gosal on Sep 29, 2008 2:36 PMtypes: begin of gs_outtab.
types:
SUPPLIER TYPE ZSAM_LAC-SUPPLIER,
SUPPLIER_ID TYPE ZSAM_LAC-SUPPLIER_ID,
SPEND TYPE ZSAM_LAC-SPEND,
lights type char1,
color type i,
tabcol type lvc_t_scol,
id type char25,
name type icon-name,
symbol type icon-id,
end of gs_outtab.
data: gt_outtab type standard table of gs_outtab,
wa_outtab type gs_outtab.
data: gr_container type ref to cl_gui_custom_container,
gs_layout type lvc_s_layo,
gt_fieldcat type lvc_t_fcat.
perform display.
form display.
data: ls_layout type slis_layout_alv,
t_fieldcat TYPE slis_t_fieldcat_alv,
x_sort TYPE slis_sortinfo_alv
t_sort TYPE slis_t_sortinfo_alv,
l_status TYPE slis_formname,
l_repid TYPE syrepid.
REFRESH t_sort.
REFRESH t_fieldcat.
g_pf_status = 'SALV_STANDARD'.
l_status = 'SET_PF_STATUS'.
l_repid = sy-repid.
Layout
ls_layout-lights_tabname = '1'.
ls_layout-lights_fieldname = 'LIGHTS'.
ls_layout-coltab_fieldname = 'TABCOL'.
ls_layout-zebra = 'X'.
PERFORM set_fieldcat2 USING:
*pos fieldname ref_field ref_tab len noout text_m text_l txt_s reptxt ddic hotsp icon chckbx edit dosum inttype symbol tech group fieldcat
1 'CHECK' 'XFELD' space space space 'Select' 'Select' 'Sel' 'Select' space space space 'X' 'X' space space space space space t_fieldcat,
2 'SUPPLIER' 'SUPPLIER' 'ZSAM_LAC' space space text-hl5 text-hl5 text-hl5 space space space space space space space space space space space t_fieldcat,
3 'SUPPLIER_ID' 'SUPPLIER_ID' 'ZSAM_LAC' space space text-hl4 text-hl4 text-hl4 space space space space space space space space space space 'A' t_fieldcat,
perform get_data
perform set_icons.
perform set_order USING 'ORKLA_COMP_NAME' 'GT_OUTTAB' 'X' space space t_sort.
CLEAR x_sort.
x_sort-fieldname = 'SUPPLIER_ID'.
x_sort-tabname = 'GT_OUTTAB'.
x_sort-up = 'X'.
x_sort-spos = 1.
APPEND x_sort TO t_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = t_fieldcat
IT_EXCEPT_QINFO = gt_exc
i_callback_pf_status_set = l_status
i_callback_program = l_repid
it_sort = t_sort
TABLES
T_OUTTAB = gt_outtab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " display_fullscreen -
Hello,
Anyone know if there is a way to do something like this?
Original XML:
<item>
<word>word1</word><num>10</num><num2>9</num2>
</item>
<item>
<word>word2</word><num>5</num><num2>3</num2>
</item>
<item>
<word>word1</word><num>7</num><num2>6</num2>
</item>
I want to do something like group on <word> and sort accending on sum(<num>), min(<num2>) and end up with this:
<item>
<word>word1</word><num>17</num><num2>6</num2>
</item>
<item>
<word>word2</word><num>5</num><num2>3</num2>
</item>
Is this possible?
thanks,
chad.Here's a start. See Chapter 9 of my book for a complete explanation of how to exploit XSLT keys like database functional indexes to make grouping operations like this be fast in XSLT. It takes a bit to wrap your mind around why and how it works and the book has figures that help illustrate this.
<!-- chad.xml -->
<list>
<item>
<word>word1</word><num>10</num><num2>9</num2>
</item>
<item>
<word>word2</word><num>5</num><num2>3</num2>
</item>
<item>
<word>word1</word><num>7</num><num2>6</num2>
</item>
</list>
<!-- chad.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:key name="g" match="item" use="word"/>
<xsl:output indent="yes"/>
<xsl:template match="/">
<list>
<xsl:for-each select="list/item[generate-id(.)=generate-id(key('g',word)[1])]">
<xsl:sort data-type="number" select="sum(key('g',word)/num)"/>
<xsl:variable name="items-with-same-word" select="key('g',word)"/>
<item>
<word><xsl:value-of select="word"/></word>
<num><xsl:value-of select="sum($items-with-same-word/num)"/></num>
<num2><xsl:value-of select="sum($items-with-same-word/num2)"/></num2>
</item>
</xsl:for-each>
</list>
</xsl:template>
</xsl:stylesheet>This produces the output:
<list>
<item>
<word>word2</word>
<num>5</num>
<num2>3</num2>
</item>
<item>
<word>word1</word>
<num>17</num>
<num2>15</num2>
</item>
</list> -
Audiobook sorting and grouping
How do I group the audiobooks on a iPod nono G5. The same audiobook works perfectly on my iPhone, but when i add them to my iPod the books don't group and all the tracks are sorted by track names, so all the books are mixed in one long list.
This is a very annoying bug which Apple do not seem to be addressing. If you look at the previous thread "Major Audio book problem ipod 5th gen" then you will find some workaround.
Hope it helps -
RegEx: find() and group() issue...
Hi,
In the code below, I use the find() method to search the first occurence of a match and then group(1) to retrieve that match if the find() method returns true.
The problem is that the find() method returns true and the group(1) throws an ArrayOutOfBoundException :(
Here is the RegEx code I use:
String value = "${local.production}\\makeresults\\repository";
Matcher matcher = Pattern.compile("\\$\\{.*\\}").matcher(value);
if (matcher.find()) {
System.out.println(matcher.group(1)); // throws an ArrayOutOfBoundException
Got this output:
Exception in thread "main" java.lang.IndexOutOfBoundsException: No group 1
at java.util.regex.Matcher.group(Matcher.java:463)
at Test2.main(Test2.java:28)Have I made any mistakes?
Thanks in advance for your help.
Best regards,
Serge.You shall use group() without parameter to get complete sequence.
Only capturing groups (between parenthesis) are indexed (from left to right, starting at one.)
Here you don't have capturing group (and that's why it says No group 1), and it seems that you need the entire pattern, so you need the group() method.
Matcher
Tim - Actually, you can also use group(0) ... -
Hello
I would like to raise a question I am not able to answer
I want to group invoice at the end of the month with all delivery notes created within the month
The question is that some lines are text lines and there is no DN attached to the the line
as a result on the invoice the first group is DN without number grouping all empty lines
then I can see the grouping of delivery notes number
My question is how to delete on the lay-out the text lines so the document is clean and not showing a group of empty lines at the start of the document
thank youHi,
1. Create a field with variable 157, let's say it's field F_001
2. Create a formula field: F_002: F_001!='T'
3. Link all the row level fields on the repetitive area to this formula field. They will be displayed only if the row type is not text.
Regards,
Nat -
Playlist sorting and Burning issues
I don't know how to tell the community that I solved my problem. I hope this is the way:
I retitled each song to be put into a playlist by adding "A" in front of the title the first song, a "B" in front of the second. etc.
That solved the problem.
Thanks, Community.
7jeep7Hi,
I am having kind of a similar problem...I created the movie in Final Cut Pro and transfered it to Compressor...first it wouldn't recognize it and I had to send it to motion and then to compressor...now when I go to Compressor to select the Target with settings, under Apple or custom nothing specific comes under MPEG-2 just "ALL" is selectable. When we select "all" nothing happens and when we try submitting, it gives an error that you have not specified the Target and Destination..I am so confused...please help....
Maybe you are looking for
-
Cannot boot from usb flash to install Windows 8 on Macbook Pro 13"
Hi! All I have a 2011 Macbook Pro 13" and I want to install Windows 8 on it. I use bootable USB stick, which I can boot fine from on my PC, so I assume it's not the USB stick that is a problem. First of all Bootcamp didn't recognise it. Fine, I parti
-
Issue-How to book costs-Vendor Invoice
Hi, I have got following scenario. I got several POs raised for procuring goods from a vendor. The vendor send the shipment combining these PO. The goods are cleared by local agents(vendors) and they also charge for clearing the goods. All these cost
-
How does the so-called duplicated data saved?
I am confused with this question now. If a DB supports duplicate data. My question is: if I put 10 record, their data with same key, would BDB save key once and data 10 times, or 10 (same)key and 10 data? I mean, the same key is "100001", different d
-
Publish Button is Gone!! Updated Reader 9.1
We just updated to Reader 9.1 and have noticed the Publish button/tools are no longer in upper right. Only in Tasks drop down. In order to see the Tasks tool set you must right click tool bar and turn it on. When re-launching browser, Task tools do n
-
10.2.0.4 patchset
hello friends Can I apply patch p7584866_10204_Win32 on a 10.2.0.1 DB, windows 32bit. ? SQL> select * from v$version; BANNER Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Produ