Query with variant from ABAP
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
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 -
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... -
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 -
Open an IE browser with link from ABAP code
How to open an IE browser in separate window with dynamic link from ABAP code. The IE should open in a separate window.
Eg:
strHttpLink = 'http://www.xxss.com'.
open IE browser using strHttpLink.Hi,
have a look at this:
http://www.erpgenie.com/abap/controls/htmlviewer.htm
Best regards. -
Set value in af:query with value from method
hello all
i have problem, when they want set value in af:query (inputText) with value from method, how to do that?
anyone help..?
thx
agungdmtHi,
are you facing this issue when you try to show few values on right side (selected list) of shuttle component.
what is your usecase exactly ? -
Problem using webservice method consumer proxy with rawdata from abap
Hello Gurus,
I am struggling with an error using a proxy consumer service from ABAP. The proxy was generated using the WSDL from the web service provider. For a specific method we need to send a rawstring as seen bellow:
The file to be sent on this call is a ZIP file XAdES-BES signed and on BASE64. I’ve implemented the proper code to get the original file from local PC, and convert it to BASE64 before moving the content to the webservice structure and call the service proxy. At SOAMANAGER I also configured the webservice and the proper port with the WSDL:
The communication is working properly but my problem is with the binary content. When calling the webservice the response is that the structure of the file is wrong. I found it very strange since I used a tiny SOAPUI project with the same WSDL and it worked with no problem.
After debugging I could see that the content moved to the rawdata string before calling the proxy does not match the content that I can see from the call payload on web services util (srt_util)!
So the sample code for my method:
* get the file from the specified folder
call function 'GUI_UPLOAD'
exporting
filename = ld_zipfilename
filetype = 'BIN'
importing
filelength = zip_size
tables
data_tab = t_zip_data[]
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
* convert to string
clear buffer_zip.
call function 'SCMS_BINARY_TO_STRING'
exporting
input_length = zip_size
importing
text_buffer = buffer_string
tables
binary_tab = t_zip_data[]
exceptions
failed = 1
others = 2.
* encode base 64
perform encode_base64 using buffer_string
buffer_zip.
form encode_base64 using in_string type string
out_string type xstring.
data: l_sbuff type string.
* convert the file to BASE64
call method cl_http_utility=>encode_base64
exporting
unencoded = in_string
receiving
encoded = l_sbuff.
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = l_sbuff
importing
buffer = out_string
exceptions
failed = 1
others = 2.
endform. "encode_base64
calling the webservice:
l_input-xxxx-dokument = buffer_zip.
try.
call method l_proxy_test->webservice
exporting
input = l_input
importing
output = l_output.
catch cx_ai_soap_fault into lr_exc_soap_fault.
endtry.
From my understanding rawstring should be the same as ABAP xstring. If I debug the program and check the content of the l_input-dokument before calling the proxy I get binary content: “Izw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi04Ij8…” that is in fact correct
If I check the payload after call I can see that the binary content sent on the XML is not the same, in fact it is totally different: ”SXp3L2VHMXNJSFpsY25OcGIyNDlJakV1TUNJZ1pXNWpiMlJw…” !!
I’ve tried a lot of different conversions, changed configuration on the communication, port, etc and nothing seems to work. I really can’t figure out why the binary content on the call is not the same as I move to the webservice structure.
If I use the project from SOAP UI and send the proper binary content, that is “Izw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi04Ij8…” it works perfectly and the response is successfully.
Anyone has a clue what could be causing this?
Appreciate any kind of input.
Regards,
João Silva Pinto.Anyone? Any clue would be appreciated.
-
Parametrized query with output from sql
Hey all,
has anyone figure out how to use the database connectivity toolset to perform a parameterized query with outputs (SQL)? From the other threads that i have read it would seem that this issue is not resolved. The error i get is:
Error -2147467259 occurred at Cmd Execute.vi->getjobID.vi
Possible reason(s):
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [MySQL][ODBC 3.51 Driver][mysqld-5.0.50sp1a-enterprise-gpl-log]OUT or INOUT argument 3 for routine eln.lv_caperJob_create is not a variable or NEW pseudo-variable in BEFORE trigger in Rec Create - Command.vi->Cmd Execute.vi->getjobID.vi
However, In Toad for mysql the following call works:
set @outJobID=-999;
set @outMsg="";
call lv_caperJob_create('TestJune30_2', '207', @outJobID, @outMsg);
select @outJobID, @outMsg
Attached is the LV code i am using. Thanks!
Attachments:
db code.JPG 50 KBYour first approach gave you an error because it took the ? parameter inside the '%?%' string and treated it as whole string as '%?%'. As you set the parameter, it did not understood where it need to insert the parameter.
Your second approach is pretty much OK, only problem is you are trying to set the parameter with a string and aging creating the string while setting the parameter.
The solution will be to create the whole string before setting the parameter and set the created String as parameter on the query something like this.
String parameter = "%"+searchString+"%";
Then set the parameter string to the query.
Thanks -
Exctract signatures from PDF with ADS from ABAP
Hello
we have a PDF signed document in ABAP system, we use the Adobe document services and use the Abap object method
if_fp_pdf_object-get_signatures to excract the signature data from an abap program.
The call to adobe document service return the sirnature parsed and only return the next data:
Field Name SFLY Signature 0
Status Cannot check signature
Signatory trustedx-demos
Date and Time Wed Feb 09 2011 07:30:27 GMT+0100 (CET)
Location
Information About Contact
Legal Attestations
Rights (See Interface IF_FP_PDF_SECURITY_PERMISSIONS) All
Reason null
Version 1
Highest Version Still Valid for This Version 1
we need exctract the complete pkcs7 object from the adobe document, not only the parsed data of the signature.
Is there any way to do this from an abap program ????
thanks
regardsHi,
Thanks for the answer, but don't solve our problem, with the method GET_SIGNATURE que ADS return us an xml with the signature data like status of the signature, date, etc.. but we need extract from the pdf objet the complete pkcs7 object.
I supose that ADS internally can do this to extract the signature data, bur the problem is that i don't know if ADS expose this funcionality externally to be called from ABAP system.
Thanks
best Regards
diego -
Query with 'different from' clause in Sqlite
My question is very simple:
How can I submit a query with a 'different from' clause into a table.
In AIR, I would like to query :
"select * from myTable where myField <> 'value' ";
but it does'nt work !
Nor
"select * from myTable where myField != 'value' ";
nor
"select * from myTable where myField is not 'value' ";
is it impossible to query with a 'different from' clause in Sqlite wih Adobe AirHello,
SQLite in AIR does support 'different from' and '<>' is the correct operator. Take the following emp table for example:
id
name
age
1
A
26
2
B
30
3
C
28
If you want to query the records whose name isn't A. The following SQL is correct:
select * from emp where name <> 'A'
Thanks,
Yang -
Query with Tables from another Database
Hi.
I have a problem with a Query that executes a stored procedure that inserts data in a Table from another DataBase. The problem is when I try to execute a Query with the data related of that table using the user parameters of SBO ('[%0]'....'[%3]'). I use the following parameters for reference to the Table:
"....FROM [-BDName-].[dbo].[-TableName-] T1..... "
Any suggestions? Thanks a lot....
(Suggestions in English or Spanish)None
-
Print html file with barcode from abap report
hi
i am printing html file from abap program using gui_execute.
i am using netscape.exe , its printing first time and when reprint its not working
basically html file contains gif file which has fedex barcode.
could you please let me know how to print html file from reportDGU wrote:
where to check RAW or TEXT? the print report vi only asks for file name and printer name.
When I print from notepad, everything just goes by default. This is a label printer, so I never need to specify printing parameter such as size, orientation, etc in the past
Famous last words go something like this: "...never had to do that before." Maybe you have to do that now. It's worth at least comparing the defaults settings for bothe generic drivers. It could save you a lot of headache if you notice something different.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How i can acces to web ( with login) from abap program?
Hello.
I need to acces to web that have user/password from abap program. Is there any function to do this?
And, is it possible, to do this in background process?
Regards.
Antonio.Hi Antonio,
Yes this is possible. Check out class cl_http_client, particularly method IF_HTTP_CLIENT~AUTHENTICATE in which you can provide the user credentials. Here's some example code:
DATA: client TYPE REF TO if_http_client,
l_url TYPE string,
l_content TYPE string.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = l_url
IMPORTING
client = client
EXCEPTIONS
OTHERS = 1.
client->request->set_header_field( name = '~request_method'
value = 'GET' ). "#EC *
CALL METHOD client->authenticate
EXPORTING
* proxy_authentication = ' '
* client =
username = 'user'
password = 'password'
* language =
****Make the call
client->send( ).
****Receive the Response Object
CALL METHOD client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 4.
****Get the response content in Character format
l_content = client->response->get_cdata( ).
Hope this helps you!
Cheers, Roel -
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. -
SOAP call with attachment from ABAP
Dear ABAP guru's
We have a requirement to trigger a SOAP call from the ABAP stack. We have used the instructions from SAP as specified in the SAP help as specified in this link:
http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/frameset.htm
This works fine. However, we would like to send an attachment with the call and don't see a method available for this. Is there anybody who knows how to achieve this?
Thanks a lot in advance,
Rudy ClaassenDear ABAP guru's
We have a requirement to trigger a SOAP call from the ABAP stack. We have used the instructions from SAP as specified in the SAP help as specified in this link:
http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/frameset.htm
This works fine. However, we would like to send an attachment with the call and don't see a method available for this. Is there anybody who knows how to achieve this?
Thanks a lot in advance,
Rudy Claassen
Maybe you are looking for
-
How to display the week of the year in a report
Hi, I am doing a report, that needs to break down the information, according to month and then week. The week of the year isn't stored anywhere in the database, so i guess it would have to be calculated. How would i go about doing this in report?
-
Internet Explorer has no place for me to hit "print". What do I do?
On my Internet Explorer, I have no place to hit "print". Even when I right click, there's no choice for "print". What's my problem? I am not computer literate, so please instruct me in "everyday" language. Thank you.
-
[JClient 9.0.3] Trapping events and canceling actions
Subject: [JClient 9.0.3] Trapping events and canceling actions I'd like to be able to, based on some condition, abort certain actions (navigate, delete, insert, etc, etc) when the appropriate events have been fired. E.g., in case the Transaction is d
-
Updating TABLEA based on values in TABLEB
Hi: I have the two following tables. I want to write a query which updates fields in TABLE1 based on certain values in TABLE2 1. Update SEVERITY in TABLE1 with SVRT_CD in TABLE2 for all TABLE1.INCIDENT = TABLE2.TKT_NBR 2. Update ESCALATION in TABLE1
-
Itunes keeps saying wrong password
itunes keeps saying wrong password. Works OK in iCloud. Reset password and still won't work.