Link of table ANLC with ANLA

Hello experts,
I am trying to get the latest values from anlc where its ANLN1, ANLN2 and BUKRS is equal to ANLA of the same fields and ANLA-DEAKT IS INITIAL.
Here is a scenario(when I checked in SE16):
Table ANLA - one entry found
BUKRS = 'ABC'
ANLN1 = 651825
ANLN2 = 0
DEAKT = 00/00/0000
Table ANLC - multiple entries found
BUKRS = 'ABC'
ANLN1 = 651825
ANLN2 = 0
GJAHR = from year 1999 to 2006
Now, This has been bugging me for the longest time. How can I get the latest record in ANLC(so in this case, it is the record with a gjahr of 2006) based from ANLA where its DEAKT is '00/00/0000'?

assuming you've read the anla already.......
select * from anlc up to 1 rows
where bukrs = anla-bukrs    
and anln1 = anla-anln1      
and anln2 = anla-anln2      
order by gjahr descending   
endselect.
But you could change the anla select to a join,
select * from anla
join anlc on anlcbukrs = anlabukrs
and anlcanln1 = anlaanln1
and anlcanln2 = anlaanln2 up to 1 rows
into corresponding fields of table your_table
order by gjahr descending   
endselect.
delete adjacent duplicates FROM YOUR_TABLE comparing bukrs anln1 anln2.
or you could just read anlc entries into a table,
select * from anlc
INTO CORRRESPONDING FIELDS OF TABLE OF T_ANLC
where bukrs = anla-bukrs
and anln1 = anla-anln1
and anln2 = anla-anln2
SORT T_ANLC BY GJAHR DESCENDING.
delete adjacent duplicates FROM T_ANLC comparing bukrs anln1 anln2.

