Precalculate all characteristics combinations of a BW query...
Hi All,
We need precalculate all possible characteristics combinations (drill downs) of a query to fill the BW cache.
Looking on the Reporting Agent it´s possible precalculate a bw query using another query to control the filters, however using this feature it is not possible to pass all the possible navigations steps of the query to the variant.
Anyone can help me with this issue?
Enrique.
Enrique,
Welcome to SDN...
What you need to do for the same is :
Have all the characteristiics in the rows areas and then run the query in the background using reporting agent , this will fill up the OLAP cache and you can use the same.
All the data resides in the cache and you can use the original query later and it would fetch the records from the cache.
To check the same , activate the cache first
Then run the fully detailed query
Now run any other version of the query through BeX and then check in SM04 to see if you are fetching the records directly from the cube/ods or from the cache ( indicated by RSRCACHE)
Arun
Assign points if useful
Similar Messages
-
Combining results with a Query of Queries - NOT QUITE THERE!!!
I have included a small sample of my database, specifically the four tables I am trying to work with in the hopes that someone can steer me down the right path. Here are the four tables and the bottom is a visual desciption of what I am trying to achieve;
ORDERS
SALES CALLS
ID
SaleDate
TerritoryManager
UserID
SaleDate
TerritoryManager
ID
UserID
426
01-Oct-09
Mike B
10112
10/1/2009
Mike B
253
10112
427
01-Oct-09
Russ C
10115
10/1/2009
Mike B
254
10112
430
01-Oct-09
Jerry W
10145
10/1/2009
Mike B
255
10112
432
01-Oct-09
Ron H
10118
10/1/2009
Mike B
256
10112
433
01-Oct-09
Ron H
10118
10/1/2009
Ron H
257
10118
10/1/2009
Ron H
258
10118
PRODUCTS ORDERED
10/1/2009
Ron H
260
10118
OrderID
Quantity
NewExisting
UserID
10/1/2009
Russ C
261
10115
426
12
0
10112
10/1/2009
Mike B
267
10112
427
2
0
10115
10/1/2009
Mike B
268
10112
427
3
1
10115
430
1
0
10145
USERS
430
1
0
10145
TerritoryManager
Zone
UserID
432
1
0
10118
Mike B
Central
10112
432
1
0
10118
Russ C
Central
10115
432
1
1
10118
Jerry W
Central
10145
432
1
1
10118
Ron H
Central
10118
433
2
1
10120
Don M
Central
10120
Central Zone
Ttl Calls
Ttl Orders
Ttl Items
Ttl New Items
Mike B
5
1
12
1
Russ C
1
1
5
Jerry W
1
2
Ron H
3
2
6
3
I have tried to achieve this result in many ways to no avail. If I try to combine PRODUCTS ORDERED with ORDERS I get an erroneous count. I finally resigned myself to getting all the info I needed with separate queries and then trying to combine them with a query of queries. This worked fine until the last query of queries which timed out with no results. I am a newbie and would appreciate any constructive help with this. I am including my queries below as well;
<cfquery name="qGetOrders" datasource="manna_premier">
SELECT Count(Orders.ID) AS CountOfID,
Orders.UserID AS Orders_UserID,
Users.UserID AS Users_UserID,
Users.TMName
FROM Users INNER JOIN Orders ON Users.[UserID] = Orders.[UserID]
GROUP BY Orders.UserID, Users.UserID, Users.TMName;
</cfquery>
<cfquery name="qGetSalesCalls" datasource="manna_premier">
SELECT Count(Sales_Calls.ID) AS CountOfID,
Users.UserID AS Users_UserID,
Users.TMName,
Sales_Calls.UserID AS Sales_Calls_UserID
FROM Users INNER JOIN Sales_Calls ON Users.[UserID] = Sales_Calls.[UserID]
GROUP BY Sales_Calls.UserID, Users.UserID, Users.TMName;
</cfquery>
<cfquery name="qGetProducts" datasource="manna_premier">
SELECT Count(ProductOrders.OrderID) AS CountOfOrderID,
Sum(ProductOrders.Quantity) AS SumOfQuantity,
Sum(ProductOrders.NewExisting) AS SumOfNewExisting,
ProductOrders.UserID
FROM Orders INNER JOIN ProductOrders ON Orders.[ID] = ProductOrders.[OrderID]
GROUP BY ProductOrders.UserID;
</cfquery>
<cfquery name="qqCombOrd_Prod" dbtype="query">
SELECT *
FROM qGetOrders, qGetProducts
</cfquery>
<cfquery name="qqCombOrd_ProdtoSales" dbtype="query">
SELECT *
FROM qqCombOrd_Prod, qGetSalesCalls
</cfquery>
PLEASE HELP!!! I'm about to go scouting for bridges to leap from!You might be able to simplify that query by getting rid of the subqueries. Something like this
SELECT TerritoryManager
, count(sc.userid) totalcalls
, sum(po.quantity) total
, sum(newexisting) totalnew
, count(o.userid) totalorders
from users u join salescalls sc on u.userid = sc.userid
join orders o on u.userid = o.userid
join productorders po on u.userid = po.userid
where userzone = 'CENTRAL' -
Can we combine this into one query, just curious
Dear all;
I have a query of the following form
select t.id, t.place from tbl_one t
where t.create_date < sysdateand
select t.id, t.place from tbl_one t
where t.create_date < sysdate + 28just curious, can those two queries be combined to one. Thank you. All help is appreciated.Is this a trick question? You could combine the two queries using AND / OR clause but it wouldn't really solve anything.
Lets look at each query.
SELECT t.id, t.place FROM tbl_one t WHERE t.create_date < sysdateThe above query would return all records whose create_date is older than sysdate (now).
SELECT t.id, t.place FROM tbl_one t WHERE t.create_date < sysdate OR t.create_date < sysdate + 28The above query would return all records whose create_date is older than sysdate (now) OR records whose create_date is older than sysdate (now) + 28 (or 28 increments in the future). These two queries are the same because if create_date is older than sysdate (now) by default it is older than any time future time. And since OR clause only requires one condition to be true sysdate+28 is unnecessary.
Similarly, we could combine the two queries using the AND clause.
SELECT t.id, t.place FROM tbl_one t WHERE t.create_date < sysdate AND t.create_date < sysdate + 28The above query would return all records whose create_date is older than sysdate AND older than sysdate+28. However, since the AND clause requires both conditions to be true, and since all sysdate +28 > sysdate the above query is equal to
SELECT t.id, t.place FROM tbl_one t WHERE t.create_date < sysdate + 28Basically you COULD combined the two select statements but it would be pointless -
How to disable result rows in Web for all characteristics?
Hi @ all,
i want to disable the results of all Characteristics in the Web Application.
In the Query Designer I defined that the results should ever show. Later, in the Web Application, I want to disable the results for all characteristics in one step
Ist there a possibility to do that?
Thanx for your answers.
Heikoyes - you can create a button./link that runs a URL command.
The command would use the SET_SUPPRESSION command in bw3.5
The command would be SET_RESULT_VISIBILITY in bw7.0.
for bw 3.5 - http://help.sap.com/saphelp_nw04/helpdata/en/86/27813b731fd60ee10000000a114084/frameset.htm
for bw 7.0 - http://help.sap.com/saphelp_nw70/helpdata/EN/43/d828d988ef05f6e10000000a11466f/frameset.htm -
All possible combinations of a column as applied to a unique entry?
i am having trouble getting a loop to do what i want, if you
can help me find out what i am doing wrong i would appreciate it:
i have a database with 3 tables in it
table 1 has a list of documents - each one having a primary
key
table 2 has a list of document properties, i will call them
property A, B, and C - each one having a primary key
table 3 is a "relational" table that has a column for a
document's PK and a property's PK that that document has
Example of table 3:
docPK / propPK
1 (Document 1) / 1 (A)
2 (Document 2) / 1 (B)
3 (Document 3) / 2 (B)
1 (Document 1) / 2 (B)
1 (Document 1) / 3 (C)
i need to create a loop in ColdFusion that spits out the
number of possible combinations that exist for each document
so the correct output should look like:
Property A
Document 1
Property B
Document 1
Document 2
Document 3
Property C
Document 3
Property A, Property B
Document 1
Proberty A, Property B, Property C
Document 1
this output displays all possible combinations of properties
under the conditions of existing documents
here is the loop i have so far that does not seem to be
working for me,
<cfoutput query="rsProperties">
<ul>
<cfloop from="0" to="# of properties per document"
index="i">
<li>
<cfoutput group="propPK">
<cfif i EQ "# of properties per document">
[#Trim(propertyName)#]
</cfif>
</cfoutput>
</li>
<ul>
<cfoutput group="docPK">
<li><a href="">#Document
Name#</a></li>
</cfoutput>
</ul>
</cfloop>
</ul>
</cfoutput>
my loop returns possible combinations, but it is not
returning ALL possible combinations, for example it may only return
Property A as a single instead of also returning singles Property B
and C
my query simply consists of a SELECT * FROM [the database]
WHERE [the three tables are set equal (as a join)] AND WHERE
[documents exist]
i know this is all rather confusing but if you can help me
make sense of it i will be grateful
thanks for your timeRead the cfoutput section of the cfml reference manual. If
you don't have one, the internet does.
Look for the example that shows you how to use the group
attribute. -
How to combine insert and where query ?
hi..
could somebody guide me how to combine insert and where query ?
insert into tdc_imarspc (ANUMBER,EMF_ID,PRODUCT) values ('1234567','65','ITFS')
where anumber not like '1234567';
Thank you,
BaharinHi, Baharin,
As Mahesh said, WHERE only works on a query.
You can always base a query on dual, like this:
INSERT INTO
tdc_imarspc (ANUMBER, EMF_ID, PRODUCT)
SELECT '1234567', '65', 'ITFS'
FROM dual
WHERE anumber NOT LIKE '1234567';Of course, you can use a literal, like '1234567' in both places where I used the bind variable, but if you're not using a variable, why would you want to?
You could also put all the literals in a sub-query (based on dual), and reference column names in the main WHERE clause, LIKE THIS:
INSERT INTO
tdc_imarspc ( ANUMBER, EMF_ID, PRODUCT)
WITH sub_q
AS (
SELECT '1234567' AS an, '65' AS ei, 'ITFS' AS pr
FROM dual
SELECT an, ei, pr
FROM sub_q
WHERE an NOT LIKE '1234567';
I assume you're not really saying
an NOT LIKE '1234567'If you're not using any wild cards after LIKE, you might as well use !=
an != '1234567' -
Bapi to create characteristics combination?
Hi all!
Anyone knows if there is any bapi to create characteristics combinations?
If there is not, i guess i´ll have to use a 'call transaction' with the old-fashioned batch input method.
Thanks everybody for reading.
wlundgrenNot sure if this answer helps you. I am going through the same process of identifying this and i found a way easier then using call transaction. Whey you use the transaction /SAPAPO/MC62 for the first time for a given master planning object structure it generates a program in the background. You can get the name of the program when you get the screen for creating the Charateristics combination ( looking up system status). You should be able to copy of this program and make the necessary modifications to suit your needs. THis is a good process when the CVC's are to be created interactively and a few at a time.
Another alternative is to use the BW process and load the data into a cube and use the cube to create charateristics combination. You can link all this activities uing a process chain ( a BW functionality). We have used this process extensively and works well when you have to create multiple charateristics combination in one go. Let me know if this helps and if you need more details we can discuss. -
No new characteristics combinations were loaded
Hi,
When I try to create CVC for Planning object structure from a Infocube i am getting message "No new characteristics combinations were loaded".
I checked the infocube, it contains data. I also cheked the datasource extraction in RSA3 transaction, it is also working fine.
What else we can check to resolve this issue.
thanks and regards
MruugesanHi Venkanta,
I am facing the same problem. I have created the 8 characteristics, 5 navigational attributes in MPOS. The same characteristics along with sales history is available in my infocube.
I uploaded the data from a flat file. It was successful. And available in infocube too.
I am facing problem while uploading the data from infocube to planing area. I used /SAPAPO/TSCUBE to upload the data. It's showing below warning message
" 53 combinations of infocube are not contained in the BasisPlObStru"
and below that it's displaying all the CVCs.
Then I tried to create the CVCs with /SAPAPO/MC62. I tried to create CVCs from the infocube. Based on my selection criteria it's showing number of hits = 53. But while executing it's showing "No new CVCs where created". I deleted old CVCs then tried again. Still the same story.
Note: While uploading the flat file data to infocube I used date format as YYYYWW(in flat file) and converted to WW.YYYY while uploading.
Please suggest, I am stuck.
Pratyusa -
How can I reduce the selection for the characteristics value in a BW query
Good morning,
I need to find out how I can reduce the selection for the characteristics values in a BW query.
In a BW query I have a characteristic "Due month".
The characteristic values shown in the query are from 01.2001->03.2007. I would like to reduce it to the last 2 years,in the query view, without deleting the data for the other years in the cube.
Do you know how this can be done?
Thank you in advance for your feedback.
Kind regards,
Linda Verding
Staff Consultant - CSChi,
First thing you have to do is check the report how the data is being restricted only to those months.
1) one it can be variable in which the code is written for that to populate for last few years.
or else it must have been hardcoded for these months.
Go into your report and underneath the characteristicsCALMONTH there must be an variable or hardcoding.
You need to change this here in the report.
You dont have to delete anything there.
Regards, Siva -
Combine two reports in query designer using key figure with sap exit
Hi experts,
i want to combine two reports in query designer using key figure with sap exit
in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
to calculate due and not due in two columns
in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
now i have requirement like this
not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
or
not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
thank youHi Dirk,
you perhaps know my requirement,
for the management to make used in one report,
we have in reporting finacials Ehp3.
Vendor Due Date Analysis - which show due, not due
Vendor Overdue Analysis - show only due and analysis in time grid frame
i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
krish... -
Hi all, how can i do a query precalculated
Hi all, how can i do a query precalculated step by step please, cause my client want some queries without wait 1 min, cause the query last about 5 min cause it shows like 40 InfoObjects of master data, now, i read about this queries precalculated and can help to execute it in the mourning, and when the client execute the query , it'll be ready to show the data, thanks all, i need this help and any other commentary please let me know, thanks
You need to create template and in the property of the template Data store, select precalculated. And following that if you are in 3.x you can use a reporting agent in resrep TC to schedule the query gets executed at specific time period, if you are in 7.0 then you can use broadcaster to schedule the time to fill the cache.
thanks.
Wond -
Printing all possible combinations of a given word.
Well I'm supposed to print all possible combinations of a given word(I'm writing this for the benefit of those who might not have guessed this from the subject). I've got some code but its horribly wrong. Could anyone point out any mistakes.
public class Try
public void display(String s)
char ch[]=s.toCharArray();
for(int i=0;i<ch.length;i++)
String word="";
word+=ch;
char c[]=new char[s.length()];
for(int j=0;j<ch.length;j++)
if(ch[j]!=ch[i])
c[j]=ch[j];
for(int j=0;j<ch.length;j++)
for(int k=0;k<ch.length;k++)
if(c[j]!=c[k])
word+=c[k];
word+=c[j];
System.out.println(word);Me and Lucifer have been workin on this program for ages.... we cant quite understand your pseudo code.. could you elaborate a bit more on how it works ??
Meanwhile this is the dysfunctional program weve managed to come up with so far:
public class SHAM
public void display(String s)
char c[]=s.toCharArray();
for(int i=0;i<c.length;i++)
String word="";
char c1[]=new char[c.length-1];
int a=0;
for(int l=0;l<c.length;l++)
if(i!=l)
c1[a++]=c[l];
for(int j=0;j<c.length-1;j++)
char c2[]=c1;
word=c[i]+word;
if(j+1!=c.length)
char t=c2[j];
c2[j]=c2[c2.length-1];
c2[c2.length-1]=t;
for(int k=0;k<c2.length;k++)
word+=c2[k];
System.out.println(word);
}And this is my coding of your pseudo code:
public class WordCombo2
public void combo(String s)
getCombos(s.toCharArray(), s.length());
private void getCombos(char[] c,int n)
if (n==1)
print(c);
System.out.println();
else
for (int i=0;i<c.length;i++)
if (i==0 && i<n)
c=c[n-1];
n--;
getCombos(c,n);
c[i]=c[n-1];
private void print(char c[])
for (int i=0;i<c.length;i++)
System.out.print(c[i]+" ");
I really dont understand how this is supposed to work so i dont know whats wrong :( Im sorry this program is just totally baffling me, and on top of that recursion kind of confuses me. -
All possible combinations of 23 columns in a table.
Hi,
We have a table as follows;
CREATE TABLE ALL_PROD_COMB_TMP
HDLM_ID NUMBER(10),
MULTIPATH_ID NUMBER(10),
TRUE_COPY_ID NUMBER(10),
UVM_ID NUMBER(10),
TUNING_ID NUMBER(10),
CLUSTER_ID NUMBER(10),
MIDDLEWARE_ID NUMBER(10),
TAPE_ID NUMBER(10),
THIRD_PARTY_ID NUMBER(10),
NAS_ID NUMBER(10),
HBA_ID NUMBER(10),
BCM_ID NUMBER(10),
VOLUME_MIGRATION_VERSION_ID NUMBER(10),
TIERED_STO_MGR_VERSION_ID NUMBER(10),
HDPS_ID NUMBER(10),
SERVER_ID NUMBER(10),
OS_ID NUMBER(10),
DWDM_ID NUMBER(10),
EXTENDER_ID NUMBER(10),
SWITCH_ID NUMBER(10),
INTERFACE_ID NUMBER(10),
HUR_ID NUMBER(10),
STORAGE_FAMILY_ID NUMBER(10)
The data in the table is as follows;
For formatting purpose the table data is shown in transposed form.
Serial No. Column Name Data Value
1 HDLM_ID 377 586
2 MULTIPATH_ID 142 357
3 TRUE_COPY_ID 1 87 12
4 UVM_ID 89 79
5 TUNING_ID 10 9 8
6 CLUSTER_ID 3 327 638
7 MIDDLEWARE_ID
8 TAPE_ID 3 47 54
9 THIRD_PARTY_ID 3
10 NAS_ID 12 91 1
11 HBA_ID 300 400
12 BCM_ID 14
13 VOLUME_MIGRATION_VERSION_ID 13 12
14 TIERED_STO_MGR_VERSION_ID 1 2
15 HDPS_ID 10 100
16 SERVER_ID 3 4
17 OS_ID 2 7
18 DWDM_ID 1
19 EXTENDER_ID 520
20 SWITCH_ID 4
21 INTERFACE_ID 2 1 3 4
22 HUR_ID 2 1 3 4 5
23 STORAGE_FAMILY_ID 2
Now we have another table named ALL_PROD_COMB having the same structure as that of ALL_PROD_COMB_TMP. In this ALL_PROD_COMB we need all the possible combinations of all the column values from ALL_PROD_COMB_TMP.
We tried the following thing;
insert into
all_prod_comb (
hdlm_id
,multipath_id
,true_copy_id
,uvm_id
,tuning_id
,cluster_id
,middleware_id
,tape_id
,third_party_id
,nas_id
,hba_id
,bcm_id
,volume_migration_version_id
,tiered_sto_mgr_version_id
,hdps_id
,server_id
,os_id
,dwdm_id
,extender_id
,switch_id
,interface_id
,hur_id
,storage_family_id
select distinct
a.hdlm_id
,b.multipath_id
,c.true_copy_id
,d.uvm_id
,e.tuning_id
,f.cluster_id
,g.middleware_id
,h.tape_id
,i.third_party_id
,j.nas_id
,k.hba_id
,l.bcm_id
,m.volume_migration_version_id
,n.tiered_sto_mgr_version_id
,o.hdps_id
,p.server_id
,q.os_id
,r.dwdm_id
,s.extender_id
,t.switch_id
,u.interface_id
,v.hur_id
,w.storage_family_id
from (select hdlm_id from all_prod_comb_tmp) a
,(select multipath_id from all_prod_comb_tmp) b
,(select true_copy_id from all_prod_comb_tmp) c
,(select uvm_id from all_prod_comb_tmp) d
,(select tuning_id from all_prod_comb_tmp) e
,(select cluster_id from all_prod_comb_tmp) f
,(select middleware_id from all_prod_comb_tmp) g
,(select tape_id from all_prod_comb_tmp) h
,(select third_party_id from all_prod_comb_tmp) i
,(select nas_id from all_prod_comb_tmp) j
,(select hba_id from all_prod_comb_tmp) k
,(select bcm_id from all_prod_comb_tmp) l
,(select volume_migration_version_id from all_prod_comb_tmp) m
,(select tiered_sto_mgr_version_id from all_prod_comb_tmp) n
,(select hdps_id from all_prod_comb_tmp) o
,(select server_id from all_prod_comb_tmp) p
,(select os_id from all_prod_comb_tmp) q
,(select dwdm_id from all_prod_comb_tmp) r
,(select extender_id from all_prod_comb_tmp) s
,(select switch_id from all_prod_comb_tmp) t
,(select interface_id from all_prod_comb_tmp) u
,(select hur_id from all_prod_comb_tmp) v
,(select storage_family_id from all_prod_comb_tmp) w;
But after looking at the explain plan we had to discard this. Simply not possible. Please help us with some other feasible solution.
regards,
Dipankar Kushari.Hi,
That's what I have written while posting. Cartesian is no way possible. But is there any way so that I can find out all possible combination of the following values which is there in a table.
1 HDLM_ID 377 586
2 MULTIPATH_ID 142 357
3 TRUE_COPY_ID 1 87 12
4 UVM_ID 89 79
5 TUNING_ID 10 9 8
6 CLUSTER_ID 3 327 638
7 MIDDLEWARE_ID
8 TAPE_ID 3 47 54
9 THIRD_PARTY_ID 3
10 NAS_ID 12 91 1
11 HBA_ID 300 400
12 BCM_ID 14
13 VOLUME_MIGRATION_VERSION_ID 13 12
14 TIERED_STO_MGR_VERSION_ID 1 2
15 HDPS_ID 10 100
16 SERVER_ID 3 4
17 OS_ID 2 7
18 DWDM_ID 1
19 EXTENDER_ID 520
20 SWITCH_ID 4
21 INTERFACE_ID 2 1 3 4
22 HUR_ID 2 1 3 4 5
23 STORAGE_FAMILY_ID 2
regards,
Dipankar. -
Fill Array with all possible combinations of 0/1
Hi,
i'm looking for a fast way to fill an array, respectively an int[8], with all possible combinations of 0 and 1 (or -1 and 1, shouldn't make a difference).
I kind of know how to do it using multiple loops but I assume there is a more elegant or at leaster "better" practice.
Thanks,
nikolaus
static int cnt = 0;
public static void main(String[] args) {
int[] element = new int[]{1,1,1,1,1,1,1,1};
Integer[] x = new Integer[2];
x[0] = 1;
x[1] = -1;
for(int i7:x){
element[7] = i7;
for(int i6:x){
element[6] = i6;
for(int i5:x){
element[5] = i5;
for(int i4:x){
element[4] = i4;
for(int i3:x){
element[3] = i3;
for(int i2:x){
element[2] = i2;
for(int i1:x){
element[1] = i1;
for(int i0:x){
element[0] = i0;
cnt++;
}Edited by: NikolausO on Oct 30, 2008 4:21 AM
Edited by: NikolausO on Oct 30, 2008 4:22 AMpm_kirkham wrote:
No I replied to message number 5. as the ' (In reply to #5 )' above my post indicates, which was in reply to (a reply) to Sabre150's post which wasn't using enhanced loops, nor has any obvious place where you could use that approach to fill the array.
Though you could pass in an array of the values to fill the array with, and loop over those, instead of using 0 or 1, at which point Sabre's approach becomes the same as your OP, but without the manual unrolling:
import java.util.Arrays;
public class NaryCombinations {
public interface CombinationHandler {
void apply (int[] combination) ;
public static void main(String[] args) {
calculateCombinations(new int[]{-1, 0, 1}, 4, new CombinationHandler () {
public void apply (int[] combination) {
System.out.println(Arrays.toString(combination));
public static void calculateCombinations (int[] values, int depth, CombinationHandler handler) {
recursivelyCalculateCombinations(values, 0, depth, handler, new int[depth]);
private static void recursivelyCalculateCombinations (int[] values, int index, int depth,
CombinationHandler handler, int[] combination) {
if (index == depth) {
handler.apply(combination);
} else {
for (int value : values) {
combination[index] = value;
recursivelyCalculateCombinations(values, index + 1, depth, handler, combination);
Which looks to use the same basic approach to the generalization I created shortly after posting the original.
public class Scratch1
* A 'callback' to be invoked with every combination
* of the result.
public interface Callback
* Invoked for each combination.
* <br>
* Each call is passed an new instance of the array.
* @param array the array containing a combination.
void processArray(int[] array);
public Scratch1(final int[] array, final Callback callback, final int... values)
if (callback == null)
throw new IllegalArgumentException("The 'callback' cannot be 'null'");
if (array.length < 1)
throw new IllegalArgumentException("The array length must be >= 1");
if ((values == null) || (values.length < 1))
throw new IllegalArgumentException("The 'values' must have be at least of length 2");
callback_ = callback;
values_ = values.clone();
array_ = array;
public Scratch1(final int order, final Callback callback, final int... values)
this(new int[order], callback, values);
* Generates every possible value and invokes the callback for each one.
public void process()
process(0);
* Internal method with no logical external use.
private void process(int n)
if (n == array_.length)
callback_.processArray(array_.clone());
else
for (int v : values_)
array_[n] = v;
process(n + 1);
private final Callback callback_;
private final int[] values_;
private final int[] array_;
public static void main(String[] args) throws Exception
final Callback callback = new Callback()
public void processArray(int[] array)
System.out.println(java.util.Arrays.toString(array));
new Scratch1(6, callback, 2, 1, 0).process(); -
Characteristics Combinations at FOREACH loops
Hi experts,
I can not use some characteristics combinations at FOREACH loops.
Sample situation is below ;
Planning area is multiple planning area.However, at this situation i gather data from just one cube, not another cubes.
*There is data at below combination in the related cube.
0FISCPER3 (Posting Period)
0FISCYEAR (Posting year)
ZVKBUR (Organizational Unit)
ZVKGRP (Sales Office)
ZMATNR (material number)
ZSS(Sales responsible)
and some other fields.
At first planning level selected characteristics are ;
0FISCPER3 (Posting Period)
0FISCYEAR (Posting year)
ZVKBUR (Organizational Unit)
ZVKGRP (Sales Office)
ZMATNR (material number)
at selection tab, a variable is used for ZVKGRP.
when i use this combination at foreach loop i can see data at lt_cur001 internal table during debugging.
At second planning level selected characteristics are ;
0FISCPER3 (Posting Period)
0FISCYEAR (Posting year)
ZVKBUR (Organizational Unit)
ZVKGRP (Sales Office)
ZSS(Sales responsible)
at selection tab, a variable is used for ZSS.
when i use this combination at foreach loop i can see data at lt_cur001 internal table during debugging.
However, at third combination i can not see any data at ZMATNR field.
0FISCPER3 (Posting Period)
0FISCYEAR (Posting year)
ZVKBUR (Organizational Unit)
ZVKGRP (Sales Office)
ZSS(Sales responsible)
ZMATNR (Material Number)
at selection tab, a variable is used for ZSS.And i added '#' into this variable's values.
when i use this combination at a foreach i cannot see any data at lt_cur001-zmatnr field of internal table during debugging.
What do you recommend me to read data at above combination from this cube?
Best Regards,
KevserThere is transactional data like below combination in my cube :
0fiscyear = 2007
0fiscper3 = 001
zvkbur = 1031
zvkgrp = 101
zmatnr = 000000000000150008
zss = 31301003
and the value 31301003 for ZSS exists within the values of variable ZSS.
Kevser
Maybe you are looking for
-
How to get current task ID in BPM
Hi guys, I have a requirement where I need to get the current active UWL task id in BPM context. I have seen the following code to create a direct execution url for a BPM task. // begin session IUWLSession uwlSession; uwlSession = uwlSer
-
I just downloaded I Tunes to my new computer. I had I Tunes on old computer. When I clicked on the icon on desktop I received the following pop-up. the file "I tunes Library .itl" cannot be read because it was created by a new version of i tunes.
-
Can i put powerpoint onto my mac pro?
Can I use powerpoint on the mac pro?
-
HT201210 error 1600.. how do i fix this?
My phone won't turn on and I tried restoring, but it wouldn't work. It says it has an error 1600, and i tried everything on the web but it doesnt help at all... Are there any other ways?
-
Can the SSD in a MBA 4,1 work in a MBA 3,1?
I was considering upgrading the SSD in a MBA 13 (late 2011) and using the stock SSD in a MBA 11 (late 2010). Any reason why this might not work - or should it work fine? Thanks.