Fire Joint Query using JCO

Hi All,
I am using JCO Connection from a Webdypro Java Application to access the ERP backend, and fetch all the vendors for a particular Purchasing Organization.
I am using the FM RFC_READ_TABLE. But I have to pick data from 2 tables here LFA1 and LFM1, as one contains vendor details and one contains Vendor - Purchasing Organization Mapping. Can I use RFC_READ_TABLE to fetch data from both these table using a single Joint query. Tried but getting exceptions while executing the functions.
First fetching all the related vendors from LFM1, and adding these vendor IDs to the query on LFA1 worked. But it seems I cant add more than 900 vendor ids to the query. And customer is targetting more than 1000.
When I added more than 900 vendor ids to the query, I get the following exception
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in module RSQL of the database interface.#
So can you help me here with any kind of solution,
1) Is it possible to fire a joint query with both these tables involved, through JCO.
or 2) is there anyway to avoid the exception mentioned above and add more than 900 vendor ids to the query.
Regards,
Prakash

HI Lavanya,
Do you think this is due to time out issues.
Because so far, in my system and as well as customer's system we havent faced any timeout issues.
When I didnt pass any search parameters to the query I was still able to retreieve all the records in the table, without any timeout exceptions (though there were performance issues).
When I went through other forums, they said this particular exception occurs when they had used more than 900(approx) parameters in the query (IN Parameters).
My query goes like this.
Select Field1, Field2 from LFA1 where Field0 = '1' or field0 ='2' or field0='3'.... or field0 = '900' .
Saravanan had suggested to create a BAPI which does this Joint query stuff in the backend itself. But since customer is going live in a week approving any development in the backend is not possible now.
So is there any work around to get through this exception, or is there any other RFC already available that can take in joint queries.
Regards,
Prakash