Similar Messages

  • How to I link the table MARC with all the forecast table, eg MPOP

    Hi,
    Can anyone tell me how do I link the marc table with all the forecast structure?
    I am trying to create an abap extraction query
    thanks

    Hi,
    Please check the below links..
    MM43: Forecast Values Table
    http://www.se80.co.uk/sapfms/m/mass/mass_marc_read.htm
    http://www.se80.co.uk/sapfms/m/mass/mass_marc_merge.htm
    and also try with FM - MATERIAL_FORECAST_DISPLAY..
    Hope it may help you...
    Kuber

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • How can I link table KONV with table VBRP and VBRK using KSCHL field?

    Hi experts,
    How can I link table KONV with table VBRP/VBRK using KSCHL field so that items are fully filtered?
    Thanks,

    Hi,
    If you do not want to specify it as hard code, then define a variable for it if you want to pass the value for it from the selection screen so that it will be dynamic. Code will be as follows.
    select-options: x_KSCHL for T685l-KSCHL.
    select kwert
               kbetr
               knumv
               kposn
               kschl
          from konv
          into CORRESPONDING FIELDS OF TABLE it_konv
          FOR ALL ENTRIES IN it_all
          where knumv = it_all-knumv
          and   kposn = it_all-b_posnr
          and   kschl in x_KSCHL. "Dynamic Selection as per the selection screen input
      endif.
    Hope this helps.
    Regards,
    Chandravadan

  • Query Builder - How to create a link between tables with many fields?

    I have many fields in my tables. When the query builder loads the tables, the tables are expanded to accomodate all the fields. Suppose I want to link Table A's Customer ID (the first field in Table A) wiith Table B's Customer ID (the last field in Table B). How can I do that if the last field in Table B are not visible in the screen?
    Currently, I create a link in Table A's customer with a random field in Table B. Then I edit the link to create a proper condition. Is there a more efficient way to do this?
    Thanks.
    Edited by: woro2006 on Apr 19, 2011 9:40 AM

    Hi woro2006 -
    Easiest way is to grab Table A's title bar & drag Table A down the page until the columns you want to link are visible.
    FYI, there is an outstanding bug
    Bug 10215339: 30EA1: MISSING THE 2.1 RIGHT CLICK OPTIONS ON DATA FIELDS TO CREATE A LINK
    to add a context menu on the field for this. That is, Link {context field} to > {other data sources} > {fields from that source}
    It is being considered for 3.1, but I have no idea where it will end up in the priority queue.
    Brian Jeffries
    SQL Developer Team
    P.S.: Arghh, Unfortunately, I just tried it and the diagram does not auto scroll while you drag, so there is some guess work/repositioning the view involved.
    Logged Bug 12380154 - QUERY BUILDER DIAGRAM DOES NOT AUTO SCROLL WHEN DRAGGING TABLE

  • How to link a marketing characteristic with a table? ( TR CL03 - CT04 - BP)

    Hello,
    I'm trying to link a table (CRM_MKTPL_CAMPAIGN field : EXTERNAL_ID) with a mkt characteristic so that the user could select a value for this characteristic through a matchcode in transaction BP.
    I understood that i had to deassign the characteristic of the echaracteristic  group in TR CL03 in order to change some information in it via TR CT04.
    I managed to set the Table CRM_MKTPL_CAMPAIGN in the "Addnl data" section but when I reassign the characterictic to a group and go to transaction BP, nothing happens with the matchcode button.
    Is it possible to do it? did i do something wrong?
    Many thanks
    Laurent

    I found the answer myself, after posting this, of course!
    I changed:
    <tr spry:repeat="xml_assignments" spry:setrow="xml_assignments" spry:odd="spry_odd" spry:even="spry_even" spry:hover="spry_hover" spry:select="spry_select">
    to
    <tr spry:repeat="xml_assignments" spry:setrow="xml_assignments" spry:odd="spry_odd" spry:even="spry_even" spry:hover="spry_hover" spry:select="spry_select" onclick="window.location.href='./newpage.php?aid={a_id}';">
    Basically just added the onclick parameter...
    And it all just worked!

  • Error in MSACCESS linking a table with XMLTYPE

    hi all,
    I've linked a table from Oracle 9i to MSACCESS 2000 in windows 2000; this table has an XMLTYPE field, which is maped like OLE Object in Access;
    when I try to edit the table (not the xmltype field, any field...) I get an error:
    MSACCESS has generated errors and will be shutdown by windows. You must restart the program.
    An error register will be created
    anybody knows?
    thanx

    Nothing. Forms does not support this datatype.
    Frank

  • Linking two tables with no duplicated records!

    Hi,
    I have two tables now with both tables is having the common filed matnr.
    now using this field MATNR from  first table ,i need to fetch projectno from the other table which has to be unique.if there are more than one entry found for MATNR in question then that must not be updated to the first table!
    any ideas?
    Raj

    hi raj,
    try this code.
    data:
      ld_count type p,
      ld_tabix type sy-tabix.
    loop at itab1.
      move sy-tabix to ld_tabix.
      ld_count = 0.
      loop at itab2 where matnr eq itab1-matnr.
        add 1 to ld_count.
      endloop.
      if ld_count = 1.
        read table itab2 with key matnr = itab1-matnr.
        move itab2-project to itab1-project.
        modify itab1 index ld_tabix.
      endif.
    endloop.

  • Linking One table with more then one tablespace

    Hi,
    Can anybody help to link one table to more then one tablespace?
    Thanks in advance.

    If the table is not partitionned you cannot store a table in different tablespaces. If the table is partitionned you can store each partition in a different tablespace. Example from 10.2 Data Warehousing Guide:
    CREATE TABLE sales_composite
    (salesman_id  NUMBER(5),
    salesman_name VARCHAR2(30),
    sales_amount  NUMBER(10),
    sales_date    DATE)
    PARTITION BY RANGE(sales_date)
    SUBPARTITION BY HASH(salesman_id)
    SUBPARTITION TEMPLATE(
    SUBPARTITION sp1 TABLESPACE ts1,
    SUBPARTITION sp2 TABLESPACE ts2,
    SUBPARTITION sp3 TABLESPACE ts3,
    SUBPARTITION sp4 TABLESPACE ts4)
    (PARTITION sales_jan2000 VALUES LESS THAN(TO_DATE('02/01/2000','MM/DD/YYYY'))
    PARTITION sales_feb2000 VALUES LESS THAN(TO_DATE('03/01/2000','MM/DD/YYYY'))
    PARTITION sales_mar2000 VALUES LESS THAN(TO_DATE('04/01/2000','MM/DD/YYYY'))
    PARTITION sales_apr2000 VALUES LESS THAN(TO_DATE('05/01/2000','MM/DD/YYYY'))
    PARTITION sales_may2000 VALUES LESS THAN(TO_DATE('06/01/2000','MM/DD/YYYY')));Edited by: P. Forstmann on 13 févr. 2010 09:08

  • Depreciation GL A/C balance and table ANLC-NAFAG value are different

    Dear All
    I have faced a problem after charging depreciation I found that the balance of Depreciation General ledger account is higher than the value of Table ANLC-NAFAG
    How can I find out the reason of this difference and what is the table link between BSEG/BKPF with ANLC/ANLP or any other asset table to find out this difference of depreciation charged, please advice
    Regards
    Sekhar

    Hi Babu
    Thanks for your early reply, I have tried for ABST2 but get "Current fiscal year 2010 in company code XXXX does not match the system date's fiscal year 2011."
    their may be some posting for the FY 2010  in AA so I can not close FY 2010 in AA.
    I have compare with ANLP and FS10N GL Balances of depreciation a/c and Accumulated Depreciation Account and found( GL Balances are equal in debit and credit side)  that differences arrived in the posting period 03 only.
    we have posted depreciation for the posting period 12 also. please advice how can I rectify it.
    Regards
    Sekhar

  • Hiding Table Columns with the Spry Element Selector

    I am trying to set up a toggle button that will show/hide
    rows >1 when clicked. I've used Adobe's
    "Hiding
    Table Columns with the Spry Element Selector" example and it
    worked fine with an HTML list, until I linked to actual XML data.
    Now it works in reverse. What gives?
    Here's the example:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

    That's what I started with. Same result:
    http://a44.awardspace.com/testing/toggleShowHideRows.htm

  • How to bind internal table values with RootUIElement(Table) from select Que

    Hello Friends,
           In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...
         I written coding also but i dont know to bind internal table values with Table... My code as follows,
    method onactionsearch .
       data:
         Node_Node_Flight                    type ref to If_Wd_Context_Node,
         Elem_Node_Flight                    type ref to If_Wd_Context_Element,
         Stru_Node_Flight                    type If_View1=>Element_Node_Flight ,
         itab TYPE STANDARD TABLE OF sflight.
    navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
       Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    @TODO handle not set lead selection
       if ( Node_Node_Flight is initial ).
       endif.
    get element via lead selection
       Elem_Node_Flight = Node_Node_Flight->get_Element(  ).
    @TODO handle not set lead selection
       if ( Elem_Node_Flight is initial ).
       endif.
    alternative access  via index
    Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).
    @TODO handle non existant child
    if ( Elem_Node_Flight is initial ).
    endif.
    get all declared attributes
       Elem_Node_Flight->get_Static_Attributes(
         importing
           Static_Attributes = Stru_Node_Flight ).
    select * from sflight into CORRESPONDING FIELDS OF TABLE itab
      WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.
    Node_Node_Flight->bind_table( new_items = itab ).
    endmethod.
    Plz reply me asap...!

    Hi,
    What I understood from your coding is...
    * navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
    Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    You are reading values from the above node and binding the values to the same node.Am i right?
    Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.
    One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.
    Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.
    Go throgh this link
    Web Dynpro for ABAP: Tutorials for Beginners
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM

  • Table Relation with Payment and Invoice of Vendor

    Hi all,
         I have one question about Table Relation with Payment and Invoice of Vendor.
         the scenario is.
         2 Purchase Order number : 100000001/100000002
         1 Invoice document number : 200000001 which include  2 Purchase Order.
         1 Payment document number : 300000001
         How should I found out table relation from Payment document number - Invoice document number - Purchase Order number. ?
          I try to link the following table, but it does not work.
          RBKP     *     Invoice Receipt
          RSEG     *     Invoice Receipt document line item
          BKPF     *     Accounting Document Header
    BSEG     *     Accounting Document Segment
    PAYR          Payment Medium File
    BSIK          Accounting: Secondary Index for Vendors
    BSAK          Accounting: Secondary Index for Vendors (Cleared Items)
    BSIS          Accounting: Secondary Index for G/L Accounts (Open Items)
    Does any one know about it ?
    Regards
    KY Chuang

    Hi Venkatesh,
    Thnx a lot for the reply. This has almost solved my problem, however there's one thing left. when I'm trying to take a print out after exporting the info into an excel sheet, the information really looks scattered, i.e.,  is there a way where we can go ahead and get the info in a rather unscattered manner.
    I've tried to take a print directly without actually transferring the info into an excel sheet, then each of the vendor is printed in a separate page, which again they feel is a problem.
    So, if you have an idea pls suggest.
    Thnx again for the information.
    regards
    sandhya

  • Linking SD tables in SAPquery

    Hi Everyone,
    I'm in the middle of creating a SAPQuery for my users to use. However, i am having trouble in linking a particular table, as i get the following error message:
    "Table KONV cannot be used in a join"
    What i am trying to do is to link SD tables VAPMA, VBRP, VBRK, KNA1 with KONP. The problem now is that i am unable to link KONP with the earlier mentioned tables, so i need to include another new table KONV to provide a link between them.
    From what i can find out in SE11, KONV is a cluster table, so does it mean there is no way to link them?
    Is there any other way to link those 4 earlier tables i mentioned with KONP?
    Thanks in advance

    Hi Bernard,
    Please check this link perhaps it may help to link above tables.
    http://www.sapgenie.com/abap/tables_sd.htm
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Table Controller With 1:N Relationship

    I'm looking at implementing a table controller with a 1:N relationship as per the following blog post: http://blogs.msdn.com/b/azuremobile/archive/2014/06/18/insert-update-related-data-with-1-n-relationship-using-net-backend-azure-mobile-services.aspx
    However, when I run the sample solution given, an exception is thrown when I call the following controller method:
    public SingleResult<TodoItemDTO> GetTodoItem(string id)
    return Lookup(id);
    The exception thrown: 
    The LINQ expression node type 'Invoke' is not supported in LINQ to Entities.
    The sample solution can be found here: https://github.com/pragnagopa/BlogSamples/tree/master/InsertUpdateRelatedData
    Can anyone explain why this is not working?

    Hi,
    As per you requirement, it seems like a Field in main table is look up to Flat table which contains Two fields say Field A and Field B both as display fields. Field A has two values 100 and 200 only and Field B has six values P, Q, R, X, Y, Z.
    You want whenever you select Field A as 100 then only P, Q, R comes.
    I firmly believe that this is not achievable as per MDM capability using Fields. But you can run Validations to cross check that if it is 100 then correspondingly value of Field B should be from P, Q and R only. IIy, for 200 it should be from X, Y and Z.
    Alternatively, I can suggest you to go for Taxonomy. Create 2 categories say category name Field100 and Field200.
    Field100 category is linked with attribute 100 which has values P, Q and R.
    Field200 category is linked with attribute 200 which has values X, Y and Z.
    So whenever you select category Field100 associated linked attribute 100 will come and whose values can be populated using P, Q and R only.
    lly, when you select category Field200 associated linked attribute 200 will come and can be populated using X,Y and Z only. Whenever for a record in main table you select this category field as Field100 and Field200 correspondingly linked Attribute comes with Predefined set of legal values.
    Thanks and Regards,
    Mandeep Saini

Maybe you are looking for

  • Error while creating "RETURNS" as ERP Sales transaction type

    Description: We are getting error while creating ERP SLO type "Returns-ZRE". Message prompts as "Creation of ERP Transaction failed". We do not get the message for other order types for example "Standard order". Please suggest. Please note that this

  • Error in creation of inbound delivery

    hi When I tried to create inbound delivery against schedule agreement 1) Following warning message is coming when I enter the quantity for each and every line item    u201CAcknowledgment for PO item contains data varianceu201D 2)Following error messa

  • Syncing multiple devices

    I need to sync 3 devices. I have an old iPod on an old account, an iPhone 5, and a new Shuffle, both on a new account.  How can I get all 3 to be on the same account and have the same music.

  • Incorrect database version in CHECK-OS-DB-VERSION

    We are performing an upgrade to NetWeaver 7.3 on a Java-only stack that is running Portal components. We have started at NetWeaver 7.0 EhP1, on LINUX RH-EL 5 and ORACLE 11.2.0.1. We got stuck on the database check. The system reported that our databa

  • TRFC issue. Why does it happen?

    dear all, would like to know why does T-RFC happen when loading data? i know how to fix it, but would like to know in dept why does it happen. thank in advance for any response given