How to extract R3 query with variant by datasource to BW
Hi,
I've created a query datasource, but this query is executed with a dinamic variant.
How can I extract the result of the query filtered with a variant by my datasource from R3 to BW?
thanks in advance.
i think u have missed it.
RSZCOMPDIR IS THE ONLY TABLE WHICH PROVIDES THE DATA.
ENTER TECHNICAL QUERY Name in RSZCOMPDIR-COMPID.
RSZCOMPDIR-TSTNAM gives you the user id of sap bw user who made the change.
RSZCOMPDIR-TSTPDAT gives you date on which change was made .
RSZCOMPDIR-TSTPTIM gives you timestamp on which change was made .
all users details can be obtained from TCODE SU01 where you need to enter sap user id.
You can also get user name( description) by using tcode SE09 and entering above sap user id.
Similar Messages
-
BEx query with variant from ABAP
Hello,
I'm looking for possibility to start BEx query with variant (variant is created with tx RSRT) from ABAP. There are some funktion modules, which start queries (launch excel), for example RSAH_LAUNCH_EXCEL or RSSEM_QUERY_LAUNCH, but they are ending with short dump, when there are variables in the query. Is there any standard FM, which starts the query with variant or accepts parameters?
regards,
KrzysztofHi,
the short dump was my fault, I've passed query name instead of genuniid to the RSAH_LAUNCH_EXCEL.
What I'm trying to do is to I'll start BEx query with parameters (I don't want to get selection-screen from the query, I need to fill it from ABAP).
Here is my example, which is not working.
DATA:
lv_query(30) TYPE c,
lv_genuniid TYPE rsrrepdir-genuniid,
ls_var TYPE rrx_var,
lt_var TYPE TABLE OF rrx_var.
lv_query = 'YB_MAKLER_DETAIL'.
CALL FUNCTION 'CONVERSION_EXIT_GENID_INPUT'
EXPORTING
input = lv_query
IMPORTING
output = lv_genuniid.
IF lv_genuniid = ''.
WRITE: / 'There is no Query', lv_query.
ELSE.
ls_var-vnam = 'YS_MKLE'.
ls_var-sign = 'I'.
ls_var-opt = 'EQ'.
ls_var-low = '0000005100'.
APPEND ls_var TO lt_var.
ls_var-vnam = 'YS_VTGJ'.
ls_var-sign = 'I'.
ls_var-opt = 'EQ'.
ls_var-low = '1999'.
APPEND ls_var TO lt_var.
CALL FUNCTION 'RSAH_LAUNCH_EXCEL'
EXPORTING
i_genuniid = lv_genuniid
I_OBJVERS = 'A'
i_hide_sapgui = 'X'
TABLES
I_T_VAR = lt_var.
ENDIF.
If parameter 'i_hide_sapgui' is empty, I'm getting empty selection-screen,
If parameter 'i_hide_sapgui' equals 'X' I'm getting selection-screen filled with values, which were used last time manualy, not with values from the internal table 'lt_var'.
Do you have any idea how to pass parameters to the query with this function module?
Regards,
Krzysztof -
How to create a table with varied number of columns?
I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
Can I do it? How? Thanka a lot.Why did you create a new thread for this?
How to create a table with varied number of columns? -
How to write sql query with many parameter in ireport
hai,
i'm a new user in ireport.how to write sql query with many parameters in ireport's report query?i already know to create a parameter like(select * from payment where entity=$P{entity}.
but i don't know to create query if more than 1 parameter.i also have parameter such as
$P{entity},$P{id},$P{ic}.please help me for this.
thanksYou are in the wrong place. The ireport support forum may be found here
http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=showcat&catid=9 -
How to create sap query with "or" relationship
dear experts,
I need a report to display the employee whoese WSR is
changed in the month for infotype 0007.
that is ,we want to search with selection
begda OR endda between 2008-01-01 and 2008-01-31.
how to create sap query with "or" relationship?hi use like this,
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = p_pernr
infty = '0007'
BEGDA = p_date1
ENDDA = p_date2
TABLES
infty_tab = itab .
hi use this by passing the pernr to fm and giving the dates low and high in the p_date1 and p_date2.
loop at itab where condition.
endloop.
may it helps u,
regards,
venkat. -
WAD: Execute query with variant
Hi,
I would like to create a web report so that for a web item to select a query with variant. Is it possible using WAD?
Or is there any parameter that could be used in the URL so that I can create directly the URL for this web report, without using WAD anymore?
Could you please give me some sugestions regarding this problem?
Thank you,
IulianaHI Iuliana,
Take a look at this post:
Re: Variant for a Web Report
Hope this helps... -
How to map a query with the Multiprovider?
Hello All,
Can any one please tell me how to map a query with a multiprovider?
Appreciate your help.
Regards,
Soumya.Hi,
Can you please elaborate , do you mean how to create a query with multiprovider. if that is your question it is very simple just create the query on the multiprovider.
What is the purpose for mapping the query with multiprovider -
Refresh BEx-Query with variant
Dear all,
i have a question about refreshing Queries with variants.
To refresh a BEx-Query (BW3.5) in a Workbook with VBA is no problem.
For example:
Run "SAPBEX.XLA!SAPBEXrefresh", False, myRange
But is there a possibilty to refresh a BEx-Query with a variant (also with VBA)?
My target is to create a VBA-Tool:
1 which user can select a single Query and the available variant.
2 Then push a VBA-Button
3 After the selection no Variable-Screen will pop-up
and the refreshing is completed.
Thanks allHi Ashok,
refreshing Queries automatically on Workbook open is standard...
What i need is to refresh a Query with variant (saved variable-values for a query e.g. the name of the variant is "ZMYVARIABLES").
The user should not select an existing variant (ZMYVARIABLES)
manually with Shift+F5 (Get Variant) on the Query-Variable POPUP-Screen.
What i need is a codefragment which implement that all.
Pseudo code:
Sub RefreshQuery(QueryID As String, Variantname As String)
End Sub
Thanks,
Erol -
Hello!
I need to execute a BW-query from an Abap-report.
I tried it already with function module 'RRW3_GET_QUERY_VIEW_DATA' and with classes / objects 'CL_RSR_REQUEST' resp. 'CL_RSR_DATA', but:
I want to use the query with a variant, which could be found in table RSRPARAMETRIZA.
(Btw: even with a variant in table RSRVARIANTDIR I don't get the results wanted...)
Is there a direct way to call a BW-query with a variant from Abap?
Alternatively: How do I get the variant-contents? Is there a 'universal' way to work with both kinds of variants? (RSRVARIANTDIR / RSRPARAMETRIZA)
Thanks in advance.Thanks for the link.
Well, I already read that document and I followed the links to the former blogs on this subject.
But this solution doesn't work for me: CL_RSR_QUERY_VARIABLES is unknown.
I read the pdf and the function-module-code, but I still don't have an idea how to work with query- variants . The example-coding includes a line
DATA: wf_variant TYPE variant .
but that's not used, or is it?
(I don't have a set of variables and conditions, but just a variant-name. The variant will be created by other people, who would start my report.)
Greetings -
How to build this query with the minumum number of sub-selects?
The question I am trying to answer is analogous to this:
Give me all projects that: (have no employees assigned and are small) or (have only employees with the the last name = "Smith")
Thanks,
RomanThank you :
1- I am in 9.0.4.8 version and can not use allOf expression (availible in beta version)
2- I not find .notIn(subQuery) operator in 9.0.4.8 version and i replace it by .in(subQuery).not() !
My new query retrieve Customer who have 0 (zéro) Orders !
How to retrieve only customer (with orders + with orders without "television") ?
My new query is :
<div align="left" class="java">
<font color="#7f0055"><b>static </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">findCustNoComputer </font><font color="#000000">(){</font>
<font color="#ffffff"> </font><font color="#000000">ClientSession cs = TopLinkSession.acquireClientSession</font><font color="#000000">()</font><font color="#000000">;</font>
<font color="#ffffff"></font>
<font color="#ffffff"></font>
<font color="#ffffff"> </font><font color="#000000">ReadAllQuery query = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReadAllQuery</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">ExpressionBuilder queryBuilder = query.getExpressionBuilder</font><font color="#000000">()</font><font color="#000000">;</font>
<font color="#ffffff"></font>
<font color="#ffffff"> </font><font color="#000000">ExpressionBuilder subqueryBuilder = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ExpressionBuilder</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">ReportQuery subQuery = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReportQuery</font><font color="#000000">(</font><font color="#000000">Customer.class, subqueryBuilder</font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">subQuery.addAttribute</font><font color="#000000">(</font><font color="#2a00ff">"id"</font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">subQuery.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">subqueryBuilder.anyOf</font><font color="#000000">(</font><font color="#2a00ff">"Orders"</font><font color="#000000">)</font><font color="#000000">.anyOf</font><font color="#000000">(</font><font color="#2a00ff">"OrderItems"</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">"product"</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">"productName"</font><font color="#000000">)</font><font color="#000000">.equal</font><font color="#000000">(</font><font color="#2a00ff">"Computer"</font><font color="#000000">))</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">query.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">queryBuilder.get</font><font color="#000000">(</font><font color="#2a00ff">"id"</font><font color="#000000">)</font><font color="#000000">.in</font><font color="#000000">(</font><font color="#000000">subQuery</font><font color="#000000">)</font><font color="#000000">.not</font><font color="#000000">())</font><font color="#000000">;</font>
<font color="#ffffff"></font>
<font color="#ffffff"> </font><font color="#000000">Vector allCustomers = </font><font color="#000000">(</font><font color="#000000">Vector</font><font color="#000000">)</font><font color="#000000">cs.executeQuery</font><font color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">Iterator allCustomersIterator = allCustomers.iterator</font><font color="#000000">()</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#7f0055"><b>while </b></font><font color="#000000">(</font><font color="#000000">allCustomersIterator.hasNext</font><font color="#000000">()) </font>
<font color="#ffffff"> </font><font color="#000000">{</font>
<font color="#ffffff"> </font><font color="#000000">Customer tempCustomer = </font><font color="#000000">(</font><font color="#000000">Customer</font><font color="#000000">)</font><font color="#000000">allCustomersIterator.next</font><font color="#000000">()</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#000000">tempCustomer</font><font color="#000000">)</font><font color="#000000">;</font>
<font color="#ffffff"> </font><font color="#000000">}</font>
<font color="#ffffff"> </font><font color="#000000">cs.release</font><font color="#000000">()</font><font color="#000000">;</font>
<font color="#000000">}</font>
<font color="#ffffff"></font>
<font color="#ffffff"></font>
Sql of query :
SELECT
t0.CUST_LAST_NAME, t0.CUST_FIRST_NAME, t0.CREDIT_LIMIT, t0.CUST_EMAIL, t0.CUSTOMER_ID, t0.PHONE_NUMBER2, t0.PHONE_NUMBER1, t0.CUST_STREET_ADDRESS1, t0.CUST_CITY, t0.CUST_STREET_ADDRESS2, t0.CUST_STATE, t0.CUST_POSTAL_CODE
FROM TL_CUSTOMER t0
WHERE NOT (
(t0.CUSTOMER_ID IN
(SELECT DISTINCT t1.CUSTOMER_ID
FROM TL_CUSTOMER_ORDER t4, TL_ORDER_ITEM t3, TL_PRODUCT t2, TL_CUSTOMER t1
WHERE (
(t2.PRODUCT_NAME = ?) AND
((t2.PRODUCT_ID = t3.PRODUCT_ID) AND
((t3.ORDER_ID = t4.ORDER_ID) AND (t4.CUSTOMER_ID = t1.CUSTOMER_ID)))))))
Regards -
Extract Sql Query with Actual Parameters from Report
Hi
I am able to extract query from Crystal Report using the following code :
ReportDocument.ReportClientDocument.RowSetController.GetSqlStatement(new GroupPath, out tmp);
But the sql query retrieve comes in the following format :
select name , trans_code, account_code from command_query.accounts
where account_code = {?Command_query_Prompt0} and effective_date < '{?Command_query_prompt1 }'
The parameters which I m using in the reports are :
Account_Code and Effective_Date .
Why does my extracted sql translates it into {?Command_query_Prompt0} and '{?Command_query_prompt1 }' .
Is there any way to map this to the actual parameter values ?
OR
Can we extract the query after assigning the values ?
Any help is appreciated ...
Thanks
Sanchethi,
You can create nested sql query with conditional parameters,
For example
Select Code From OITT Where Code IN (Select ItemCode From OITM
Where ItemName LIKE '[%0]' + '%%')
Edited by: Jeyakanthan A on Jun 9, 2009 12:31 PM -
How to force readObejct query with PK value to go to DB?
The default behaviour for read-object queries with a PK value is to use the cache and not go to the database. How can we change this behaviour?
We have cases that a row was deleted by some other process not through toplink, but the corresponding object still in the cache and if you use the readObject query with PK value, the object will be returned as result.
Thanks in advance,There are several mechanisms to disable caching in TopLink. Note that disabling caching will affect your performance.
In 9.0.4 you can use:
- You can configure you cache type to use a WeakIdentityMap to ensure that only referenced objects are cached.
- On descriptor you can call disableCacheHits() and alwaysRefreshCache() in code or click these options on the Caching/Identity tab in the Mapping Workbench.
- Or to explicitly remove a deleted object from the cache uses session.removeFromIdentityMap(), but you must ensure there are no other objects referencing it.
In 10.1.3 you can also use:
- On descriptor you can call setIsIsolated(true) in code, or select isolated in the Caching tab in the Mapping Workbench.
- Alternatively you can set a CacheInvalidationPolicy on your descriptor to ensure objects are not cached for longer than a specified time, or invalidated daily.
- Or to explicitly invalidate a deleted object use, session.getIdentityMapAccessor().invalidateObject() -
How to Transpose the Query with following result
Dear All,
Can anyone tell me a method of transposing my result of the following query
Details can be found at
http://obiee11ge.blogspot.com/2010/07/how-to-transpose-query-with-following.html
Regards
MustafaHi,
Try this
Create a combined request with,
criteria 1 : Dummy, Revenue (Actual),Cogs(Actual), Opex(Actual), PL(Actual)
in the dummy column fx enter the value as 'Actual'
criteria 2 : Dummy, Revenue (Yago),Cogs(YAgo), Opex(Yago), PL(Yago)
in the dummy column fx enter the value as 'Yago'
criteria 3 : Dummy,Revenue (Budget),Cogs(Budget), Opex(Budget), PL(Budget)
in the dummy column fx enter the value as 'Budget'
Now go to the result columns and set the coumn names (Revenue, Cogs, Opex, PL) for the result set.
For the Dumny remove the column heading.
In table view you will get the result.
Thanks,
Vino -
How to create the query with multiple node types
Hi,
I am having an issue in creating a query to search multiple node types.
The requirement is to query documents/pages of the type dam:Asset and cq:Page present under a path.
I tried the following code snippet with no luck .
path=/content
1_type=cq:Page
2_type=dam:Asset
property=jcr:content/metadata/@cq:tags
property.1_value=<tag Name>
I was able to write a query with single type. However i could not find any documents/ materials with multipe types as shown above.
Thanks in advance.
Regards
SudhiI don't think multiple type is possible. Instead use super type like nt:base that will cover both page and asset.
Yogesh
www.wemblog.com -
How to extract data from this Variant?
Hi All,
I hope someone could help me in solving this problem.
I have a VARIANT variable named "num". I know that it contains an array of strings. By using the command:
type = CA_VariantGetType(&num);
I obtain type=4211, that should correspond to an array of BSTR.
However, if I add "num" to "watch expression", I get "value={VT_BSTR | VT_ARRAY}" and the bitwise OR is 8200.
Now my questions are:
1- is it possible to see this array directly from the watch expression?
2- how can I extract this array of strings from the VARIANT?
This is really becoming challenging for me...
Regards and thanks for the attention
FrancescoYou're right, maybe it won't work with an array of BSTR.
In this case I think we have to options since in LabWindows/CVI we have the possibility to store an array of BSTR as a pointer using the function CA_VariantSetBSTRPtr () but we can also store it as an array using the function CA_VariantSet1DArray ().
You can know which of them was used to create your variant by using the function CA_VariantHasPtr () that returns TRUE only if the variant was created using CA_VariantSetBSTRPtr () and you can use CA_VariantHasArray () that returns TRUE if the variant was created using the CA_VariantSet1DArray ().
Once you know how your variant was created you can convert it to the array of BSTR using the function CA_VariantGetBSTRPtr() or CA_VariantGet1DArray().
I created a little project and tested this functions.
As you can see, the code creates an array of BSTR strings and store them in two different variants using both the ways I explained and then convert the variant back to two array of strings (they are pointers actually) and take the first string of both pointer that can be seen into the watch-expression window.
Here you have the code:
size_t numberOfElements;
BSTR *myNEWBSTRArray;
BSTR *myNEWBSTRPointer;
HRESULT variantHasPointer;
HRESULT variantHasArray;
unsigned int variantTypeBSTRPointer;
unsigned int variantTypeBSTRArray;
BSTR myBSTR[3];
VARIANT myVariantBSTRPointer;
VARIANT myVariantBSTRArray;
char *ptrString;
char *arrayString;
BSTR firstOfPtr, firstOfArray ;
//Allocate Variants
myVariantBSTRPointer = CA_VariantEmpty ();
myVariantBSTRArray = CA_VariantEmpty ();
//Create the array of BSTR strings
myBSTR[0] = SysAllocString(L"I am a happy BSTR");
myBSTR[1] = SysAllocString(L"I am another happy BSTR");
myBSTR[2] = SysAllocString(L"I am one more happy BSTR");
//FIRST WAY: Convert the BSTR array to a BSTR pointer variant
CA_VariantSetBSTRPtr (&myVariantBSTRPointer, myBSTR);
//Get the variant type
variantTypeBSTRPointer = CA_VariantGetType (&myVariantBSTRPointer);
//this is true since the variant was created as BSTRPtr
variantHasPointer = CA_VariantHasPtr (&myVariantBSTRPointer);
// Retrieve the BSTR array as a new BSTR pointer
CA_VariantGetBSTRPtr (&myVariantBSTRPointer, &myNEWBSTRPointer);
//Take the first BSTR string stored in this array
firstOfPtr = myNEWBSTRPointer[0];
//SECOND WAY: Convert the BSTR array to a 1D array of BSTR variant
CA_VariantSet1DArray (&myVariantBSTRArray, CAVT_BSTR, 3, myBSTR);
//Get the variant type
variantTypeBSTRArray = CA_VariantGetType (&myVariantBSTRArray);
//this is true because this second variant was created as 1DArray
variantHasArray = CA_VariantHasArray (&myVariantBSTRArray);
//Retrieve the BSTR array as 1DArray.
//NOTE: myNEWBSTRArray is a BSTR* just like myNEWBSTRPointer variable was.
CA_VariantGet1DArray (&myVariantBSTRArray, CAVT_BSTR, &myNEWBSTRArray, &numberOfElements);
//Take the first BSTR string stored in this array
firstOfArray = myNEWBSTRArray[0];
//Convert the two BSTR strings to C-Strings that can be seen into the watch-expression
CA_BSTRGetCString (firstOfArray, &arrayString);
CA_BSTRGetCString (firstOfPtr, &ptrString);
Let me know if it helps
Best Regards
Luca Gallo
Application Engineer
National Instruments Italy
Maybe you are looking for
-
Automatic export/import of ESR object
HI. I want to automate export/import of ESR object. How can I do? 1)export the ESR object on development system (automatic import to QA sysytem) 2)activate the chang list on QAS regards,
-
MC-4 Controller Not Working with LabView
I have a Klinger MC-4 Motor Controller and am trying to control it with LabView. I have thus far not been able to get the motor to move with the driver that I downloaded from this website. If anybody has written anything for this same purpose, I woul
-
IPod touch 4g won't connect to home network
I got my iPod two weeks ago and from day 1 I've had trouble with connecting it to my home network. Whenever I tried to press on my home network 2WIRE049, and enter the WEP code it would just do nothing. It never connects. Even though I have entered m
-
Classcast exceptions when persistence units deployed as shared libraries
Hi We are using weblogic 10.3.3 & eclipse link 2.0 persistent units: We have uim-entities.jar(persistent unit) under uim-core-lib.ear(/APP-INF/lib) that is deployed as a shared library. We have multiple applications(ears) referring to this shared lib
-
Time Machine is not copying new files to new drive
I was just searching thru my TM to restore some old files and realise that my TM has not been backing up new files after a certain date. After much pondering, I realise that was when I changed my old TM drive to a larger drive. I copied all my old b