Merge multiple source table dates and to one target table

The requirement is to merge multiple source tables (each table has a set of start and end date) to one target table with one set of start and end date and contain the date relevant column values from each source table.  Payment source tablestart dateend datepayemnt1/1/201512/31/2015301/1/201612/31/999960Position source tablestart dateend dateposition1/1/201512/31/2016101/1/201712/31/999920Target tablestart dateend datepayemntposition1/1/201512/31/201530101/1/201612/31/201660101/1/201712/31/99996020 What transformation(s) will be best to use to handle this requirement? Thanks, Lei

Thanks Karen,
that was exactly what i was hoping for.
Maybe it could be made easier/less confusing if the Mapping Workbench just made you choose a target table. But maybe this is not usefull if the table contains two foreign keys to the same table. Or maybe this should just be put somewhere in the documentation.
Regards,
Robert
Hi Donald,
fortunately i'm my own DBA so i don't have any problems ;-). However i'm certainly interested in the reasons for not having such a conditional foreign key.
However actually the foreign key isn't conditional, the condition is that either the field (using the FK) must be filled, or a free-format field. The reasoning for this is that we have a list of known towns and if the addres is local a town from that list must be chosen. If the addres is outside the country a town can just be typed in (no list).
Concerning the agrregate, all fields are always used. There are no neediness flags anywhere. The aggregate contains three fields which are mapping as direct (two fields) or a One-to-one (the FK). All 'parents' all contains these three fields.
Regards,
Robert

