Clearing WHT on advance & Invoice with same value

Hi SAP Gurus
Could anybody suggest me what transaction code to be used or need any configuration change for clearing both the doc i.e. WHT deduct on advance payment with WHT deducted on Invoice with same value.
In this scenario no further payment should be made.
I have linked both the doc through TCode F-54 and try to clear both the doc with TCode F-44 but in this transaction no tds has been reveresed by the system and showing difference.
In Partial advance payment the system has automatically reversed the TDS. No problem occured in this scenario.
Regards
Aman
Edited by: Amandeep Garg on Mar 17, 2008 10:43 AM

Hi Ahmed
Thanx for your response...............
But I have already used the same. Is there not any transaction other than F-53 in which bank is not  invovled.
Regards
Aman

Similar Messages

  • Compare two invoices with same distribution line count

    I am trying to pull data out of Oracle Payables - invoices for which the invoice amount ,the vendor and distribution line count is same.
    I could achieve pulling invoices with same Vendor having same amount.But finding hard to compare the counts.
    Can anyone share ideas on how to achieve this ... Tried self join but did not work.
    The query which I used is as follows :
    select invoice_num,invoice_id,invoice_amount,vendor_id,
    (select vendor_name from apps.po_vendors where vendor_id=aia.vendor_id) vendor_name,
    (select count(*) from apps.ap_invoice_distributions_all aid where aid.invoice_id=aia.invoice_id) line_count
    from apps.ap_invoices_all aia
    where invoice_amount in (select aiab.invoice_amount
    from apps.ap_invoices_all aiab
    where aiab.creation_date >='01-AUG-2012'
    and vendor_id=aia.vendor_id
    group by aiab.invoice_amount
    Having (count(aiab.invoice_amount) >1))
    and aia.creation_date >='01-AUG-2012'
    Thanks in Advance.

    I did try your query with sample records and counts are also correct plz chk the following, for me counts are correct as per your logic -
    select aia.invoice_num,aia.invoice_id,aia.invoice_amount,aia.vendor_id,
    (select vendor_name from
    (select 'XX' vendor_name, 'A' vendor_id from dual union all
    select 'XY' vendor_name, 'B' vendor_id from dual union all
    select 'XZ' vendor_name, 'C' vendor_id from dual union all
    select 'XA' vendor_name, 'D' vendor_id from dual ) po
    where vendor_id=aia.vendor_id) vendor_name,
    (select count(*) from
    (select 1 invoice_id from dual union all
    select 1 invoice_id from dual union all
    select 1 invoice_id from dual union all
    select 2 invoice_id from dual union all
    select 3 invoice_id from dual ) aid
    where aid.invoice_id=aia.invoice_id) line_count
    from
    select 10 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 11 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 12 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 13 invoice_num, 2 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 14 invoice_num, 2 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 15 invoice_num, 3 invoice_id,100 invoice_amount, 'C' vendor_id ,'01-SEP-2012' creation_date from dual union all
    select 16 invoice_num, 4 invoice_id,100 invoice_amount, 'D' vendor_id,'01-OCT-2012' creation_date from dual) aia
    where aia.invoice_amount in (select aiab.invoice_amount
    from
    select 10 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 11 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 12 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 13 invoice_num, 1 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 14 invoice_num, 1 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 15 invoice_num, 1 invoice_id,100 invoice_amount, 'C' vendor_id ,'01-SEP-2012' creation_date from dual union all
    select 16 invoice_num, 1 invoice_id,100 invoice_amount, 'D' vendor_id,'01-OCT-2012' creation_date from dual) aiab
    where aiab.creation_date >='01-AUG-2012'
    and aiab.vendor_id=aia.vendor_id
    group by aiab.invoice_amount
    Having (count(aiab.invoice_amount) >1))
    and aia.creation_date >='01-AUG-2012'
    o/p
    INVOICE_NUM,INVOICE_ID,INVOICE_AMOUNT,VENDOR_ID,VENDOR_NAME,LINE_COUNT
    10,1,100,A,XX,3
    11,1,100,A,XX,3
    12,1,100,A,XX,3
    13,2,100,B,XY,1
    14,2,100,B,XY,1
    -------

  • Updating PK with same value - effect on CASCADE UPDATE

    Hello,
    I would like to understand how sql server 2008 deals with cascade updates
    For example I have
    Parent table: Employee with column Id as varchar(20) primary key
    Child table with IdEmployee as varchar(20) foreign key
    I set up Cascade Update for those two tables, meaning any change to primary key in Employee table will cause update in child table rows that match affecting Id
    Scenario 1:
    Update Employee
    set Id = 'ABC',
    Name = 'something new'
    where Id = 'CCC'
    Result of child table: all rows with foreign key IdEmployee and value of 'CCC' are updated. Expected behavior.
    Scenario 2:
    Update Employee
    set Id = 'ABC',
    Name = 'something new 2'
    where Id = 'ABC'
    This time, i am doing something different. I am beside update of column Name with new value, also update primary key but
    with SAME value
    Question is: what is going to happen to child rows? Are they ALL going to UPDATE due to CASCADE UPDATE
    So far, what i did in order to find solution is:
    1. I put an timestamp column in child table that should update each time row gets updated
    2. I put a trigger for update event on child table that will write something to some log table
    *After I set up those two I ran example like above just to be sure timestamp gets changed as well trigger is being fired
    Results of updating PK with same value:
    1. Timestamp didnt change
    2. Trigger didnt fire
    Is this enough to make conclusion that updating primary key with same value ALONG with updating some other columns won't
    affect child tables with UPDATE CASCADE ON
    Update:
    Database is CI AS collation
    If i do following
    Update Employee
    set Id = 'abc',
    Name = 'something new'
    where Id = 'ABC'
    1. Timestamp will change
    2. Trigger will fire
    Conclusion: Case sensitive is important here!
    Thank you very much in advance
    Milos

    >>  would like to understand how sql server 2008 deals with cascade updates <<
    Your posting has a number of conceptual errors. 
    1. The terms “parent” and “child” are not RDBMS; they are used in network databases. We have “referenced” and “referencing” tables; they can be the same table.
    2. A table models a SET of things, so there is no “Employee” table unless you truly have a one-man company. We want a collective or plural name for the SET/table. A better name is “Personnel” for this table. 
    3. Her is no such thing as a generic “id” in RDBMS; it has to be “<something in particular>_id” to be valid. Identifiers are usually fixed length 
    4. It is very, very rude not to post DDL on a forum. You also do not know the ISO-11179 Rules for data element names. They do not change names from table to table! Does your name change whenever you use it in a new place?? NO! Same principle with data. 
    5. The ISO standard uses “<property>_<attribute property>” syntax, no the old PascalCase.
    6. Why did you post a useless narrative? How do we compile “I SET up Cascade UPDATE for those two tables,..” to test it?? 
    CREATE TABLE Personnel
    (emp_id CHAR(20) NOT NULL PRIMARY KEY,
     emp_name VARCHAR(25) NOT NULL,
    CREATE TABLE Health_Plan
    (health_plan_acct CHAR(20) NOT NULL PRIMARY KEY,
     emp_id CHAR(20) NOT NULL 
     REFERENCES Personnel(emp_id)
     ON UPDATE CASCADE
     ON DELETE CASCADE,
    Scenario 1:
    UPDATE Personnel
       SET emp_id = 'ABC',
           emp_name = 'something new'
     WHERE emp_id = 'CCC';
    Result of child table: all rows with foreign key emp_id and value of 'CCC' are updated. Expected behavior.
    Scenario 2:
    UPDATE Personnel
       SET emp_id = 'ABC',
           emp_name = 'something new 2'
     WHERE emp_id = 'ABC';
    This time, I am doing something different. I am beside UPDATE of column emp_name with new value, also UPDATE PRIMARY KEY but
    with SAME value.
    >> Question is: what is going to happen to child [sic: referencing]  rows? Are they ALL going to UPDATE due to CASCADE UPDATE. <<
    SQL uses a set-oriented model, so the whole table is updated as a unit of work in theory. 
    So far, what I did in order to find solution is:
    >> I put an timestamp column in child [sic: referencing] table that should UPDATE each time row gets updated <<
    Why? It is not in the SET clause list; it cannot change. As an aside,  The T-SQL TIMESTAMP is not the ANSI/ISO TIMESTAMP; it is DATETIME2(n) in T-SQL. The old TIMESTAMP is being deprecated because it stinks both in concept and implementation. 
    >> I put a trigger for UPDATE event on child [sic: referencing] table that will write something to some log table.<<
    TRIGGERs are fired by what is called a “database event” shown in the ON [DELETE | UPDATE] clause. T-SQL adds INSERT as an event. An update to any value or to no value at all is still an update. Depending on the collation, case may or may not matter in the final
    outcome. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Vendor Invoice with Same Reference Number in two fiscal years.

    Vendor Invoice entered in SAP.
    DocumentNum 1600000612  Reference "47026723WA" Vendor Number "637278" Year "2008"
    DocumentNum 1600000667  Reference "47026723WA" Vendor Number "637278" Year "2009"
    We are thinking SAP will not allow/generate invoice with same Reference number. How can we restrict from entering Vendor invoices with Same Reference Number from same Vendor.
    Thanks
    Raghuram

    Restrict it through message control
    Transaction code OBA5
    Message NO.121
    Make it error for batch and online.
    Thanks,
    Ravi

  • Second Invoice PLD should have value of First Invoice with same SO

    Hi All,
    The scenerio is as such a Sales Order is created for the value of 1000. Now based on this sales order a partial invoice No 1 is created for 500. Again after somedays based on the same sales order another invoice No 2 is created for 300. Now in the Invoice No 2 prinout I want that Invoice Number 1 value which is 500 should also come.
    How to achive this in PLD.
    Regards,
    Kawish

    Hello Kawish,
    In the scenario you just described, only two invoices will be created to complete one sales order.
    Could you create a UDF on the invoice header linked to the following query
    SELECT  T0.DocTotal
    FROM OINV T0 INNER JOIN INV1 T1 On T0.DocEntry = T1.DocEntry
    WHERE T1.BaseRef = $[$38.44.0]
    refreshed on a header field that will always change once a line is entered (Doc Total for example).
    This will populate the UDF with the previous amount  and you just need to use that field in the PLD.
    Kind regards,
    Frederic
    TESTED IN 2007A PL44 - You could apply the same logic with the Invoice Doc Number in another UDF so you can show the first invoice price and doc number. And if you call the docnumber as well, than we can apply he logic to more than 2 invoices.

  • Excise invoice with zero values

    Hi  SAP Gurus,
    In CIN, when I created excise invoice with Tcode J1IIN with reference to invoice, I found zero values. When I checked the pricing conditions tab in Billing, I observed that condition types JEXT and JECT are having zero values. Why the system is not picking the values for these condition types, though condition records are being maintained.? In my pricing procedure there is no UTXJ conditon type. Should I maintain the condition records for UTXJ though it is not in our pricing procedure?, since UTXJ is  link between tax procedure, pricing procedure and tax code. I expect guidance in this regard..
    Thanks in advance
    Raksha.

    Hi Raksha
    UTXJ is the only condition which brings the tax code in the document, please add utxj and then check it will definately work. I am not replying in detail so if u want any other clarification please reply back.
    Best regards
    Vineet Baweja

  • Moveing average price after posting invoice with different value  than GR

    Hello all
    I have a question as in subject.
    If I will post goods receipt and after this I would like to post an invoice in MIRO with different value than in goods receipt , the MAP on my stock will change about this different???

    Hi,
    Your MAP will get recalculated as the price difference will change the total value of the stock and the stock quantity will remain the same
    MAP=Total value/Total stock
    Hope this will help you
    Reward if useful
    Thanx and Regards
    SHYAM.R

  • Two deductions for invoice with same reason code posted as one line item

    Hi
    We have a scenario wherein we are taking two or more deductions on the same invoice and are using the same reason code which have a setting of charge off.
    SAP system displays the FI posting with same reason codes with charge off setting as one line item.
    However we want the FI Posting to display separate line items per deduction and not combine amounts of deductions based on same reason code with charge off setting.
    Any comments are appreciated.
    Edited by: Kirti Bhardwaj on Jul 24, 2011 9:46 AM

    Hi,
    you can use different reason codes in distribute differences screen once you have fist selected one reason code for one invoice.

  • TCode MIR7: Dump while deleting Parked Invoice with zero value

    Hi,
    We had parked an Invoice using TCode MIR7 with Zero Value with reference of a PO. Now as the value of invoice is zero, we want to delete it using MIR7.
    In MIR7, when we go to Invoice Document-->Delete, it results in dump. Dump is as follows:
    Error analysis
        Short text of error message:
        No document found
        Long text of error message:
        Technical information about the message:
        Message class....... "FI"
        Number.............. 124
        Variable 1.......... " "
        Variable 2.......... " "
        Variable 3.......... " "
        Variable 4.......... " "
    How to correct the error
        Probably the only way to eliminate the error is to correct the program.
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "MESSAGE_TYPE_X" " "
        "SAPLFMPR" or "LFMPRU05"
        "FM_CO_DOCUMENT_DELETE"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
        4. Details about the conditions under which the error occurred or which actions and input led to the error.
    Information on where terminated
        Termination occurred in the ABAP program "SAPLFMPR" - in
         "FM_CO_DOCUMENT_DELETE".
        The main program was "SAPLMR1M ".
        In the source code you have the termination point in line 34
        of the (Include) program "LFMPRU05".
    Any help.
    Regards,
    CMC Team.

    Hi,
    Check following SAP notes:-
    1173846  (MM) Termination when deleting prepaid logistics invoices
    Reason and Prerequisites
    This problem is caused by a program error.
    1224772  (MM) Error message FI24 when deleting parked invoices
    Reason and Prerequisites
    This is due to a program error. The total amount of the parked invoice is '0'.
    Regards,
    Anand Raichura

  • JTree + FK with same value causing problems

    Hi
    I can't figure this out. If I create biz components for 2 tables having a parent-child relationship and a jTree with appropriate rules, things are ok only if the parent's id are of different values than the child. When parent.id and child.id have the same values the jTree seems to recursively fire valueChanged() at strange times.
    Example:
    CREATE TABLE PARENT
    PARENT_ID NUMBER CONSTRAINT PARENT_ID_NN NOT NULL,
    PARENT_NAME VARCHAR2(40 BYTE),
    CONSTRAINT PARENT_C_ID_PK
    PRIMARY KEY
    (PARENT_ID)
    CREATE TABLE CHILD
    CHILD_ID NUMBER CONSTRAINT CHILD_ID_NN NOT NULL,
    CHILD_NAME VARCHAR2(40 BYTE),
    PARENT_ID NUMBER,
    CONSTRAINT CHILD_C_ID_PK
    PRIMARY KEY
    (CHILD_ID)
    ALTER TABLE CHILD ADD (
    CONSTRAINT PARENT_FK
    FOREIGN KEY (PARENT_ID)
    REFERENCES PARENT (PARENT_ID));
    INSERT INTO PARENT VALUES (1, 'Parent 1');
    INSERT INTO PARENT VALUES (2, 'Parent 2');
    INSERT INTO PARENT VALUES (3, 'Parent 3');
    INSERT INTO CHILD VALUES (100, 'Child A', 1);
    INSERT INTO CHILD VALUES (200, 'Child B', 2);
    INSERT INTO CHILD VALUES (300, 'Child C', 3);
    I use the JDev 10.1.2 wizard to create biz components and test the AppMod to make sure the link works. Now I create a blank panel and drag over the ParentView data control. Using the jTree tree binding editor I create two rules:
    1) DataCollectionDef.ParentView - DisplayAttribute.ParentName - BranchRuleAccessor.ChildView
    2) DataCollectionDef.ChildView - DisplayAttribute.ChildName
    Now I add a tree selection listener:
    jTree1.addTreeSelectionListener(new TreeSelectionListener()
    public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (selectedNode != null)
    System.out.println(selectedNode.getUserObject().toString());
    When I run my panel and watch in JDev everything is fine, i.e. nothing is printed to the screen when it first loads and when I click a node, the correct UserObject prints.
    Here's the rub, now I close the panel and update my child table as follows:
    UPDATE pdssuser.child SET child_id = 1 WHERE child_id = 100;
    UPDATE pdssuser.child SET child_id = 2 WHERE child_id = 200;
    UPDATE pdssuser.child SET child_id = 3 WHERE child_id = 300;
    This time, when I run my panel, the console shows that valueChanged() has been fired 3 times on load:
    Parent 1
    Parent 2
    Parent 3
    This behavior is causing problems with my real tree.
    I haven't had any luck finding threads about this. Any ideas?
    Thanks
    John

    ok, last one (i hope)
    The same issue occurs with 10.1.2.1
    ...but changing the location where I add the treeSelectionListener to after setBindingContext() seems to fix the problem.
    The second call to panelBinding.refreshControl() in setBindingContext() (the one after the call to jbinit()) is what fires the valueChanged events. Somewhere in there, DCBindingContainer.java or DCIteratorBinding.java, the treeSelectionListener is hearing that a value changed (maybe due to a query execution?). I guess the jTree1.setModel(...) call in jbinit() simply sets up the tree but the VO queries described in the Branch Rule accessors are executed on the refreshControl.....i'm out of my comfort zone here and may be confusing you with my "troubleshooting" so I'll just tell you my work-around.
    So to fix it I add the treeSelectionListener in my main method (not jbinit()) after the setBindingContext() has been called.
    I still have no idea why the FK triggers this behavior...but at least it's working.
    * the main method
    public static void main(String [] args)
    try
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception exemp)
    exemp.printStackTrace();
    Panel1 panel = new Panel1();
    panel.setBindingContext(JUTestFrame.startTestFrame("DataBindings.cpx", "null", panel, panel.getPanelBinding(), new Dimension(400, 300)));
    panel.revalidate();
    // Now add the treeSelectionListener
    panel.addSelectionListener();
    * the JbInit method
    public void jbInit() throws Exception
    this.setLayout(borderLayout1);
    this.add(jTree1, BorderLayout.CENTER);
    jTree1.setModel((TreeModel)panelBinding.bindUIControl("ParentView1", jTree1));
    // DON'T ADD treeSelectionListener here
    * Add the selection listener to the tree
    public void addSelectionListener()
    jTree1.addTreeSelectionListener(new TreeSelectionListener()
    public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (selectedNode != null)
    System.out.println(selectedNode.getUserObject().toString());
    }

  • Hold and Post Invoice with Same Reference

    Hi,
    We have activated the check for duplicate invoices.
    Now, we hold an invoice with reference 123 in MIRO.  Then, we click on worklist and open the held invoice and post it.  But the system throws a duplicate invoice error.
    Why is the system checking duplicate invoice where it is actually the same invoice?
    Am I doing something wrong?
    Thanks.

    Hello,
    Invoice Duplication check takes place when we try to post an invoice based on the configuration. Our finding is that this check will not take place at the time of creation of invoice.
    However, this check can be introduced during the creation of invoice in user exit EXIT_SAPLMRME_003 and you have all the parameters for this check here.
    Thanks,
    Venu

  • Update commercial invoice with excise values

    Hi friends,
        We have implemented depot sales; End user made first two invoices with my presence its worked fine. After one day he made third invoice with out my presence, this invoice is not capturing excise values like BED, AED, ECS and S & H cess. After this I found a route cause that
    user has selected JF delivery document type instead of LF. Here I canu2019t cancel the OBD and excise invoice since a manual commercial invoice is already sent to customer with some commercial invoice no, say XXXXX196. So when I create commercial Invoice, invoice should generate with XXXXX196 no.
    I canu2019t save billing document created with reference OBD because commercial invoice is not capturing the excise values and here I canu2019t key in excise values manually because all excise condition types are In grayed status, But some how I need to update all excise values. So can you please help me how do I can go ahead?
    Thanks,
    Krishna Reddy

    Normally VAT is not calculated on the BED/ECESS etc and the VAT is calculated on the Basic price.
    What seems in your case is that the pricing procedure is configured based on this logic. For calculating VAT , the system refers to a tax base value , which is condition type. So in your case the tax base value would be excluding the BED/ECESS and other taxes in the current pricing procedure.
    Modify your pricing procedure and get the New tax base value which should included BED/ECESS etc.
    Now your VAT condition type should refer to this new tax base value for calculating the VAT ( tax).
    This will solve the problem.
    Ashok Chauhan

  • Smartforms - kbetr (curr11) in invoice with wrong values

    Hello,
    I am developing an invoice, and this invoice is built on the standard lb_bil_invoice Smartform. The "only" thing not being standard, is that I have to read the kondition items on position level and print them here.
    I read the same table (gs_it_kond), as is in the loop for  the kondition items.
    This works for all fields, except one;
    gs_it_price-kbetr (curr11)
    As soon as I have this field together with for instance a discount, this field will print the values
    mulitplied by 10, but only from the second line! (the first line always prints correctly)
    I have debugged it and the funny thing is that the correct value is in the field until the very end - something happens in the moment where I send it to print (it gets printed over an adobe server) which I cannot explain....
    Can anyone help me on this matter?
    Regards, Anne Kathrine

    Hello Ann,
      For all the Amounts, the currency referencing should used in order to print correctly.
    Try using something like this.
    Data: W_kbetr(11)
    Write: konv-kbetr to W_kbetr currency konv-waers.
    Also the amount field is displayed based on the Calculation type(KRECH) values 'A', 'B', 'C' etc...Percentage, Amount, Qty. resp.
    Make sure that before you're doing the manipulations correctly depends on the Calculation type.
    Hope this helps.
    Kindly assign points if the matter resolved.
    Thanks,
    -G

  • Dimension foreign key on Fact gets updated with same value

    Hi All,
    I'm hoping someone has at least seen this problem and can provide insight.
    Background:
    - We are on OWB 10.2
    - Fact table is Billing_F
    - Fact table has foreign keys to Customer_Dim, SalesOrg_Dim, Time_Dim, etc.
    - Fact table has update mode Update/Insert
    Once in a while, every row in the Billing Fact gets updated with the SAME SalesOrg_Dim foreign key column value. In other words, the data would look like:
    Before:
    Line ID Amt SalesOrg_Key
    1 100 19241
    2 200 21925
    3 140 08585
    After:
    Line ID Amt SalesOrg_Key
    1 100 12345
    2 200 12345
    3 140 12345
    *** The Source tables contain values in the Before table. ***
    We can't reproduce this on a consistent basis. The only way to "correct" the data is to rerun the mapping from source -> staging -> fact again. No other change.
    Please, has anyone else at least experienced this problem? If so, how were you able to fix it permanently?
    Any help is greatly appreciated!
    irene

    Hi Irene
    Difficult to help here without reviewing your mappings/schedule but does SalesOrgKey 12345 represent a particular value e.g. Unknown, Default?
    I suspect it's something to do with your load order in that the data in the dimension is not available/ready when the fact is loaded and therefore a default value is being inserted. When the fact load is rerun I'm guessing the load of the dimension has finished and therefore the key lookup returns the proper keys from the dimension. Is the dimension truncated and reloaded?
    Regards
    Si

  • Grouping consecutive rows with same value?

    Hi
    I have a table in which three columns are:
    ROWID  SHOPNAME
    1      SHOP_C     
    2      SHOP_A     
    3      SHOP_C     
    4      SHOP_C     
    5      SHOP_A     
    6      SHOP_A     
    7      SHOP_C     
    8      SHOP_B     
    9      SHOP_B     
    10     SHOP_E    
    11     SHOP_A     
    12     SHOP_D     
    13     SHOP_D     
    14     SHOP_F     
    15     SHOP_G     
    16     SHOP_F     
    17     SHOP_C     
    18     SHOP_C     
    19     SHOP_C     
    20     SHOP_C      Rowid is a primary key column with unique ids
    Shopname is varchar2 column
    I want to make groupings of every "shopname" value "order by ROWID" such that when there are consecutive rows of same shopname the group remains same and as soon as there is different value in shopname column for the next row the "group" changes.
    below is my desired output is with 3rd column of groupings as follows:
    ROWID  SHOPNAME    Groups
    1      SHOP_C      1
    2      SHOP_A      2
    3      SHOP_C      3 ------> same grouping because Shop name is same
    4      SHOP_C      3 ------> same grouping because shop name is same
    5      SHOP_A      4 ----> different shopname so group changed.
    6      SHOP_A      4 ----> same group as above because shopname is same
    7      SHOP_C      5
    8      SHOP_B      6
    9      SHOP_B      6
    10     SHOP_E      7
    11     SHOP_A      8
    12     SHOP_D      9
    13     SHOP_D      9
    14     SHOP_F      10
    15     SHOP_G      11
    16     SHOP_F      12
    17     SHOP_C      13
    18     SHOP_C      13
    19     SHOP_C      13
    20     SHOP_C      13I want that to be done via analytics, so that I can partition by clause for different shops over different cities
    regards
    Ramis.

    with data(row_id, shop) as
    select 1,      'SHOP_C' from dual union all
    select 2,      'SHOP_A' from dual union all     
    select 3,      'SHOP_C' from dual union all
    select 4,      'SHOP_C' from dual union all    
    select 5,      'SHOP_A' from dual union all     
    select 6,      'SHOP_A' from dual union all
    select 7,      'SHOP_C' from dual union all
    select 8,      'SHOP_B' from dual union all
    select 9,      'SHOP_B' from dual union all
    select 10,     'SHOP_E' from dual union all
    select 11,     'SHOP_A' from dual union all
    select 12,     'SHOP_D' from dual union all
    select 13,     'SHOP_D' from dual union all
    select 14,     'SHOP_F' from dual union all
    select 15,     'SHOP_G' from dual union all
    select 16,     'SHOP_F' from dual union all
    select 17,     'SHOP_C' from dual union all
    select 18,     'SHOP_C' from dual union all
    select 19,     'SHOP_C' from dual union all
    select 20,     'SHOP_C' from dual
    get_data as
      select row_id, shop,
             lag(shop) over (order by row_id) prev_shop
        from data
    select row_id, shop,
           sum(case when shop = prev_shop
                      then  0
                      else 1
                      end
                ) over (order by row_id) grps
      from get_data;
    ROW_ID SHOP   GRPS
         1 SHOP_C    1
         2 SHOP_A    2
         3 SHOP_C    3
         4 SHOP_C    3
         5 SHOP_A    4
         6 SHOP_A    4
         7 SHOP_C    5
         8 SHOP_B    6
         9 SHOP_B    6
        10 SHOP_E    7
        11 SHOP_A    8
        12 SHOP_D    9
        13 SHOP_D    9
        14 SHOP_F   10
        15 SHOP_G   11
        16 SHOP_F   12
        17 SHOP_C   13
        18 SHOP_C   13
        19 SHOP_C   13
        20 SHOP_C   13
    20 rows selected

Maybe you are looking for