Data Integrator "where" in query transform vs SAP table column date

I have the following problem:
I am using a query transform to grab data from a SAP table and have a "where" that looks like this that works:
ZMM_STOMOS_HIST.ZPOST_DATE = to_date(to_char(sysdate(), 'YYYYMMDD'), 'YYYYMMDD')
BUT it runs for a very long time and I have just realised that when I look at the sql statement via display optimized sql that the "where" statement does not show - which makes sense because it seems to return the entire table rows to DI before it starts to filter them on the "where".
this is even though the pure SAP date is stored as YYYYMMDD type date and in DI we say take it to our BO table as type date u2013 the sql server database made it datetime. And when I validate the sql transform I get this warning.
[Query:Query_1]
BODI-1110411: Conversion warning <Warning: Expression <to_date(to_char(sysdate(), 'YYYYMMDD'), 'YYYYMMDD')> of type <DATETIME> will be converted to type <DATE>.> for expression <ZMM_STOMOS_HIST.ZPOST_DATE = to_date(to_char( sysdate( ),'YYYYMMDD'),'YYYYMMDD')
>.
I can get other "where" conditions to show in the optimized sql on the same table - no problem.
e.g.
SELECT ZSERIAL , ZUMOVETYP , ZUORIGIN , ZUDESTN , ZUTRDATT , ZUTRTIMM , ZUVENDER , ZUBOXSA1 , ZUBOXSA2
FROM ZMM_STOMOS_HIST
WHERE ZUMOVETYP = 'RBX'
How do I get this particular where clause to appear in the optimized sql statement ? I suspect it has something to do with the formatting and have tried many formats but no go.

Thank you so much .... I had to use a variable / paramter of type varchar(8) and the value as YYYYMMDD
e.g. my script
$today = to_char(sysdate(),'YYYYMMDD');
print('date is : [$today]');
This has resulted in a huge resource and most of all time saving.
I still dont understand why DI cant just figure this out in a normal where like it does with other datatypes but right now it works so I am happy.