Similar Messages

  • Modify table data and import to same bapi function module

    Hai friends,
    I have a requirement on bapi , such that after executing the bapi function module data comes on tables and again  i need enter  weight in weight column field in the same table data and pass the same table in the same bapi function module .
    plz sujjest.
    with reagards,
    prasad.

    Can  u explain in details,
    means which bapi r u using? where  u will enter weight? etc.

  • How to compare table data and table field

    Hi buddy,
        I have some question about how to compare table data and table field.
       1. I know there is one method:   CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS  , it use in unit test to compare the table data(A and B) , you can loop table A into structure A1, then use this mehtod it can compare whether table B contain structure A1.  but when I try to use this in main program it will dump.
              CL_ABAP_UNIT_ASSERT=>ASSERT_TABLE_CONTAINS(
                                                                                                        LINE    = A1
                                                                                                        TABLE = B ).
           Is there any method or FM can be used to compare the table data ?
        2. I also want to compare two table field , try to find out the different. How to realize this.
    Thank you for your sincerely answer.

    Hi Zongjie,
    What`s the difference, if you using loop A into wa_A, read table B into wa_B with all field, then compare with wa_A and wa_B.
    The question 2, seems no standard FM available here.
    Loop A into wa_A.
       Loop B into wa_B.
           if wa_A-field1 eq wa_B-field1.
           endif.
            if wa_A-field2 eq wa_B-field2. 
           endif.
       endloop.
    endloop.
    regards,
    Archer

  • How to make a copy of an application with its schema-tables,data and all

    Good day,
    I am looking for the best way to make a copy of an application from one computer to another, including the schema (tables, data and all) in Apex3.2.
    I can only manage to make a copy of the application without the data using the export utility
    Please assist with this difficulty
    Kind Regards
    Thabo
    Edited by: Thabo K on Jun 1, 2009 1:13 AM

    Hello,
    To copy across the data you can use the traditional EXP/IMP or the Datapump utility.
    If you're used to using EXP/IMP I'd encourage you to look at Datapump, if you haven't used EXP/IMP before I'd encourage you to look at Datapump (datapump rocks) -
    http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
    There are a few major differences between Datapump and traditional EXP/IMP (EXP/IMP creates the export file on the client side, Datapump creates it on the server side etc).
    In my book "Pro Oracle Application Express" I have a section on cloning applications/data between instances, which you might find useful.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Find record insert date and time in a table

    Hi All,
    I want to get record insert date and time in a table. There is no datetime column in my table. Are there any possibility to get date and time for each record?
    Thank You

    Thats not easy. If your transaction info still resides on active portion of the log you can use fn_dblog to read out the time at which the transactions occurs. This is useful only if you try it shortly after transaction.
    the code would look like this
    SELECT *
    FROM fn_dblog(null,null)
    WHERE [Transaction Name] LIKE 'INSERT%'
    OR [Transaction Name] LIKE 'UPDATE%'
    Also see
    http://www.mssqltips.com/sqlservertip/3076/how-to-read-the-sql-server-database-transaction-log/
    http://solutioncenter.apexsql.com/read-a-sql-server-transaction-log/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Accessing sap tables data and display in webi

    Hi all,
    i installed business objects edge series.
    i want to access SAP tables data and display in webi for adhoc reporting.
    Is there any process to achieve this.

    Hi
    currently (April 2010) you have the following options:
    1. You load your R/3 data into an SAP BW and use universes based on BEx queries to create WebI reports
    2. You can use SAP rapid marts. They contain Data integrator mappings (you need an installation of the DI for this) to extract and load your SAP R/3 data into a relational database. Additionally they provide universes (based on a relational schema) hich ill allo you to build WebI reports.
    3. You can use the R/3 connector for the Data Federator (You need a DF installation for this). Please note that the R/3 connector is not yet a product rather just a PROTOTYPE. Take a look here: SAP BusinessObjects Web Intelligence Reporting for SAP ERP [original link is broken]
    4. You can try to access the underlying database directly using the appropriate DB drivers. Please note that this is NOT RECOMMENDED. This way you cannot leverage security defined on the R/3 side in your WebI reports and you will not be able to access all data as available in R/3 since some of them are stored encoded/compressed in the underlying tables.
    5. Instead of WebI you can use Crystal Reports and the R/3 drivers (eg. SAP Tables, Functions, Cluster) provided when installing the integration kit for SAP.
    Regards,
    Stratos

  • Diference between DATA: and TYPES: on internal tables

    Hi people,
    Can somebody help me. I wanna know whats the diference between DATA: and TYPES: on internal tables
    and whitch has the best performance, here is a eg:
    DATA: BEGIN OF ti_sbook occurs 0,
              carrid   LIKE sbook-carrid,
              fldate   LIKE sbook-fldate,
              customid LIKE sbook-customid,
              loccuram LIKE sbook-loccuram,
           END OF ti_sbook.
    AND
    TYPES: BEGIN OF ti_sbook ,
              carrid   LIKE sbook-carrid,
              fldate   LIKE sbook-fldate,
              customid LIKE sbook-customid,
              loccuram LIKE sbook-loccuram,
           END OF ti_sbook.
    DATA: gw_sbook       TYPE  TABLE OF ti_sbook,
    gs_sbook       TYPE ti_sbook.
    witch of both types is better?
    thanks.

    Hi Marcelo,
    For compatibility matters is better to create internal tables with a work area separately. So yes it's better to use types. When you work with Object Oriented coding you will need to use internal tables defined with types. Also when defining tables with types is the new way of coding, the another coding is getting obsolete defined by SAP. That's why when working in ABAP with OO (Object Oriented) code you'll have to define tables with types and not the other way.
    Hope it helps.
    Regards,
    Gilberto Li

  • How can we delete SID table data and Text table data

    Hi,
    How can we delete SID table data and Text table data of any
    InfoObject.

    Hi,
    Go to transaction SE14, give the technical name if the table:
    /BIC/T<InfoObject Name>   for Text Table
    /BIC/S<InfoObject Name>  for SID Table
    Select "Table" in the given 4 options below  &  hit Edit button.
    in the next screen select "Direct"
    & also select "detele data" radio button.
    & hit  "Activate & adjust database".
    this will delete the complete data from the tables.
    Note: before deleting the SID's make sure of the consequences & after effects.
    Also the SID gets generated the next time you load master data/transaction data only for those records which were loaded..
    Regards,
    Iliyas

  • How to delete the data loaded into MySQL target table using Scripts

    Hi Experts
    I created a Job with a validation transformation. If the Validation was failed the data passed the validation will be loaded into Pass table and the data failed will be loaded into failed table.
    My requirement was if the data was loaded into Failed database table then i have to delete the data loaded into the Passed table using Script.
    But in the script i have written the code as
    sql('database','delete from <tablename>');
    but as it is an SQL Query execution it is rising exception for the query.
    How can i delete the data loaded into MySQL Target table using scripts.
    Please guide me for this error
    Thanks in Advance
    PrasannaKumar

    Hi Dirk Venken
    I got the Solution, the mistake i did was the query is not correct regarding MySQL.
    sql('MySQL', 'truncate world.customer_salesfact_details')
    error query
    sql('MySQL', 'delete table world.customer_salesfact_details')
    Thanks for your concern
    PrasannaKumar

  • Creating 2 table maintainance views for one custom table

    Hello All,
    I want to create 2 table maintainace views for one custom table.
    I know how to create table maintainace but I want to know whether we can create only one maintainance view or we cal also create 2 maintainace views for a single custom table.
    Regards
    Mahesh

    Hello,
    You can create as many maintenance views one one table as you want.
    Kind regards,
    Bart

  • Mapping Issue with 7 source tables and one target table in one step

    Hi,
    Request for a small help in OWB.
    I am trying to map 7 source tables to a single target table in one step.These source tables are in Oracle 10G database but dont have PK and FK relation ship.
    I am able to link one table to the target by pointing some of the columns. But when coming to the second table it is giving some error message :
    Ap18003: Connection target attribute group is already connected to a incompatible data source. Use a joiner or set operator to join the upstream data first before connection it to this operator.
    As per the error message I used a Join operator and tried to map the second table to the target but still giving me the same error message. Could some body give me a hand to give out from this step.
    Thanks for your help in advance.
    Cheers,
    Krishna.

    Hi,
    like this:
    Ingroup1
    - id -> Number(9,0)
    - name -> VARCHAR2(500)
    Ingroup2
    - my_id -> Number(9,0)
    - name -> VARCHAR2(500)
    Outgroup
    - id -> point to target_table.id
    - name -> point to target_table.name
    Not:
    Ingroup1
    - id -> Number(9,0)
    - name -> VARCHAR2(500)
    Ingroup2
    - name -> VARCHAR2(500)
    - my_id -> VARCHAR2(9)
    Regards
    Detlef
    null

  • One target table is loading from two different source but same columns but one source is in a database and other is in a flat file.

    Hope you all are doing good.
    I have a business issue to be implemented in ODI 11G. Here it is. I am trying to load a target table from two sources having same coulmn names. But one source is in file format and other is in Oracle Database.
    This is what i think i will create two mappings in the same interface using Union between the sources. But i am not sure how the interface would connect to different logical architecture to connect to two different sources.
    Thanks,
    SM

    You are on the right track, this can all be done in a single interface. Do the following
    1) Pull your file data model into the source designer and and your target table model to the target pane.
    2) Map all the relevant columns
    3) In the source designer create a new dataset and choose the UNION join type (this will create a separate tab in the source designer pane)
    4) Select the new dataset tab in the source designer pane and pull your source oracle table data model into the source designer. Map all the relevant columns to the target
    5) Make sure that your staging location is defined on a relational technology i.e. in this case the target would be an ideal candidate as that is where ODI will stage the data from both file and oracle source and perform the UNION before loading to the target
    If you want to look at some pretty screenshots showing the steps above take a look at http://odiexperts.com/11g-oracle-data-integrator-part-611g-union-minus-intersect/

  • How to Read the one Source Column data and Display the Results

    Hi All,
         I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
    Ex:
    Pr_ProjectType
    AD,AM
    AD
    AM
    AD,AM,TS,CS.OT,TS
    AD,AM          
    like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
    4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.
    this logic we need we have thousand of data in the table.Please help this is urgent issue
    vasu

    Hi Vasu,
    Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
    are two approaches for your reference:
    Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
    for the custom function is as follows:
    CREATE FUNCTION dbo.udf_GetNumeric
    (@strAlphaNumeric VARCHAR(256))
    RETURNS VARCHAR(256)
    AS
    BEGIN
    DECLARE @intAlpha INT
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
    BEGIN
    WHILE @intAlpha > 0
    BEGIN
    SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
    END
    END
    RETURN ISNULL(@strAlphaNumeric,0)
    END
    GO
    The SQL commands used in the OLE DB Source is like:
    SELECT
    ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
    FROM MyTable
    Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
    characters to the corresponding substring. The script is as follows:
    using System.Text.RegularExpressions;
    Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
    References:
    http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/ 
    http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • Merge update source table and delete from target table problem

    Hello Friends, 
    I am a newbie in SQL Server world and I am in a situation where I need to delete the bunch of records from the TARGET table using the values from the SOURCE table. 
    The TARGET table has close to 400 Million records, so I need to delete the records in small batches of about ~10,000 rows.
    I figured out a way to delete in batches by refering the following 2 posts
    http://sqlperformance.com/2013/03/io-subsystem/chunk-deletes
    http://dba.stackexchange.com/questions/1750/methods-of-speeding-up-a-huge-delete-from-table-with-no-clauses
    I think my best option to delete and update in 1 pass would be through using Merge statement, so for that I constructed following SQL.
    MERGE dbo.table1 AS TARGET
    USING 
    SELECT File_name FROM dbo.table2
    WHERE  FILE_DESC = 'EDI'
    AND [Processed_date] < DATEADD (WEEK, -10, Getdate ()) AS SOURCE
    ON (TARGET.File_name = SOURCE.File_name)
    WHEN MATCHED THEN DELETE (FROM THE TARGET)
    WHEN MATCHED 
        THEN UPDATE SET SOURCE.PROCESS_delete_date = GETDATE()
    But, when executed, it throws following error and I am struggling to figure out what is wrong with the above syntax. 
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'SELECT'.
    Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'AS'.
    Can any expert please help a newbie as I learn the new way.
    Thanks a lot.

    Visakh, we can have more than 1 matched clause in merge as per the Microsoft sql statement, but we need to add a condition along with the match. thanks for your prompt response on this query. your query is logically fine but when executed, it throws
    following error. Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'DELETE'. Msg 102, Level 15, State 1, Line 8 Incorrect syntax near ')'. remember, my server machine is 2005 version & my work machine is 2012. dont know why your query
    is not working.
    MERGE is available only from 2008 onwards
    Yes you're correct but again not more than two  MATCHED clauses even if you specify condition
    see MSDN documentation below
    WHEN MATCHED THEN <merge_matched>
    Specifies that all rows of target_table that match the rows returned by <table_source> ON <merge_search_condition>, and satisfy any additional search condition, are either updated or deleted according to the <merge_matched> clause.
    The MERGE statement can have at most two WHEN MATCHED clauses. If two clauses are specified, then the first clause must be accompanied by an AND <search_condition> clause
    from
    http://msdn.microsoft.com/en-us/library/bb510625.aspx
    Also I guess Composable DML which used is also not present in 2005
    So in your case you can try this instead
    DECLARE @DELETED_FILES table
    File_Name varchar(100)
    DELETE t
    OUTPUT DELETED.File_Name INTO @DELETED_FILES
    FROM dbo.table1 t
    INNER JOIN dbo.table2 s
    ON t.File_name = s.File_name
    WHERE s.FILE_DESC = 'EDI'
    AND s.[Processed_date] < DATEADD (WEEK, -10, Getdate ())
    UPDATE r
    SET r.Process_Delete_Date = GETDATE()
    FROM dbo.table2 r
    INNER JOIN @DELETED_FILES AS p
    ON p.File_Name = r.File_Name
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

Maybe you are looking for

  • Authorization objects for BP in CRM 2007

    Hi, right now i'm struggling with the standard authorizations for the BP in the WEB UI. We want to restrict access to BP by role. There is the standard object B_BUPA_RLT which worked before in SAP GUI. The object is still relevant but in our system j

  • Payment Medium Workbench Variants (SAPFPAYM)

    Hello all, We have been succesfully using the PMW for some months now, so I am familiar wih the customizing. However, due to new customer requirements, we need the user to be able to select the variant for SAPFPAYM in F110. I know that it is maintain

  • Changing default "General Ledger Account" in F-02

    Hi, How can I change the default value of "General Ledger Account" in the second screen of F-02. I require this change only when the type is "Asset Purchasing" and the posting key is "31-Invoice". Is there a user exit or BTE which I can use?

  • Error 3001 when trying to watch a rented movie

    I've rented my first movie off iTunes Movie Rentals (Fantastic 4 - Silver Surfer). The file downloaded fine, but at the end of the download it shows error 3001 (There was a problem, etc.) but gives no specifics. I tried it on my MacBook Pro and my gi

  • Change of decimal separator

    Is it possible to change the decimal separator for importing data? I have data with , as separator can I change the default Point to comma? Thanks for your interest Thomas Pfeiffer Message Edited by Thomasrp on 02-16-2006 10:10 AM Solved! Go to Solut