Query on SLT

Hi Frzz,
We have created some calculated columns in HANA on some fields uing IF ,CASE and some string funtions like midstr(),lpad(), isNull() etc
My question is instead of doing it in HANA, can i do it in SLT??? to improve the performance at query runtime??
Please guide.
Best Regards,
Krishna.

Hi Krishna,
You could watch this as a start:
SAP D&T Academy - SLT - How to Setup transformation capabilities to filter content and structures - YouTube
and then have a play with your abap include against parameter and event based rules to skip records and set values of existing/new fields.

Similar Messages

  • SAP LT 2.0 && SLT Replication in HANA : query

    Hello LT experts,
    I am sure that we could use SAP SLT Replication (Data provisioning method) using HANA with source system as SAP or Non SAP SYSTEMS.
    Please advise if the same works with SAP LT.20 for system landscape transformation project.I mean source for SAP LT2.0 would be Non-sap and target ofcourse would be SAP (which could be consolidation of many existing SAP productive systems).
    Thank you
    Shishupal.

    Hi Shishupal,
    If I understand correctly, you are looking for difference between SLT in HANA and SAP Landscape Transformation 2.o(SLT again ). Both these two tools are from same framework. But SLT in HANA is used as a replication tool, whereas, as you said we use HANA as a secondary database and the source is may be SAP or NON SAP. In case of SLT 2.0, this tool is used in during company marge, merging company code, merge profit area (used basically when two company merge scenario etc). May be you already know that for SLT in HANA requires DMIS addon in 7.02 netweaver systems like wise for SLT 2.0 DMIS is required for SLT 2.0 ad additionally one more addon component SHC_CONT is required. So we have two things
    SLT replication tool
    SLT 1.0 or 2.0
    Regards,
    Rafikul

  • Need help in tune this query.

    Hi All,
    The below query is taking nearly one hour to give the output.
      2  select sku.VK_UNIT
      3       , sku.MODEL
      4       , sku.DESCRIPTION
      5       , slt.GEO
      6       , slt.LEAD_TIME
      7       , slt.REV_LEAD_TIME
      8       , aud.LEAD_TIME        as PREV_LEAD_TIME_GEO
      9       , aud.REV_LEAD_TIME    as PREV_REV_LEAD_TIME_GEO
    10       , slt.COUNTDOWN
    11       , aud.CREATION_DATE    as EDD_CREATION_DATE_GEO
    12       , aud.CREATED_BY       as EDD_CREATED_BY_GEO
    13    from LTC_GLOBAL.LTC_SKU sku
    14       , LTC_GLOBAL.LTC_SKU_LEAD_TIME slt
    15       , (select VK_UNIT
    16               , MODEL
    17               , substr(ACTION_TYPE, 9) as GEO
    18               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU EDD ' then ACTION_VALUE  else null end) as LEAD_TIME
    19               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU EDD ' then CREATION_DATE else null end) as CREATION_DATE
    20               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU EDD ' then CREATED_BY    else null end) as CREATED_BY
    21               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU RDD ' then ACTION_VALUE  else null end) as REV_LEAD_TIME
    22               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU RDD ' then CREATION_DATE else null end) as REV_CREATION_DATE
    23               , max(case when substr(ACTION_TYPE, 1, 8) = 'SKU RDD ' then CREATED_BY    else null end) as REV_CREATED_BY
    24            from (select VK_UNIT
    25                       , MODEL
    26                       , ACTION_TYPE
    27                       , ACTION_VALUE
    28                       , CREATION_DATE
    29                       , CREATED_BY
    30                       , PREV_ACTION_VALUE
    31                       , PREV_CREATION_DATE
    32                       , PREV_CREATED_BY
    33                    from (select
    34                                 NOTE         as VK_UNIT
    35                               , NOTE2        as MODEL
    36                               , ACTION_TYPE
    37                               , ACTION_VALUE
    38                               , CREATION_DATE
    39                               , CREATED_BY
    40                               , row_number()        over(partition by NOTE, NOTE2, ACTION_TYPE order by CREATION_DATE desc) as DEPTH
    41                               , lead(CREATION_DATE) over(partition by NOTE, NOTE2, ACTION_TYPE order by CREATION_DATE desc) as PREV_CREATION_DATE
    42                               , lead(CREATED_BY   ) over(partition by NOTE, NOTE2, ACTION_TYPE order by CREATION_DATE desc) as PREV_CREATED_BY
    43                               , lead(ACTION_VALUE ) over(partition by NOTE, NOTE2, ACTION_TYPE order by CREATION_DATE desc) as PREV_ACTION_VALUE
    44                            from LTC_GLOBAL.LTC_AUDIT
    45                           where NOTE is not null
    46                             and NOTE2 is not null
    47                             and ACTION_TYPE is not null
    48                         )
    49                   where DEPTH = 2
    50                     and substr(ACTION_TYPE, 1, 8) in ('SKU EDD ', 'SKU RDD ')
    51                 )
    52           group by VK_UNIT, MODEL, substr(ACTION_TYPE, 9)
    53         ) aud
    54  where slt.VK_UNIT = sku.VK_UNIT
    55     and slt.MODEL   = sku.MODEL
    56     and slt.CLASS   = sku.CLASS
    57     and nvl(slt.LEAD_TIME, slt.REV_LEAD_TIME) is not null
    58     and aud.VK_UNIT (+)= slt.VK_UNIT
    59     and aud.MODEL   (+)= slt.MODEL
    60     and aud.GEO     (+)= slt.GEO;
    PLAN_TABLE_OUTPUT
    Plan hash value: 2687821083
    | Id  | Operation                   | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)| Time  |
    |   0 | SELECT STATEMENT            |                   |   539K|   902M|       |  1005K  (1)| 03:21:05 |
    |*  1 |  HASH JOIN OUTER            |                   |   539K|   902M|    62M|  1005K  (1)| 03:21:05 |
    |*  2 |   HASH JOIN                 |                   |   539K|    56M|    27M| 66402   (1)| 00:13:17 |
    |*  3 |    TABLE ACCESS FULL        | LTC_SKU_LEAD_TIME |   559K|    20M|       | 23201   (2)| 00:04:39 |
    |   4 |    TABLE ACCESS FULL        | LTC_SKU_UNIT      |  5726K|   382M|       | 19570   (1)| 00:03:55 |
    |   5 |   VIEW                      |                   |  4157K|  6522M|       |   610K  (2)| 02:02:02 |
    PLAN_TABLE_OUTPUT
    |   6 |    HASH GROUP BY            |                   |  4157K|   229M|   303M|   610K  (2)| 02:02:02 |
    |*  7 |     VIEW                    |                   |  4157K|   229M|       |   551K  (2)| 01:50:21 |
    |*  8 |      WINDOW SORT PUSHED RANK|                   |  4157K|   229M|   303M|   551K  (2)| 01:50:21 |
    |*  9 |       TABLE ACCESS FULL     | LTC_AUDIT         |  4157K|   229M|       |   493K  (2)| 01:38:41 |
    Predicate Information (identified by operation id):
       1 - access("AUD"."VK_UNIT"(+)="SLT"."VK_UNIT" AND "AUD"."MODEL"(+)="SLT"."MODEL" AND
                  "AUD"."GEO"(+)="SLT"."GEO")
    PLAN_TABLE_OUTPUT
       2 - access("SLT"."VK_UNIT"="UNIT"."VK_UNIT" AND "SLT"."MODEL"="UNIT"."MODEL" AND
                  "SLT"."CLASS"="UNIT"."CLASS")
       3 - filter(NVL("SLT"."LEAD_TIME","SLT"."REV_LEAD_TIME") IS NOT NULL)
       7 - filter("DEPTH"=2)
       8 - filter(ROW_NUMBER() OVER ( PARTITION BY "NOTE","NOTE2","ACTION_TYPE" ORDER BY
                  INTERNAL_FUNCTION("CREATION_DATE") DESC )<=2)
       9 - filter((SUBSTR("ACTION_TYPE",1,8)='SKU EDD ' OR SUBSTR("ACTION_TYPE",1,8)='SKU RDD ') AND
                  "NOTE2" IS NOT NULL AND "ACTION_TYPE" IS NOT NULL)
    30 rows selected.
    SELECT COUNT(*) FROM LTC_GLOBAL.LTC_SKU--5012335
    SELECT COUNT(*) FROM  LTC_GLOBAL.LTC_SKU_LEAD_TIME--8060956
    SELECT COUNT(*) FROM  LTC_GLOBAL.LTC_AUDIT--58309887
    CREATE UNIQUE INDEX LTC_GLOBAL.LTC_SKU_LEAD_TIME_PK ON LTC_GLOBAL.LTC_SKU_LEAD_TIME(VK_UNIT, MODEL, CLASS, GEO)
    CREATE INDEX LTC_GLOBAL.LTC_AUDIT_LEAD_TIME ON LTC_GLOBAL.LTC_AUDIT(ACTION_TYPE)
    CREATE INDEX LTC_GLOBAL.LTC_AUDIT_LEAD_TIME_DOM ON LTC_GLOBAL.LTC_AUDIT(NOTE, NOTE2, ACTION_TYPE)
    CREATE INDEX LTC_GLOBAL.LTC_AUDIT_LEAD_TIME_DOM1 ON LTC_GLOBAL.LTC_AUDIT("CREATION_DATE" DESC)
    Please help me.
    Thanks in advance.

    Thanks for your response.
    Sorry for violating formatting. Since I am not aware of the format options in new environment.
    I have created functional based index on SUBSTR(ACTION_TYPE, 1, 8).
    The cost got reduced some what.But still the query is taking 40 minutes.
    The following predicate it is returning 58296618 rows.
    NOTE is not null  
    and NOTE2 is not null 
    and ACTION_TYPE is not null 
    LTC_SKU_UNIT is a view.
    The following query is used for creating this view.
       SELECT   unit.VK_UNIT,
                unit.MODEL,
                unit.CLASS,
                unit.LOB,
                unit.LAST_UPDATE_DATE,
                unit.DESCRIPTION
         FROM   LTC_GLOBAL.LTC_SKU_UNIT unit;
    The following indexes are created on the LTC_GLOBAL.LTC_SKU_UNIT table.
    CREATE INDEX LTC_GLOBAL.LTC_SKU_UNIT_IDX_CLASS ON LTC_GLOBAL.LTC_SKU_UNIT(CLASS)
    CREATE INDEX LTC_GLOBAL.LTC_SKU_UNIT_IDX_MODEL ON LTC_GLOBAL.LTC_SKU_UNIT(MODEL)
    CREATE INDEX LTC_GLOBAL.LTC_SKU_UNIT_IDX_UPDATE_DATE ON LTC_GLOBAL.LTC_SKU_UNIT(LAST_UPDATE_DATE)
    CREATE UNIQUE INDEX LTC_GLOBAL.LTC_SKU_UNIT_PK ON LTC_GLOBAL.LTC_SKU_UNIT(VK_UNIT, MODEL, CLASS)
    Is there any way to rewrite the query to improve the performance. Any suggestions to improve the performance.
    Please help me.
    Thanks in advance.

  • Strategy for ensuring replication is complete before initating query from source system

    Hi,
    I am using HANA as a side-car scenario with reports running in SAP ECC being accelerated by querying replicated tables in SAP HANA instead. This works well, however I don't have a good mechanism to validate before running a report whether the underlying data has already been replicated to HANA or is still queued up.
    Often users would want to run the reports soon after large data changes have been made in the source tables. It is unknown, based on the overall workload, how long it might take for the most recently written records to get replicated to the corresponding HANA table.
    What is a good practice approach to handle this. I have seen some separate threads on doing record counts between HANA and ECC. I think that is not a good idea at all. Firstly, for large tables, the time overhead of doing the record count is very large. In the time it takes for me to query the record count in ECC, the HANA report could have run 10 times over. But more importantly, for very large source tables, I may have opted to only replicate more recent data, leaving old historical data from ECC un-replicated to HANA.
    I know this is not a new problem. SAP must have already addressed it a number of ways for their own delivered application accelerators. The COPA accelerator for instance must be doing something along these lines. Possibly querying most recent records in ECC and comparing them to the most recent records in HANA for the same tables might be a way to go.
    Does anyone else have insights into how to best approach this? Does SLT expose a mechanism to check whether replication is completed for any given table?
    thanks,
    Nitin Goel

    Hi Nitin,
    SLT can never confirm whether replication is completed for any given table..Replication is a continous process,if records are there in the logging table of ECC then that will be replicated via SLT.
    So the best way to check Replication completion is :
    1. Go to SE16(ECC)--give the Logging table for which you want to check the replication.Copy the Logginng table from LTRC.If the number of entries is 0,then nothing is there in the logging table.
    You can verify the replication in LTRC(SLT)--Expert functions to check replication is working fine or not.
    2. Then go toi SE16(ECC)--Check the number of entries of the original table
    3. Check in HANA--The number of entries should be same as the source table.
    It takes a minute to verfify each table replication,not more than that.
    Regards,
    Joydeep.

  • SAP HANA Query

    Hello, I have a query about SAP HANA. If I want to bring BSEG table in HANA from ECC but do not want to do Live update(SLT) and do not want to create all the fields that exist in BSEG in ECC one by one. what features of native HANA would I use to do that?
    Thanks.

    Hi Venkat,
    You can go with BODS or SLT.
    In BODS, you can select required fields from BSEG table in ECC and map the same to HANA table.
    You can also go with SLT, do one time load using LOAD option. Even here you can select reruired fields, not all the fields from BSEG table.
    Regards,
    Chandu.

  • Problems after installing SLT SP05 - service iuuc_repl_mon_schema_oif

    Hello,
    just to share the issue... I just applied SP05 to our SLT system and I am getting following error when clicking on details of replicated system:
    The following error text was processed in system IDE:
    ICF service node "/sap/bc/webdynpro/sap/iuuc_repl_mon_schema_oif" does not exist (see SAP Note 1109215)
    Requested service does not exist.
    Also all SAP notes fixing SLT that were applied on top of SP04 are in inconsistent status. Re-implementation is not possible because some code was modified by SP05 and I consider de-implementation risky because I can unintentionally remove code delivered as part of SP05.
    To eliminate hypothesis that root cause of this issue can be SAP notes - I installed SLT SP05 into fresh SAP IDES system and defined replication to newly installed HANA database - result is same.
    I have suspicion that possible root cause might be the fact that I implemented both SP05 packages (T1 and T2) together in one queue but this one is not confirmed.
    I do not expect solution (I opened SAP message for this) but I would like to share the experience (especially if you are planning upgrade SLT to SP05). Also I would like to ask if you already updated to SP05 and did not encounter this issue to share the procedure you used (this might help to see what was done differently and what might therefore be the root cause).
    Thanks
    Tomas

    Hi Tomas,
    I've had also this problem using transaction LTR or iuuc_replication_config. But solution is described in SAPnote 1109215.
    You have to do following steps (on SLT system):
    1. Go to transaction SE80
    2. Change to: Web Dynpro Comp. / Intf.
    3. I*
    4. Choose IUUC_REPL_MON_SCHEMA_OIF
    5. Check IUUC_REPL_MON_SCHEMA_OIF -> Web Dynpro Applications -> iuuc_repl_mon_schema_oif
    6. Next "Goto -> HTTP Service Maintenance"
    7. If the node does not exist, the system issues the query: "ICF node for service "..." does not exist. Do you want to create it?"
    8. Choose "Yes"
    If you do this steps you'll be able to access another windows in Configuration & Monitoring Dashboard.
    Regards,
    Pawel

  • Replicate an oracle view with SLT

    Hi -
    Using Oracle 11g and SLT 2011_1_731 Patch 7 with Hana rev 82
    I am trying to replicate oracle views in hana through SLT
    Scenario 1:
    tables T2 and T3 with View T2_T3_view
    If I follow this thread  SLT view replication
    It creates the view as a table in hana  but does not populate it with any data.
    Scenario 2 -
    I have 2 oracle tables - T4 and T5.  I have a view T4_T5_VIEW that joins the 2 tables.
    I followed steps in a document I received to replicate the view syntax as well as the tables.
    1) replicated both tables T4 and T5 - success
    2) stopped replication on T4
        table exists in hana with data but no replication
    3) using LTRS, assigned the view T4_T5_VIEW to table T4
    4) changed the performance option
    5) restarted replication on T4
    The view gets created as a table, but table T4 gets and error and does not replicate.
    The view gets no data
    What is the proper process for an oracle table?
    I have a very complex view with 5 source tables I want to replicate.
    Thanks
    Diane

    sorry,
    with the query
    SELECT TAB2.COD_M ,
    COUNT(TAB1.COD_MAT) count_mat
    FROM TAB2,
    TAB1
    WHERE TAB2.COD_R (+) = TAB1.COD_MAT
    AND TAB1.COD_R IN ('1','3')
    GROUP BY TAB2.COD_M
    I get:
    COD_M..........COUNT_MAT
    00114940...........1
    00116220...........1
    00116300...........2
    00119320...........1
    00119450...........1
    ...................0
    but I'd like to get this output:
    COD_M..................count_mat
    00114940...................1
    00114949...................0
    00116220...................1
    00116300...................2
    00119324...................0
    00119450...................1

  • XPATH query behaves differently depending on presence of default namespace

    I'm curious to know why an XPATH query seems to behave differently depending on whether the default namespace is present in the query.
    My test case is as follows:
    I use a table called xml_messages (id number, message xmltype) containing two rows - one where xmlns is specified and the other without.
    1. Default namespace is specified:
    <?xml version="1.0"?>
    <Bereken xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fout="false" Identifier="21-4-2008 12:55:02" xmlns="http://schemas.myco.nl/services/IPP">
    <Reglementen>
    <Reglement Ind="21000005" dlnsts="6">
    <Producten>
    <Product Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1032" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1052" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1062" ogr="0" bbr="2389.968" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3002" ogr="18968.00" bbr="5690.4" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3032" ogr="0" bbr="0" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3502" ogr="2845.00" bbr="2845.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="5002" ogr="3794.00" bbr="3794.00" igl="0" elt="18" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7502" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7503" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="8101" ogr="0" bbr="0" igl="65" elt="65" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7002" ogr="0" bbr="8724.6" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7202" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7302" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    </Producten>
    </Reglement>
    </Reglementen>
    <Parameters gbtd="1957-12-18T00:00:00.0000000+01:00" gsl="Vrouw" pdr="2008-03-01T00:00:00.0000000+01:00" hdgs="40000" ptp="100" />
    </Bereken>
    2. No default namespace specified:
    <?xml version="1.0"?>
    <Bereken xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fout="false" Identifier="21-4-2008 12:55:02" >
    <Reglementen>
    <Reglement Ind="21000005" dlnsts="6">
    <Producten>
    <Product Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1032" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1052" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1062" ogr="0" bbr="2389.968" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3002" ogr="18968.00" bbr="5690.4" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3032" ogr="0" bbr="0" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3502" ogr="2845.00" bbr="2845.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="5002" ogr="3794.00" bbr="3794.00" igl="0" elt="18" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7502" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7503" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="8101" ogr="0" bbr="0" igl="65" elt="65" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7002" ogr="0" bbr="8724.6" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7202" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7302" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    </Producten>
    </Reglement>
    </Reglementen>
    <Parameters gbtd="1957-12-18T00:00:00.0000000+01:00" gsl="Vrouw" pdr="2008-03-01T00:00:00.0000000+01:00" hdgs="40000" ptp="100" />
    </Bereken>
    Next, I use the following two queries to get attribute values from the xml messages:
    First query using xmlns:
    select extractvalue(value(v),'/Product/@Ind' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ,'xmlns="http://schemas.myco.nl/services/IPP"'
                                  ))) v
    where f.id = 1; -- Selects from the xmltype message that does have xmlns specified
    This returns (as the first row)
    IND IND2
    ____ 1002
    ^
    |------ Nothing is returned by the XPATH /Product/@Ind
    Second without using xmlns
    select extractvalue(value(v),'/Product/@Ind' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ))) v
    where f.id = 2; -- Selects from the xmltype message that has no xmlns
    This returns (as the first row)
    IND IND2
    1002 1002
    According to XMLSpy, the correct XPATH to get the "Ind" attribute is "/Product/@Ind" so what I dont understand is why query one doesnt return any data when using a default namespace.
    The XPATH "/*/@Ind" works in both cases and can be used as a workaround, but it seems less elegant than using the proper XPATH.
    I've tried this test case in 9i and 10g, in sqlplus and TOAD, with the same results in all cases.
    Can anyone provide some insight as to why this behavior occurs?

    Thanks, A_Non,
    adding the third parm to the extractvalue part of the query works.
    ie:
    select extractvalue(value(v),'/Product/@Ind', 'xmlns="http://schemas.myco.nl/services/IPP"' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ,'xmlns="http://schemas.myco.nl/services/IPP"'
                                  ))) v
    where f.id = 1;               
    I had not expected this because I thought the xml fragment returned by the extract didnt include the default namespace.
    However, when looking at the query in more detail, its clear Oracle automatically includes the xmlns part in the returned xml fragment.
    One of the rows in the xml fragment:
    <Product xmlns="http://schemas.myco.nl/services/IPP" Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0"/>

  • SLT - Splitting one source table into two tables in the destination

    Hi,
    I am wondering if we can split content of one source table into two different tables in the destination (HANA DB in my case) with SLT based on the codified mapping rules?
    We have the VBAK table in ERP which has the header information about various business objects (quote, sales order, invoice, outbound delivery to name a few). I want this to be replicated into tables specific to business object (like VBAK_QUOT, VBAK_SO, VBAK_INV, etc) based on document type column.
    There is one way to do it as far as i know - have multiple configurations and replicate to different schema. But we might have to be content with 4 different config at the max.
    Any help here will be highly appreciated
    Regards,
    Sesh

    Please take a look at these links related to your query.
    http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
    http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All,
    NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
    I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
    Diagnosis
    Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
    System Response
    Procedure
    Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
    Procedure for System Administration

    OK.
    Well, if the variable is not used in any interval selection, then I would say "something happened to it".
    I would make a copy of the query and run it to check if I get the same problem with period 12.
       -> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
    If so, then try removing the variable completely from the query and hardcode restriction to 12.
       -> If problem still persists, I would have to do some thinking.
    If problem is gone, then add the variable again. Check.
       -> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
    If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
    Good luck!
    Jacob
    P.S: what fisc year variant are you using?
    Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM

  • Logical database in adhoc query

    Hello All,
    Can anyone tell me what is the logical database in adhoc query?

    Hi
    When you create a query , you have to select an infoset. Infoset can be considered as a source from which data is populated in the Query Fields.
    Infosets are created from Transaction SQ02.
    There can be four methods through which an Infoset can become a source of data:
    1.  Table join ( By joining two or more tables from Data dictionary)
         example: Joining tables PA0001 and PA0006 on Pernr to get a one resultant dataset
    2. Direct read of Basis Table ( Like PA0001 as a source for data in Infoset )
    3. Logical Database ( A Pre-written Program by SAP that extract data from clusters, tables taking care of authorizations and validity periods)
    Example : Logical database PNP, PNPCE (Concurrent Employement),PCH ( LDB for Personnel Development Data)
    Custom Logical DBs can be created in T_Code SE-36.
    4. Data Retrieval by a Program ( Custom code written by ABAP developers which will collect and process data) . This program has a corresponding Structure in data dictionary and the fields of this structure will be used in query)
    Reward Points, if helpful.
    Regards
    Waseem Imran

  • Query help on Goods Receipt Query with AP Invoice

    Looking for a little help on a query.  I would like to list all the goods receipts for a given date range and then display the AP Invoice information (if its been copied to an AP Invoice).  I think my problem is in my where clause, I plagerized an SAP query to show GR and AP from a PO as a start.  SBO 2005 SP01.  Any help would be great appreciated.  Thanks
    SELECT distinct 'GR',
    D0.DocStatus,
    D0.DocNum ,
    D0.DocDate,
    D0.DocDueDate,
    D0.DocTotal,
    'AP',
    I0.DocStatus,
    I0.DocNum ,
    I0.DocDate,
    I0.DocDueDate,
    I0.DocTotal,
    I0.PaidToDate
    FROM
    ((OPDN  D0 inner Join PDN1 D1 on D0.DocEntry = D1.DocEntry)
    full outer join
    (OPCH I0 inner join PCH1 I1 on I0.DocEntry = I1.DocEntry)
    on (I1.BaseType=20 AND D1.DocEntry = I1.BaseEntry AND D1.LineNum=I1.BaseLine))
    WHERE
    (D1.BaseType=22 AND D1.DocDate>='[%0]' AND D1.DocDate<='[%1]')
    OR (I1.BaseType=20 AND I1.BaseEntry IN
    (SELECT Distinct DocEntry
    FROM PDN1 WHERE BaseType=22 AND DocDate>='[%0]' AND DocDate<='[%1]'))

    Hi Dalen ,
    I  believe it is because of the condition
    (D1.BaseType=22 AND D1.DocDate>='%0' AND D1.DocDate<='%1')
    OR (I1.BaseType=20 AND I1.BaseEntry IN
    (SELECT Distinct DocEntry FROM PDN1 WHERE PDN1.BaseType=22 AND DocDate>='%0' AND DocDate<='%1'))
    Try changing
    D1.BaseType=22 OR D1.DocDate>='%0' AND D1.DocDate<='%1
    PDN1.BaseType=22 OR DocDate>='%0' AND DocDate<='%1'))
    Lets see what would be the result . Lets have some fun with troubleshooting
    See what would be the difference in the result .
    Thank you
    Bishal

  • Can you check for data in one table or another but not both in one query?

    I have a situation where I need to link two tables together but the data may be in another (archive) table or different records are in both but I want the latest record from either table:
    ACCOUNT
    AccountID     Name   
    123               John Doe
    124               Jane Donaldson           
    125               Harold Douglas    
    MARKETER_ACCOUNT
    Key     AccountID     Marketer    StartDate     EndDate
    1001     123               10526          8/3/2008     9/27/2009
    1017     123               10987          9/28/2009     12/31/4712    (high date ~ which means currently with this marketer)
    1023     124               10541          12/03/2010     12/31/4712
    ARCHIVE
    Key     AccountID     Marketer    StartDate     EndDate
    1015     124               10526          8/3/2008     12/02/2010
    1033     125               10987         01/01/2011     01/31/2012  
    So my query needs to return the following:
    123     John Doe                        10526     8/3/2008     9/27/2009
    124     Jane Donaldson             10541     12/03/2010     12/31/4712     (this is the later of the two records for this account between archive and marketer_account tables)
    125     Harold Douglas               10987          01/01/2011     01/31/2012     (he is only in archive, so get this record)
    I'm unsure how to proceed in one query.  Note that I am reading in possibly multiple accounts at a time and returning a collection back to .net
    open CURSOR_ACCT
              select AccountID
              from
                     ACCOUNT A,
                     MARKETER_ACCOUNT M,
                     ARCHIVE R
               where A.AccountID = nvl((select max(M.EndDate) from Marketer_account M2
                                                    where M2.AccountID = A.AccountID),
                                                      (select max(R.EndDate) from Archive R2
                                                    where R2.AccountID = A.AccountID)
                   and upper(A.Name) like parameter || '%'
    <can you do a NVL like this?   probably not...   I want to be able to get the MAX record for that account off the MarketerACcount table OR the max record for that account off the Archive table, but not both>
    (parameter could be "DO", so I return all names starting with DO...)

    if I understand your description I would assume that for John Dow we would expect the second row from marketer_account  ("high date ~ which means currently with this marketer"). Here is a solution with analytic functions:
    drop table account;
    drop table marketer_account;
    drop table marketer_account_archive;
    create table account (
        id number
      , name varchar2(20)
    insert into account values (123, 'John Doe');
    insert into account values (124, 'Jane Donaldson');
    insert into account values (125, 'Harold Douglas');
    create table marketer_account (
        key number
      , AccountId number
      , MktKey number
      , FromDt date
      , ToDate date
    insert into marketer_account values (1001, 123, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('27.09.2009', 'dd.mm.yyyy'));
    insert into marketer_account values (1017, 123, 10987, to_date('28.09.2009', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
    insert into marketer_account values (1023, 124, 10541, to_date('03.12.2010', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
    create table marketer_account_archive (
        key number
      , AccountId number
      , MktKey number
      , FromDt date
      , ToDate date
    insert into marketer_account_archive values (1015, 124, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('02.12.2010', 'dd.mm.yyyy'));
    insert into marketer_account_archive values (1033, 125, 10987, to_date('01.01.2011', 'dd.mm.yyyy'), to_date('31.01.2012', 'dd.mm.yyyy'));
    select key, AccountId, MktKey, FromDt, ToDate
         , max(FromDt) over(partition by AccountId) max_FromDt
      from marketer_account
    union all
    select key, AccountId, MktKey, FromDt, ToDate
         , max(FromDt) over(partition by AccountId) max_FromDt
      from marketer_account_archive;
    with
    basedata as (
    select key, AccountId, MktKey, FromDt, ToDate
      from marketer_account
    union all
    select key, AccountId, MktKey, FromDt, ToDate
      from marketer_account_archive
    basedata_with_max_intervals as (
    select key, AccountId, MktKey, FromDt, ToDate
         , row_number() over(partition by AccountId order by FromDt desc) FromDt_Rank
      from basedata
    filtered_basedata as (
    select key, AccountId, MktKey, FromDt, ToDate from basedata_with_max_intervals where FromDt_Rank = 1
    select a.id
         , a.name
         , b.MktKey
         , b.FromDt
         , b.ToDate
      from account a
      join filtered_basedata b
        on (a.id = b.AccountId)
    ID NAME                     MKTKEY FROMDT     TODATE
    123 John Doe                  10987 28.09.2009 31.12.4712
    124 Jane Donaldson            10541 03.12.2010 31.12.4712
    125 Harold Douglas            10987 01.01.2011 31.01.2012
    If your tables are big it could be necessary to do the filtering (according to your condition) in an early step (the first CTE).
    Regards
    Martin

  • Query help : Query to get values SYSDATE-1 18:00 hrs to SYSDATE 08:00 hrs

    Hi Team
    I want the SQl query to get the data for the following comparison : -
    Order Created is a Date Column , and i want to find out all the values from (SYSDATE-1) 18:00 hours to SYSDATE 08:00 hours
    i.e.
    (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 08:00:00.
    Regards

    Hi, Rohit,
    942281 wrote:
    If i want the data in the below way i.e.
    from (SYSDATE-1) 18:00 hours to SYSDATE 17:59 hours ---> (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 07:59:00.If you want to include rows from exactly 18:00:00 yesterday (but no earlier), and exclude rows from exatly 08:00:00 today (or later), then use:
    WHERE   ord_dtl.submit_dt  >= TRUNC (SYSDATE) - (6 / 24)
    AND     ord_dtl.submit_dt  <  TRUNC (SYSDATE) + (8 / 24)
    So can i use the below format : -
    ord_dtl.submit_dt BETWEEN trunc(sysdate)-(6/24) and trunc(sysdate)+(7.59/24) . Please suggest . .59 hours is .59 * 60 * 60 = 2124 seconds (or .59 * 60 = 35.4 minutes), so the last time included in the range above is 07:35:24, not 07:59:59.
    If you really, really want to use BETWEEN (which includes both end points), then you could do it with date arithmentic:
    WHERE   ord_dtl.submit_dt  BETWEEN  TRUNC (SYSDATE) - (6 / 24)
                      AND         TRUNC (SYSDATE) + (8 / 24)
                                               - (1 / (24 * 60 * 60))but it would be simpler and less error prone to use INTERVALs, as Karthick suggested earlier:
    WHERE   ord_dtl.submit_dt  BETWEEN  TRUNC (SYSDATE) - INTERVAL '6' HOUR
                      AND         TRUNC (SYSDATE) + INTERVAL '8' HOUR
                                               - INTERVAL '1' SECONDEdited by: Frank Kulash on Apr 17, 2013 9:36 AM
    Edited by: Frank Kulash on Apr 17, 2013 11:56 AM
    Changed "- (8 /24)" to "+ (8 /24)" in first code fragment (after Blushadown, below)

  • Query help, subtract two query parts

    Hi,
    I am beginner of PL/SQL and have a problem I couldn’t solve:
    Table (op_list):
    Item     -     Amount -     Status
    Item1     -     10     -     in
    Item2     -     12     -     in
    Item3     -     7     -     in
    Item1     -     2     -     out
    Item2     -     3     -     out
    Item1     -     1     -     dmg
    Item3     -     3     -     out
    Item1     -     2     -     out
    Item2     -     5     -     out
    Item2     -     2     -     in
    Item3     -     1     -     exp
    Would like to get result of query (subtract amount of 'out/dmg/exp' from 'in' ):
    Item - Amount left
    Item1     -     5
    Item2     -     6
    Item3 -     3
    I wrote code that returns sum of all incoming items and sum all out/dmg/exp items, but couldn’t solve how to subtract one part of querry from another. Or maybe there is a better way. Also worried what happens if there is no 'out/dmg/exp' only 'in'
    select item.name, sum(op_list.item_amount)
    from op_list
    inner join item
    on op_list.item = item.item_id
    where op_list.status = 'in'
    group by item.name
    union
    select item.name, sum(op_list.item_amount)
    from op_list
    inner join item
    on op_list.item = item.item_id
    where op_list.status = 'out'
    or op_list.status = 'dmg'
    or op_list.status = 'exp'
    group by item.name
    Return:
    Item1     -     10      [10 in]
    Item1     -     5     [2+1+2]
    Item2     -     14     [12+2]
    Item3     -     7
    Item3     -     4     [3+1]
    Thanks in advance

    Hi,
    We can also use simple inline views to get what we need.
    select a.item,a.amount-b.amount Balance from
    (select item,sum(amount) Amount from op_list
    where status = 'in'
    group by item) a,
    (select item,sum(amount) Amount from op_list
    where status in ('out','dmg','exp')
    group by item) b
    where
    a.item=b.item
    order by item;
    ITEM       BALANCE
    Item1                      5
    Item2                      6
    Item3                      3Regards,
    Prazy

Maybe you are looking for

  • Itunes Error message everytime I try to open it.

    Hey Guys I need help with iTunes i just recently upgraded my itunes to 7.3 and now every time i open up itunes i get an error message that says an error has occurred and itunes has to shut down. I can't open it. I've uninstalled and installed all dif

  • Photo Booth backdrops not working?? Help

    My Photobooth that was built into my Macbook Pro and it was working perfectly at first. I got my Macbook for christmas, it was brand new and one day the backdrops stopped working for some reason. I will use a back drop and get out the frame as it tel

  • Messages problem with PCSUITE !

    Hello everybody. I have one little problem : This morning i've resofted my phone, Nokia N70 ME, and i have saved all my messages and contacts directly from Nokia PC Suite under their original form : For contacts .vcf and for messages .vmg . I've mana

  • ADS: ICM_HTTP_CONNECTION_FAILED

    Hello, I am facing some issues with the ADS configuration. I checked all the programs (FP_TEST_00 and FP_PDF_TEST_00) and i keep getting into this error: Error Code: 100.101 Error Message: SOAP Runtime Exception: CSOAPExceptionTransport : HTTP receiv

  • TS1253 Brother laser printer not responding

    My old Airport Extreme Base Station (the white flying saucer one) was acting flakey and I replaced it with a new Airport Extreme Base Station. I set up the new base station and hooked up a Brother HL-5070N laser printer to the base station with Ether