Similar Messages

  • Query on Non-base-table column in form

    Hi,
    Does anyone have an example of code to allow users to query on non-base-table column from forms? For example, a personnel form displays a persons' name and department name. The form is based on PERSON table, which contains the department id, not the name. The form uses post-query to display the department name. When in query mode, the user wants to enter department name, and display the people in the department (still using this form, which is based on PERSON table.
    Thanks!

    Try this:
    For data block person set these properties as follows:
    1.Set Query Data Source Name = "person , departments"
    2.Set DML data target name = "person"
    3.Set Where Clause to join i.e. condition "person.dno = departments.dno"
    For filed department name set these properties as follows:
    1.Data base item = "Yes"
    2.Column Name = "departments.dname"
    3.Query Only = "Yes"
    4.Insert Allowed = "No"
    5.Update Allowed= "No"
    6.Keyboard Navigable = "No"
    If you face ambiguous column name check for the same filed name exist on both tables and set column name for this filed to person.filed_name
    Regards
    null

  • XML Query filtering by child table column

    Hello,
    If anyone can help with this one... it would be nice. I need to make the output of an query to be in the format of XML, but the problem is that the initial filtering needs to be done in the child table.
    Example:
    CREATE TABLE PRIMARY(
    ID NUMBER(19,0),
    CODE_PRIMARY VARCHAR2(32));
    CREATE TABLE SECONDARY(
    ID NUMBER(19,0),
    IDPRIMARY(19,0),
    CODE_SECONDARY VARCHAR2(32));
    INSERT INTO PRIMARY(ID,CODE_PRIMARY)
    VALUES (1,'A');
    INSERT INTO PRIMARY(ID,CODE_PRIMARY)
    VALUES (2,'B');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (1,1,'C');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (2,1,'D');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (3,2,'E');
    Now what we need is to build an XML tree like the following, INNER JOINING PRIMARY and SECONDARY tables with this condition in the where clause -> WHERE SECONDARY.CODE IN ('C','D')
    <result>
    <record>
    <id>1</id>
    <code>A</code>
    <childs>
    <child>
    <id>1</id>
    <idprimary>1</idprimary>
    <codesecondary>C</codesecondary>
    </child>
    <child>
    <id>2</id>
    <idprimary>1</idprimary>
    <codesecondary>D</codesecondary>
    </child>
    </childs>
    </record>
    </result>
    In this example only one record is returned since we only have one record in PRIMARY table that has a child having codesecondary=C or D. The ideia is to get many records... but I think that this is enough for the sake of the example. And the solution is the same.
    Thanks in advance!
    GM

    Found the answer. Used distinct keyword instead of grouping the output table columns. This way XMLAgg didn't broke up the result:
    SELECT
    XMLElement("Processos",
    XmlAgg(XMLElement("Processo",
    XMLForest(T.ID as "Id",T.CODIGO as "Codigo",T.DESCRICAO as "Descricao"),
    XMLElement("Funcionalidades",
    SELECT
    XMLAgg(
    XMLElement("Funcionalidade",F2.ID)
    FROM TWBASEDB.LISTA_UNICA_FUNCIONALIDADE F2
    WHERE F2.ID_processo=T.ID
    and f2.ACTIVIDADE IN ('1_ACTC1','1_ACTC2','1_ACTC3','2_ACTC1')
    from
    select distinct P.ID,P.CODIGO,p.DESCRICAO
    FROM TWBASEDB.LISTA_UNICA_PROCESSOS P
    INNER JOIN TWBASEDB.LISTA_UNICA_FUNCIONALIDADE F ON P.ID=F.ID_PROCESSO
    WHERE ACTIVIDADE IN ('1_ACTC1','1_ACTC2','1_ACTC3','2_ACTC1')
    order by p.id
    ) T

  • Physical query not accessing Fact Table/Column

    Hi,
    I'm facing a weired issue. I have a report with 32 columns. 22 columns are from 8 dimensions and 10 columns from 3 Facts.
    But while observing the Physical query. Its not touching 1 particular Column coming from 1 Fact Table.
    So, in the query only 2 Fact columns are there and in the report its always Null value.
    When I'm adding a filter on that Fact Column to force Analytics to go and join with that Fact Table, Its not including that Fact Table/Column and producing a very funny query like the following:
    SELECT
    COLUMNS....
    FROM
    TABLES (8 DIMENSION AND 2 FACTS)
    GROUP BY COLUMNS....
    HAVING cast(NULL as DOUBLE PRECISION )>1234
    ================================
    "cast(NULL as DOUBLE PRECISION )>1234" - this is the filter, I have added on that Fact Column.
    Note- It may be because of RPD configurations/joins. But the system (Siebel Analytics 7.8) is in production for 2 years and 500 users using it and nobody reported any issue like this before.
    Can anyone please give me some helpful hint, idea, what is happening?
    Thanks in Advance
    Regards
    Sudipta

    Hi Kishore,
    Thanks for your reply.
    However, I did the analysis and found following, please let me know if your perspective is falling in the same line or not.
    Scenario:
    Suppose all the columns i'm trying to fetch, are coming from 5 dimensions [d1,d2,d3,d4,d5] (some of them are aliased table) and 3 fact tables [f1,f2,f3]
    Now, the report is not fetching data for c1 column which is coming from f3 fact table. Even f3 table is not included in the physical query.
    Now what i found that, there is a dimension suppose d3 which is not having any direct join with f3, but other facts like f1,f2 have joins with d3 table.
    If i remove the columns coming from d3 dimension from report, then f3 fact columns are getting populated in report.
    Problem:
    I need to provide a single physical query for that report, while those report columns are defined by the business.
    Questions:
    1. So is it really possible to create a query for that kind of report without changing the RPD design?
    2. If no, then is the only solution to split that report (i'm thinking) into 2-3 sub reports?
    Thanks all of you for replying and providing your thoughts.
    Regards
    Sudipta

  • Where the attached files stores in SAP table

    Hi All,
    I have attached the DOC format file in FB03 document display transaction.. actually where it was stored in SAP tables.

    Hi,
    Please check out the below thread:-
    [Re: where will the attachments created in fb02 or fb03 get stored?;
    Regards,
    SDNer

  • Query Transform in Data Services 3.2

    Hi,
    I am using Query transform to extract data from DB2 database and just realized that the whole source table is accessed and then the query transform's where condition is applied, meaning the whole table is loaded in the memory befored it filters the data.
    Is there anything I can do to access only the required data from the source? My filter conditions are dynamic based on system date, so creating a database view is not a valid option.
    Thanks & regards,
    Bhavesh

    I don't see the option to "right-click to stop a job" in the Data Servcies 3.2 Management Console >Status >Repository >Job :Monitor.
    I do see we can Select the job, then click Abort at bottom of screen.
    Are you sure it's a right-click?
    On the Monitor Tab, I don't have a right click to stop the job either.
    Also in the Management Console I don't see where I can right-click and select Properties to add a description for a specific trace log
    Am I in the wrong spot?
    Thanks
    Jay

  • Query transform with where condition not equal to

    All,
    I have a two tables in a Data services job where I am using a Query transform to load the data from these two tables into another table. In the where tab in query transform i had a conditon saying table1.column1 <>  table2.column1 and table1.column2 <> table2.column2.
    I need to see the record count of table1-table2 in my final thrid table, but I see more record count and also the not equal condition is failing. Its working for an equal condition but the not equal condition is failing.
    The equivalent SQL query for the above transform has to be:
    select * from table1 inner join table2 on table1.column1 = table2.column1 where table1.column1 <> table2.column1 and
    table1.column2 <> table2.column2.
    Any thoughs on how to fix my query transform.
    Thanks

    Hi
    As per your below statement
    "I need to see the record count of table1-table2 in my final thrid table, but I see more record count and also the not equal condition is failing. Its working for an equal condition but the not equal condition is failing."
    If you trying to get the records from table-1 which are not in table-2 (as you trying table1-table2)
    you can try logic in query transformation where clause
    not table1.field1 in (table2.field1)
    and
    not table1.field2 in (table2.field2)
    it gives you count from table1 only
    Regards
    Ahalya Gopinath

  • Query and retrieval of SAP table data

    Hi,
    Within PI Is it possible to use a select query on an ECC table and retrieve the relevant data. The data will then need to be mapped to the output.
    Can this be achieved through an RFC call?
    Thanks

    Hi,
    You can use RFC lookup and map the output to target field.
    view this article for step by step process...
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40b64ca6-b1e3-2b10-4c9b-c48234ccea35
    Hope this helps....

  • Push Data in SAP Tables using Data Services

    Hi
    Lets suppose that I have used Data Services 4.0 to pull data from KNA1 table , and loaded into the MDM where data cleansing , enrichment and deduplication has been done, and then MDM writes to a file.
    How can Data Services then push the cleansed data back into the SAP table ( KNA1) ? [or it cannot be done due to multiple reasons ]
    Rishi

    Hi
    To update an SAP table, import the metadata for the relevant BAPI or IDoc and call it via a query transform.
    M

  • To upload a data into SAP Table with the help of RFC function in BODS

    Hi,
    Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
    I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
    In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
    I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
    but it did not help me.
    Thanks,
    Abhishek

    Hi Abhishek,
    Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
    Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
    After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
    I hope this helps.
    Jan.

  • How to access data from SAP Tables from a Webi report

    hi all,
    I have a webi report for financial data and from a Bex query which is build on a Cube (this has data from 2 SAP ECC systems)
    i want to build a functionality where in i can call some SAP Table data from this webi report. i should be able to pass information or some hard code where it can understand the source system it has to pick data from.
    in SAP BI, we have this ption wherein we can achieve this through RRI..
    is this possible in Webi ?
    Thanks
    SKS

    Hi.
    Create a universe on top of SAP Tables and create a webi report.
    Using hyper link /open doc we can call  this report from the webi report created on top of your Cube .
    @Sri

  • Where we can test the SAP objects by using eCATT?

    Hi Abapers,
    Where we can test the SAP objects by using eCATT?Is there any separate software or tool we have to install or its included in the SAP itself?
    I have ECC5.0 version?how can i configure or install eCATT?
    Please explain the step by step procedure?
    Early reply is highely appriciable.
    Regards,
    Chow.

    Hi
    Extended Computer Aided Test Tool (eCATT) to create and execute functional tests for software. The primary aim is the automatic testing of SAP business processes. Each test generates a detailed log that documents the test process and results.
    Features
    You can:
    · Test transactions and reports
    · Call BAPIs and function modules
    · Test remote systems
    · Check authorizations (user profiles)
    · Test database updates
    · Test the effects of changes to customizing tables
    · Test the effect of changes to customizing settings
    · Check system messages
    Constraints
    eCATT runs in a system based on SAP Web Application Server 6.20 or higher. However, you can use this system to test systems with Release 4.6C or higher.
    check these link,
    eCATT- An Introduction
    /people/sumeet.kaul/blog/2005/07/26/ecatt-an-introduction
    Creating Test Scripts
    /people/sumeet.kaul/blog/2005/08/10/ecatt-creating-test-scripts
    eCATT Logs
    /people/sapna.modi/blog/2006/04/18/ecatt-logs-part-vi
    eCATT Scripts Creation – TCD Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
    Creation of Test Data Container
    /people/sumeet.kaul/blog/2005/08/24/ecatt-creation-of-test-data-container
    eCATT Scripts Creation - SAPGUI Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
    Integrating ECATT & MERCURY QTP Part -1
    /people/community.user/blog/2007/01/02/integrating-ecatt-mercury-qtp-part-1
    Using eCatt to Test Web Dynpro ABAP
    /people/thomas.jung/blog/2006/03/21/using-ecatt-to-test-web-dynpro-abap
    and
    -command reference
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/3c333b40389c46e10000000a114084/content.htm
    /people/sapna.modi/blog/2006/04/10/ecatt--an-introduction-part-i
    http://prasadbabu.blogspot.com
    https://www.sdn.sap.com/sdn/developerareas/was.sdn?page=test_tool_integration_for_sap_e-catt.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/1b/e81c3b84e65e7be10000000a11402f/frameset.htm
    http://www.erpgenie.com/ecatt/index.htm
    hope this helps.
    Regards
    Anji

  • Other way to Map query transform in given scenario.

    Hi Experts,
    I am doing a scenario where i need to map target from 3 sources.
    In source there is a field of Purchase date.
    1.)I have to map Purchase date(source) to column1(Target) when purchase date < '2013-04-01'.
    2.)Map Purchase date(source) to column2(Target) when purchase date >'2013-03-31'.
    I have done this through query transform.
    I am attaching a screenshot for better explanation.
    I am using where clause in both the query transform.
    Is there any other way to do this activity??
    Regards,
    Neha Khetan

    You can easily do this in one join of your 3 tables. use the built-in ifthenelse function in the mapping of both your target columns:
         column1= ifthenelse(purchase_date < '2013-04-01', purchase_date, null)
         column2= ifthenelse(purchase_date >'2013-03-31', purchase_date, null)

  • Does the 'default where clause' query select the ROWID by default ?

    Hi ,
    The query in default where property of a data block is as follows:
    global.prim_lang = :global.user_lang
    and upper(group_name) like upper('%' || :B_apply_inclusions.TI_group_desc || '%')
    UNION ALL
    select g.rowid, g.group_no
    from table1 t,
    table 2 g
    where :global.prim_lang != :global.user_lang
    and upper(g.group_name) = t.key(+)
    and :global.user_lang = t.lang(+)
    and upper(nvl(t.translated_value, g.group_name)) like upper('%' || :B_apply_inclusions.TI_group_desc || '%')
    The g.rowid was added in the UNIONALL portion of the query because the first part of the query was bringing rowid as well.
    We are in 10.1.2.3.0 forms version.
    However for a user in forms verion 10.1.2.0.2, the query is giving an error " Unable to perform query " - due to mismatch in the number of columns selected in the query union.
    because for this user, rowid is not selected as part of default where clause query( 1st part of the query before the unionalll).
    If g.rowid is removed from the 2nd part of the query , it errors out in 10.1.2.3.0 forms version.
    Could you kindly clarify when this rowid will also be selected by the default where clause of a block and why this issue is occuring?Is this issue related to forms version or any other property of the block? Is it is version based, is there a patch available to deal with the same?
    Thanks in Advance.

    You normally change the default_where block property just when you want to chnage the filter conditions for what is selected from a given block data source.
    Querries with union or minus will confuse forms as to the rowid and will no longer be albe to perform the default insert/update/delete, not knowing the rowid and the table to perform the dml on.
    A from clause query will be the best way to change dynamically the tables you select from and also the where. But, by using that, if you wish to insert/update/delete, you will have to use on-insert/update/delete triggers where the processing will have to rely on some primary key columns and not on rowid.
    Or, instead of a from-clause, you may use a view, but that will definitely be less flexible than a from clause query.

  • How to build a WEBI query on a SAP NANA OLAP connection?

    hi fellows,
    we all know that a relational connection can be built to SAP HANA database, and we build data foundation, biz layer to publish it to the repository, so that we can create a WEBI report based on a query to visit the universe.
    However, does anybody know how to create a WEBI query on a SAP HANA OLAP connection?  Since we don't need to build any data foundation on it.
    I created a sap hana olap connection, but failed to find anywhere to publish it?  Can anybody help?
    thanks,
    Jennifer

    Hi Jennifer,
    Check SCN thread http://scn.sap.com/thread/3493857.
    Also check below for Creating a SAP Universe on HANA: Best Practics.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00922ede-de2f-2f10-c2aa-f9b0f6495d34?overridelayout=t…
    Regards,
    JC

Maybe you are looking for

  • Campaign on Daily Basis

    Hi Experts, We have a requirement to send birthday wishes to customers and employees automatically on daily basis using campaign automation. We used campaign automation process to send the wishes. when we released the campaign it executed successfull

  • Vnd.ms-excel.numberformat:@

    I use a cloud-computing app, Salesforce, to maintain some databases. The report module, which produces nice-looking formatted reports, allows you to export the data as .csv files, which can be opened without trouble by Numbers. It also allows you to

  • Basics...

    Hi gurus - I have a long chain of questions.. (possibly dumb ones. But please clariy for me.. q1. I am trying to set-up a bw sandbox. The basis team says they have established all the RFCs for bw and r/3 and settings for the flat-files from pc too. I

  • Multiple Excel Sheets of the same Workbook

    Hi if anyone know where is exactly the problem here,in order to inser each row of the table in a different worksheet of the same workbook by the way the moment i try to use a loop with excel get worksheet,to link the indexation with the worksheet ind

  • C7 after belle update, accel or other sensor doesn...

    Hi, I just updated my c7 to belle and now when I change my phone position my screen doesn't "flip" vertical or horizontal . its getting annoying, specially trying  to write something , the buttons are just to small vertically. I tried to switch on/of