Similar Messages

  • How to fire the query: "IsuOrderItemQuery"

    Hi Experts,
                          I am trying to fire the query "IsuOrderItemQuery" by giving the BUPA_NUMBER as the input value. For this I have used the method CL_CRM_BOL_QUERY_SERVICE->GET_QUERY_RESULT but i am not able to get the result and i am not able to get any child relations. When I look from BOL browser for the same orderitemquery by giving the BP it is working fine. Can anybody throw some light on this issue to read the childnodes by triggering the "IsuOrderItemQuey".
    Contributions will be highly rewared. Thanks
    Regards,
    Lakshmana.P

    ls_parameter  TYPE crmt_name_value_pair,
    lt_parameter  TYPE crmt_name_value_pair_tab,
    query_items   TYPE REF TO cl_crm_iu_order_item_query,
    col_items     TYPE REF TO if_bol_bo_col,
    TRY.
    CREATE OBJECT query_items
    EXPORTING
    iv_query_name = 'IsuOrderItemQuery'.
    CATCH cx_crm_unsupported_object.      "#EC NO_HANDLER
    ENDTRY.
    IF query_items IS BOUND.
    ls_parameter-name  = 'CA_NUMBER'.         "#EC NOTEXT
    ls_parameter-value = ''.
    APPEND ls_parameter TO lt_parameter.
    ls_parameter-name  = 'ISU_CONTRACT_NR'.         "#EC NOTEXT
    ls_parameter-value = '55000001'.
    APPEND ls_parameter TO lt_parameter.
    query_items->set_query_parameters( it_parameters = lt_parameter ).
    col_items = query_items->get_query_result( ).

  • Can I fire CONTAINS Query on BFILE

    Hi friends,
    I am trying to use BFILE in my application to store the txt and doc file . I created the table set the directory and granted the permission as well as created the index till now all smooth, however when i fire CONTAINS query it does not give me any result. It does not show any error but it is not fetching me the results as well ..
    Following are the steps :
    CREATE TABLE my_doc ( id NUMBER, file_name VARCHAR2(255), upload_date VARCHAR2(10), filesize VARCHAR2(20), mime VARCHAR2(50),
    content BFILE, CONSTRAINT doc_pk PRIMARY KEY (id));
    CREATE OR REPLACE DIRECTORY documents AS '/usr/local/Test';
    grant
    CREATE INDEX my_doc_idx ON my_doc(content) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SYNC ( ON COMMIT)');
    INSERT INTO my_doc values(100, 'TestFile', '123','25', 'mime', BFILENAME('DOKUMENTE','New Text Document.txt'));
    INSERT INTO my_doc values(10, 'TestFile', '123','25', 'mime', BFILENAME('DOKUMENTE','Document.txt'));
    SELECT SCORE(1), file_name, filesize FROM my_doc WHERE CONTAINS(content,'INDEX', 1) > 0 ;
    SELECT SCORE(1), file_name, filesize FROM my_doc WHERE CONTAINS(content,'%I%', 1) > 0 ;
    Final TWO queries not showing any output
    Please help !!!!!!!

    Did you re-sync the index after the insert?

  • How  to fire a query for every record in a table, pass values in a loop

    Hi,
    For each record in a table, I want to loop through each record and then fire a query by passing acct, product and date from this table to the where clause of the query. I would have to create a pl/sql block..The output of the query I want to spool from sql developer.
    I need the exact syntax please for doing this.. since i am new to Oracle. Just the template will be enough. I will fill in the query.
    Any help is appreciated as always..
    Regards,
    hena

    904385 wrote:
    Hi,
    For each record in a table, I want to loop through each record and then fire a query by passing acct, product and date from this table to the where clause of the query. I would have to create a pl/sql block..The output of the query I want to spool from sql developer.
    I need the exact syntax please for doing this.. since i am new to Oracle. Just the template will be enough. I will fill in the query.
    Any help is appreciated as always..
    Regards,
    henaHave you ever considered using a JOIN ? It does the same thing as looping through a table and applying that to the where clause of a select on a query, only much, much, much faster and without the need to write any code. SQL is a declarative language, so you specify what you want and not how to do it. It can be bit of a journey to change your thought process if you come from a procedural or object world, but once you get there it's a beautiful view.

  • Update Query using Toplink

    I would like to fire an update query using Toplink mapping objects. The
    structure of the Query would be like
    update <<table name>>
    set <<col name A>> = 'Y'
    where <<col name B>> in (<<valA>>,<<valB>>............);
    ValA, ValB.... are dynamic values passed from my front end Java App
    Can anyone help me in this regard...........
    Thanks
    Karthik

    Karthik,
    This is new functionality added in 10.1.3. You will want to look at UpdateAllQuery.
    Doug

  • ABAP query using logical database KDF is not populating custom fields

    Hi Experts ,
    I created two following queries
    1.       VENDORCATKDF – uses KDF logical database
    2.       VENDORCATLFA1 – uses table = LFA1
    I’m pulling the same information in both queries:
    ·         Vendor Number
    ·         Country
    ·         Vendor Name
    ·         Vendor Category  (custom fields added to LFA1)
    The results for the query that uses the logical database KDF is incorrect.  It doesn’t pull in the flag on the custom field LFA1-ZMRO.   Even though the logical database KDF is made up of the table LFA1 and has these fields. 
    Is there something that can be done – so that all of these “custom” category fields under LFA1 (such as LFA1-ZZMRO) – get pulled into queries – when we use the logical database KDF ?

    Hi,
    I have got the error removed by ensuring that fields from one table are a part of one line ( taking help of ruler) only. But the underlying problem remains, the output is not ALV but List output.
    I do not think having additional fields in the query is reason for this.
    Is it bcoz iI am adjusting the output length of columns to ensure no hierarchical error ?
    Can we not have a query using LDB which is shown as SAP List?
    Regards,
    Garima.

  • Error while creating PO using JCO......?

    hello all,
    i am trying to create po by using jco. i have done everything
    but at time of execution its throw following error
    please try to help..
    thanks in advance..
    com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Exception condition "FAILURE" raised.
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
         at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
         at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
         at org.apache.jsp.pocreate1$jsp._jspService(pocreate1$jsp.java:167)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:595)

    check user Authorization in R/3
    nikhil

  • Getting an error when i am execution a BI query using ABAP.

    Hi Expert,
    I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow.
    Property Data Integrity has been set differently to the system default.
    Current setting: 0 for GHRGPDM12
    System default: u2019 7 u2018
    As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
    when i am debugging , I am getting error from
    create instance of cl_rsr_request
    CREATE OBJECT r_request
    EXPORTING
    i_genuniid = p_genuniid.
    this FM. Its not able to create the object. Can any one please help me out.
    Thanks in advance.
    Regards
    Satrajit

    Hi,
    I am able to solve this problem
    Regards
    Satrajit

  • Error while accessing Query using Query Analyzer

    dear experts...
    while accesiing the query using query analayzer...
    we are getting below error...
    What has happened?
    URL http://xxx.xxx.xxx.xx:XXXX/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex call was terminated because the corresponding service is not available.
    Note
    The termination occurred in system BI1 with error code 404 and for the reason Not found.
    The selected virtual host was 0 .
    What can I do?
    Please select a valid URL.
    If you do not yet have a user ID, contact your system administrator.
    ErrorCode:ICF-NF-http-c:001-u:ANAND-l:E-i:PSRCCPRDA003_BI1_00-v:0-s:404-r:Notfound
    HTTP 404 - Not found
    Your SAP Internet Communication Framework Team
    thanks for helping me...
    anand

    Hi friends,,
    instead of getting the link like
    http://128.222.125.57:9000/sap/bw/bex?cmd=ldoc&infocube=ZMC_SRH1&query=AGINGV21A&sap-language=EN(working link)
    am getting below link...which is getting an error....
    http://128.222.125.57:9000/sap/bw/://:/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=AGINGV21A
    above marked is the unwanted thing so how can i change my link in query designer???
    please suggest me firneds

  • Unable to create new query using query manager

    Hi friends,
    I have been trying to create a query using query manager for couple of hours but still not able to.I am following the instructions given in oracle Peopletools 8.52 : Peoplesoft query
    Chapter - creating new queries.
    Below are the steps I am going through to create new query:
    Step - I open the component Reporting Tools-> Query->Query Manager , I don't get the tabbed pages one for search an existing query and another for create new query.
    Please follow this link to see how the page is displayed in first step:
    http://uploadpic.org/v.php?img=EvMvVAXX1E
    Step 2 - When I click on create new query link, I am redirected to a page where it asks for record name to add in the query. But, even this page is not displayed as how it supposed to be
    http://uploadpic.org/v.php?img=GzHh3f6krU
    Step 3 - Following the above step, when I click on Person record to add into my query I am asked to select the fields that I want to display in the output.
    But I somehow do not get the proper tabbed pages where individual pages are there to add the attributes to complete the query like adding multiple records, fields, query, expressions, prompt...etc
    http://uploadpic.org/v.php?img=Wbbla3Q3jE
    I am neither able to select multiple records in my query nor able to customize my query to get the desired results.
    Below is the query that I want to create using query manager:
    SELECT P.EMPLID,P.BIRTHDATE, N.NAME, A.ADDRESS1, A.ADDRESS2, A.CITY
    FROM PS_PERSON P, PS_NAMES N, PS_ADDRESSES A
    WHERE P.EMPLID = N.EMPLID AND
    N.EMPLID = A.EMPLID AND
    P.BIRTHDATE BETWEEN to_date('1990/1/1','yyyy/mm/dd') and to_date('1991/1/1','yyyy/mm/dd');

    Hi,
    As I cannot access your screenshot by the blocking of company firewall rules.
    I'm guessing currently you are using PT 8.52.00 version, correct?
    This should be a bug, that you need to apply the 8.52.0X patch, not sure which patch fix this, you can apply the latest one to solve this issue for no tab page of query manager. (PT 8.52.06)
    Hope this helps.
    Thanks,
    Saxon SI

  • Error while calling BAPI_PARTNEREMPLOYEE_CREATE BAPI using JCO

    Hi All,
    Our requirement is to create and update customer contact details from java application. For this purpose we are trying to call BAPI_PARTNEREMPLOYEE_CREATE BAPI for create contact and BAPI_PARTNEREMPLOYEE_EDIT for updating contact information. As these BAPIs are of online version, error is coming while calling these BAPIs.
    So is there any way to call these BAPIs through JCO or are there any alternative BAPIs available for same purpose?
    Thanks in advance,
    Arati.

    Hi,
    All the bapi or function module available in SAP to create contact person will internally do a call transaction to VAP1 and VAP2 tcodes in order to create or change contact person respectively.
    We had a similar problem when we were creating and updating customer contact person using inbound idoc. We then created a bdc recording for the same and then created two function module with name Z_CREATE_CONTACT and Z_CHANGE_CONTACT. In your case you can make this function modules as RFC enabled FM and call them using JCO I guess.
    KR Jaideep,

  • In DBI , how to find out the Source Query used for the Report

    Hi All,
    How to find out the Source Query used to display the data in the DBI Reports or Dashboards. We can get it in Apps Front end by Going to Help and Record Histroty. But DBI Runs in Internet Explorer so i dont know how to get the source query ( SELECT Query ) Used.
    In IE we have View --> Source . But that does not help since it gives the HTML Coding and not the SELECT Query used.
    If anyone has ever worked on it...Please help me in finding it.
    Thanks,
    Neeraj Shrivastava

    Hi neeraj,
    You can see the query used to display reports.Follow these steps to get the query.
    1)Login to oracle apps
    2)Select "Daily Business Intelligence Administrator" responsiblity.
    3)Now click on "Enable/Disable Debugging" (Now u enabled debugging)
    4)now open the report which you want to see the query of
    5)In view source it displays query along with the bind varilables.
    Feel free to ping me if you have any doubts
    thanks
    kittu

  • How do i know if my query using  SORT_AREA_SIZE   or temporary tablespace ?

    Good Morning  Everyone !
    My DB version is 10.2.0.1
    I have large table  exactly 3 million records.
    SQL> select count(*) from tab1;
    COUNT(*)
       300000
    SQL> select * from tab1 order by no DESC;
    sorting  ... in process
    300000 rows selected.
    in Terminal 2 : I tried to find  sorting details -   ( No rows  selected - why ? )
    SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage  ;
    no rows selected
    SQL> /
    no rows selected
    When i google i have seen this ;
    If  Oracle cannot do the sort in memory  (SORT_AREA_SIZE initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation.
    REF_LINK : TEMPORARY Tablespaces and TEMPFILES | Oracle FAQ
    MY DOUBT QUESTION :   How do i know if my query using  SORT_AREA_SIZE   or temporary tablespace ?
    Thanks in advance.

    @ JohnWatson
    I have seen some articles from ORA - FAQ. Good.
    SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage;
    USERNAME                       USER   TABLESPACE                      SQL_ID
       SCOTT                               SYS          TEMP                            fh9vqgyd6m0d1
    PGA management means that sorting only 300000 rows  may well occur in memory
                Is this (3 million rows) -  standard  value for 10g version ?
    Thanks JohnWatson

  • Logon Screen Modificatio : Using JCo for Executing a Func Module in SAP R/3

    Hi all
       I am new to Portal(EP: 6.0: SP12) and JCo.
       We are customizing the Logon Screen of the Portal to include a CLIENT field.
        And  we are planning to Call a Z Function Module present in the R/3 of the specified client(in the Logon Screen) using JCO.
        But i am really new to the Environment..
        Could anyone please help in carrying out this work???
        And also i would like to know how a Fuc Module can be called with the help of JCO. Providing a sample Code would really help me a lot!!!!!!  
    Thanks
    Kam
    Message was edited by: Kam

    Hi Kam
    You need to create a connection to that R/3 system for that.
    Try the following code:
    creating connection:
    =====================
    IConnectorGatewayService cgService = (IConnectorGatewayService)
         PortalRuntime.getRuntimeResources().
         getService(IConnectorGatewayService.KEY);
    IConnection con = cgService.getConnection("systemalias",request);
    ConnectionProperties cp = new ConnectionProperties(request.getLocale(),request.getUser());
    IInteraction ix = con.createInteractionEx();
    IInteractionSpec ixspec = ix.getInteractionSpec();
    ixspec.setPropertyValue("inputParameter","BAPI_SALESORDER");
    RecordFactory rf = ix.getRecordFactory();
    MappedRecord input = rf.createMappedRecord("inputParameter");
    input.put("EMPLOYEE_NUMBER",empNo);
    input.put("EMPLOYEE_NAME",empName);
    BAPI_SALESORDER==>calling fuction
    EMPLOYEE_NUMBER,EMPLOYEE_NAME===>parameter name
    empNo,empName===>parameter value
    <u>To retrive the value:</u>
    ============================
    MappedRecord output = (MappedRecord)ix.execute(ixspec,input);
    object rs = null;
    object result = output.get("SALES_ORDERS");
    if(result instanceof IRecordSet) {
         rs = (IRecordSet)result;
    con.close();
    Required jar files:
    ====================
    com.sap.portal.ivs.connectorserviceapi.jar,                                  genericconnector.jar,
                       connector.jar,
                       activation.jar
    regards,
    Yoga

  • Error connecting using JCO.Client: null

    Hi,
    I created a WD app which uses  the RFC FM.  I followed How-To-build-webdynpro.pdf document to create the WD and trying to deploy and run, I see the view page but when I trigger the action via button UI element I get following error as exception in the try catch block of execute method
    In the NWA I see
    Could not create JCOClientConnection for logical System: 'WD_MODELDATA_DEST' - Model
    An exception has occurred: Erorr accessing cache [region]='XCM_SESSION_SCOPE'.
    [EXCEPTION]
    com.sap.isa.core.cache.Cache$Exception: Cannot return access for region 'XCM_SESSION_SCOPE'. Cache is not ready
    I'm using following existing JCO definition by configuring them with correct parameters.  Tested them successfully
    WD_RFC_METADATA_DEST
    WD_MODELDATA_DEST
    What am I missing?  In SM04 tcode I see 2 connections are opened with 2 Megabyte not released for a long time.  I think if connections are released correctly it should drop to 1 megabyte.  Is there anything that I need to do just after execute method as shown below (I have replaced function module with <FM> in below code)
    try {
             wdContext.node<FM>_Input().current<FM>_Get_InputElement().modelObject().execute();
         } catch(Exception exception) {
              msgMgr.reportException(exception.getLocalizedMessage(), false);
          wdContext.nodeOutput().invalidate();
          msgMgr.reportSuccess("Success");
    The error is in the catch block which is displayed on the view page.
    Thanks
    Praveen
    I modified the above code and put in finally block to close the connections as follows, please let me know if this is OK.  I still get error message as "Error connecting using JCO.Client: null" but no additional connections in the SM04 after adding finally block.
    try {
             wdContext.node<FM>_Input().current<FM>_Get_InputElement().modelObject().execute();
         } catch(Exception exception) {
              msgMgr.reportException(exception.getLocalizedMessage(), false);
         }finally {
              // disconnect the connection
              wdContext.<FM>_Get_InputElement().modelObject().modelInstance().disconnectIfAlive();     
    Edited by: Praveen11 on Oct 5, 2009 9:06 AM

    Thanks Satish.
    The issue is resolved.  I think it was to do with permission, as I was running directly from NWDS deploy and run the session didn't have proper authorisation or something that was causing this error.
    When I copy pasted the URL in the correct browser session window I got no error and function module was successfully executed.   However the issue now is that values are not showing up in the view may be to do with mapping context or model  I'll review and post back as different thread.
    Thanks
    Praveen

Maybe you are looking for