Inserting to a table using same table and master table

[code]
I have a table  test_master where I have stored the status of the individual claims  ; the status would be changed quarterly basis.
I have another table test_detail which will store status chages on each quarter.The curr_status column will store the status from test_master; and  prev_status will be the curr_status for the previous  trans_id from test_detail table itself
create table test_master( claim_id number,
                        status varchar2(10));
insert into  test_main VALUES (100, 'L1');                
insert into  test_main VALUES (101, 'L2');   ---- first quarter data.. it will be purged at the begining of second quarter
insert into  test_main VALUES (102, 'L1');
insert into  test_main VALUES (103, 'L3');
insert into  test_main VALUES (100,  'L2');
insert into  test_main VALUES (101,  'L2');    ---- second quarter data.. it will be purged at the begining of third quarter  
insert into  test_main VALUES (102,  'L1');
insert into  test_main VALUES (103,  'L4');
insert into  test_main VALUES (100,  'L4');
insert into  test_main VALUES (101,  'L5');    ---- third quarter data.. it will be purged at the begining of fourth quarter  
insert into  test_main VALUES (102,  'L6');
insert into  test_main VALUES (103,  'L7');
create table test_detail( trans_id number,
                          claim_id number,
                          prev_status varchar(20),
                          curr_status varchar2(21
prev_status =  curr_status of  the previous id for same claim_id s
curr_status =  status from TEST_MASTER
how to write an insert statement to insert records in TEST_DETAIL to have below expected data?
id     claim_id       PREV_STATUS      CURR_STATUS
1          100                               null               L1    ---prev_status will be null for the first run
1          101                               null               L2
1          102                               null               L1
1          103                               null               L3
2          100                               L1                L2
2          101                               L2                L2
2          102                               L1                L1
2          103                               L3                L4
3          100                               L2                L4
3          101                               L2                L5
3          102                               L1                L6
3          103                               L4                L7
[/code]
Thanks
-Ann

Hi,
Do you really need to store prev_status in test_detail?  You can always compute it on the fly, using the analytic LAG function, and you won't have to worry about re-computing it when test_detail is updated.
If test_detail will never be updated, and performance is important, then you may want to store prev_status.  Here's one way to do that.
When you're ready to archive the data from test_main, then run this INSERT statement:
INSERT INTO test_detail (trans_id, claim_id,  prev_status,      curr_status)
           SELECT        &2,     m.claim_id,  d.curr_status,    m.status
           FROM             test_main    m
           LEFT OUTER JOIN  test_detail  d  ON   d.claim_id  = m.claim_id
                                            AND  d.trans_id  = &1
Where &1 is the previous trans_id (the highest value already in test_detail), and &2 is the new trans_id (&1 + 1).
The first time you run this, when test_detail is empty, it doesn't matter what value you use for &1; you can use 0.
After you've confirmed that this worked, then you can start putting new data into test_main.
I assume that test_master and test_main are the same table.

Similar Messages

  • I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY WUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ??

    I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??

    Hi Kishore,
    First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
    Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table.

  • Details about TA kk01 and master tables

    hi SAP Technical Guru's
    pls provide details about TA KK01 (statistical key figures) and master tables.
    best regards,
    m.srinivas.

    Hi
    TA     Report            * Header Description*
    KKO1   SAPMKCEE       Create Drilldown Report
    Go to SE 38 and check this report, you can also find the master data tables used by clicking f1 and then the technical settings button on the tool bar.
    Regards
    Divya

  • I'm using same icloud and same apple ID on two iphones. Now i get calls from same number on both iphones at the same time. How to turn off that?

    I'm using same icloud and same apple ID on two iphones. Now i get calls from same number on both iphones at the same time. How to turn off that?

    Apple ID's are not device specific, so when you changed it on the iPad 2 it changed it on the iPhone 4 as well, since it's the same account still. What you need to do is create a second Apple ID (so you'll have two accounts, one for iPhone 4 and a seperate one for iPad 2).
    To create a new Apple ID on your iPad 2:
    1) Go into Settings > Store.
    2) If you are already signed in, tap your Apple ID on the screen and you will be given a few options, one of which is to sign out of your account.
    3) After you sign out, now click the "Sign in" button.
    4) Tap "Create New Apple ID" and follow the instructions on-screen.

  • My itunes on windows7 pc does not recognize new ipad. using same cable and usb port that works for my ipod. what to do?

    My itunes on windows7 pc does not recognize new ipad. using same cable and usb port that works for my ipod. what to do?
    Thanks

    Have you updated iTunes with the absolute latest software?  If you have not in a long time, your iPad won't be recognized.

  • IPhone 4s. IOS 7.1.1 Windows 7. Using same lead and usb socket. From yesterday my phone won't appear on computer. Will charge via usb lead. Dont have iTunes on this computer and never had.

    iPhone 4s. IOS 7.1.1 Windows 7. Using same lead and usb socket as always. From yesterday my phone won't appear on computer. Will charge via usb lead. Dont have iTunes on this computer and never had. Am now being asked if I trust this computer. This is new. Also takes longer than usual to signal it is charging. Get usual sound notification but nothing appear in computer. I long ago disables automatic notification that phone was connected. Prefer to bring it up manually.

    Within Contacts, tap Groups at top left. Make sure all contact groups are checked to show, then tap "Done" at top right.
    Within the Calendar app, tap Calendars at the bottom center of the screen. Tap on Show All Calendars.

  • If i am using skype on my lap top should i download skype on the ipad, can i use same id and password??

    f i am using skype on my lap top should i download skype on the ipad, can i use same id and password??

    Of course you must download Skyoe to any device you want to use it on. And the Skype name and password must be the same on each in order to access your account, contacts, etc.

  • Multiple indexes using same columns on one table - is this doable?

    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    So my question are:
    1. is this is possible? if so, what is the correct syntax.
    2. assuming it is possible, has anyone used this sort of construct before? it appears to be conflicting and inconsistent to me.
    Many thanks, and kind regards,
    Naran

    Naran H wrote:
    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    You can't have the unique and non-unique indexes in place at the same time, but you can have the non-unique index supporting the unique (PK) constraint.
    I guess your problem is that you don't want to have an interval of time where you have dropped the existing unique index while you create the replacement.
    The only current way I can think of for getting from:
    unique index(a,b)
    to
    non-unique index(a,b) with PK constraint (a,b)
    without having a point in time where bad data can appear, and with minimal locking is:
    create unique index (b,a) online;
    drop index (a,b);
    create non-unique index(a,b) online;
    add primary key using index (a,b) enabled, novalidate
    validate primary key
    drop index (b,a)Regards
    Jonathan Lewis

  • SQL Loader : Loading multiple tables using same ctl file

    Hi ,
    We tried loading multiple tables using the same ctl file but the data was not loaded and no errors were thrown.
    The ctl file content is summarised below :
    LOAD DATA
    APPEND INTO TABLE TABLE_ONE
    when record_type ='EVENT'
    TRAILING NULLCOLS
    record_type char TERMINATED BY ',' ,
    EVENT_SOURCE_FIELD CHAR TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_DATE DATE "YYYY-MM-DD HH24:MI:SS" TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_COST INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    EVENT_ATTRIB_1 CHAR TERMINATED BY ',' ENCLOSED BY '"',
    VAT_STATUS INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    ACCOUNT_REFERENCE CONSTANT 'XXX',
    bill_date "to_date('02-'||to_char(sysdate,'mm-yyyy'),'dd-mm-yyyy')",
    data_date "trunc(sysdate)",
    load_date_time "sysdate"
    INTO TABLE TABLE_TWO
    when record_type ='BILLSUMMARYRECORD'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    NET_TOTAL INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE BILL_BKP_ADJUSTMENTS
    when record_type ='ADJUSTMENTS'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    ADJUSTMENT_NAME CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE BILL_BKP_CUSTOMERRECORD
    when record_type ='CUSTOMERRECORD'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    GENEVA_CUSTOMER_REF CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    INTO TABLE TABLE_THREE
    when record_type ='PRODUCTCHARGE'
    TRAILING NULLCOLS
    RECORD_TYPE char TERMINATED BY ',' ,
    PROD_ATTRIB_1_CHRG_DESC CHAR TERMINATED BY ',' ENCLOSED BY '"',
    LOAD_DATE_TIME "sysdate"
    Has anyone faced similar errors or are we going wrong somewhere ?
    Regards,
    Sandipan

    This is the info on the discard in the log file :
    Record 1: Discarded - failed all WHEN clauses.
    Record 638864: Discarded - failed all WHEN clauses.
    While some of the records were loaded for one table.
    Regards,
    Sandipan

  • Create Table using DBMS_SQL package and size not exceeding 64K

    I have a size contraint that my SQL size should not exceed 64K.
    Now I would appriciate if some one could tell me how to create a table using
    Dynamic sql along with usage of DBMS_SQL package.
    Brief Scenario: Users at my site are not given permission to create table.
    I need to write a procedure which the users could use to create a table .ALso my SQL size should not exceed 64K. Once this Procedure is created using DBMS_SQL package ,user should pass the table name to create a table.
    Thanks/

    "If a user doesn't have permission to create a table then how do you expect they will be able to do this"
    Well, it depends on what you want to do. I could write a stored proc that creates a table in my schema and give some other user execute privilege on it. They would then be able to create a able in my schema without any explicitly granted create table privilege.
    Similarly, assuming I have CREATE ANY TABLE granted directly to me, I could write a stroe proc that would create a table in another users schema. As long as they have quota on their default tablespace, they do not need CREATE TABLE privileges.
    SQL> CREATE USER a IDENTIFIED BY a
      2  DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
    User created.
    SQL> GRANT CREATE SESSION TO a;
    Grant succeeded.
    SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
    CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10))
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'USERS'So, give them quota on the tablespace and try again
    SQL> ALTER USER a QUOTA UNLIMITED ON users;
    User altered.
    SQL> CREATE TABLE a.t (id NUMBER, descr VARCHAR2(10));
    Table created.Now lets see if it really belongs to a:
    SQL> connect a/a
    Connected.
    SQL> SELECT table_name FROM user_tables;
    TABLE_NAME
    T
    SQL> INSERT INTO t VALUES (1, 'One');
    1 row created.Yes, it definitely belongs to a. Just to show that ther is nothing up my sleeve:
    SQL> create table t1 (id NUMBER, descr VARCHAR2(10));
    create table t1 (id NUMBER, descr VARCHAR2(10))
    ERROR at line 1:
    ORA-01031: insufficient privilegesI can almost, but not quite, see a rationale for the second case if you want to enforce some sort of naming or location standards but the whole thing seems odd to me.
    Users cannot create tables, so lets give them a procedure to create tables?
    John

  • Updatable Materialized View and Master Table on same database

    Hi all,
    My first question - Is it possible to have an Updatable Materialized View and the associated Master Table located on the same database?
    This is the requirement scenario:
    One unique database D exists.
    A is a batch table. Only inserts are allowed on Table A.
    M is an updatable materialized view on Table A (Master). Only updates are allowed on M (no insert or delete).
    Requirement is to push updates/changes from M to A periodically and then get the new inserted records from A into M via a refresh.
    Is this possible? What other approaches are applicable here?

    John,
    My question is related to the implementation and setup of the environment as explained in the above example. How can I achieve this considering that I have created an updatable m-view?
    If possible, how do I push changes made to an updatable m-view back to it's master table when/before I execute DBMS_MVIEW.REFRESH on the m-view? What is the procedure to do this if both table and mview exist on the same database? Do I need to create master groups, materialized view refresh groups, etc.?
    One more thing.. Is there a way to retain changes to the m-view during refresh? In this case, only newly inserted/updated records in the associated table would get inserted into m-view. Whereas changes made to m-view records would stay as-is.
    Hope my question is directed well. Thanks for your help.
    - Ankit

  • ADF 11g - Refreshing adf:Table using af:poll and ValueExpressions

    Hi,
    I am trying refresh an ADF Read-only table with the af:poll component.
    I could see the System.out message in console and Browser activity (refreshing) because of af:poll method.
    But, the values are not getting updated until I refresh the page manually and removing the "?_adf.ctrl-state=1228194074_3" part from the Browser URL.
    Please find the code which I am using:
    System.out.println("Updating table");
    FacesContext fctx = FacesContext.getCurrentInstance();
    *ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");*
    DCBindingContainer bindings = (DCBindingContainer)dcb.getValue(fctx);
    DCIteratorBinding dciter =bindings.findIteratorBinding("DepartmentsIterator");
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    Also, I could see createValueBinding / ValueBinding is deprecated and replaced by ValueExpression.
    Is this causing any issues or is there any working sample of the same in ADF 11g.
    thanks & regards,
    S.Vasanth Kumar.
    JDev Studio Edition Version 11.1.1.0.1
    Build JDEVADF_MAIN.BOXER_GENERIC_081203.1854.5188
    Edited by: vasanth.s.kumar on May 6, 2009 10:06 PM

    Thank you for the help.
    But, I am getting NullPointerException after implementing the following code.
    RequestContext.getCurrentInstance().addPartialTarget(this.getTable1());
    RequestContext.getCurrentInstance().addPartialTarget(this.getTable2());
    +"java.lang.NullPointerException+
    +For more information, please see the server's error log for+
    +an entry beginning with: Server Exception during PPR, #4"+
    Please find the complete stack trace attached.
    Inside EmployeesBean
    Updating table
    May 6, 2009 10:34:05 PM oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator handleError
    SEVERE: Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
         at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1264)
         at org.apache.myfaces.trinidad.component.UIXPoll.broadcast(UIXPoll.java:98)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:640)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:275)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:102)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:149)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.NullPointerException
         at org.apache.myfaces.trinidadinternal.context.RequestContextImpl._getNearestPPRTarget(RequestContextImpl.java:770)
         at org.apache.myfaces.trinidadinternal.context.RequestContextImpl.addPartialTarget(RequestContextImpl.java:487)
         at nl.whitehorses.coherence.view.backing.EmployeesBean.refreshTable(EmployeesBean.java:105)
         at nl.whitehorses.coherence.view.backing.EmployeesBean.onPoll(EmployeesBean.java:110)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         ... 38 more
    thanks & regards,
    S.Vasanth Kumar.

  • How to Create Table Using Column Drag and Drop Feature

    Hi:
    I am new to Oracle SQL dev Data Modeler tool and would like to know if there is a way to create a new table by re-using the existing columns or column groups. The idea is to maintain consistency and save table design time. If columns created previously can be re-used and require drag and drop of column in the right pane, then only new columns need to be manually created.
    Any thoughts on this will be appreciated.
    Thanks!

    Hi Kent
    I checked out the video and tried it in Oracle designer, it works and works great!
    My other question is that I may have several set of columns that I may want to group depending on the table requirements. Can I have multiple templates and choose which one to apply to?
    Also, how do I choose the table where the table template needs to be applied. As I may be interested in applying the table template to selected tables only.
    Thanks
    Edited by: user648132 on Feb 20, 2012 10:47 AM

  • How to make reference wbs custom data carried to new wbs when using custom tab and custom table

    I created a custom tab for WBS elements by using user exit CNEX0007 and custom screen and put a table control in it.
    As table control's data has to be stored in a table I could not use append structure of PRPS.
    When I used reference wbs, PRPS custom fields were carried also but I could not find any solution to fill table control data with reference table.
    I need to get correspondence between reference number's and new id's key data. Is there any exit, enh. that I can store the relationship.

    Solved...
    I've used an enhancement point in include LCNPB_MF38.  CJWB_SUBTREE_COPY exports a table called newnumbers. Here you can find correspondances between copied WBS and new WBS.
    Exported table to memory id.
    And imported it in another user-exit. You can use proper user exit for your need.  ( EXIT_SAPLCNAU_002)

  • Use of T168F and T168 Tables in System

    Hi everybody
    I'm making a development, the purpose is to assign the Release Strategy to RFQ's when the user sets the Unit Prices for Items in transactión ME47.
    This action is executed in SAPMM06E in Routine strategie_ermitteln calling FM ME_REL_STRATEGIE_EKKO, but before the call there is a check at routine begin: t160-vorga NE vorga-angb (vorga-angb is a constant 'AG').
    t160-vorga has the 'A' value for ME41 (creating RFQ), then in this transaction the Strategy is assigned.
    But in ME47, t160-vorga has the 'AG' value, then the FM is not called.
    I solved this making t160-vorga = 'A' (only in memory) in EXIT_SAPMM06E_017, and the Release Strategy is assigned ok.
    But, when the user modificates a price using a button, the program makes a validation in Routine FCODE, checking that the value of t160-vorga exists in T168F and T168 tables with field fcode = 'KO'.  Because i modified the value from AG to A, this record does not exist and the program set an error. But, if i don't modify the t160-vorga, the Release is not assigned because the check in Routine strategie_ermitteln.
    So , i'm thinking in change my development, calling myself the FM  ME_REL_STRATEGIE_EKKO in EXIT_SAPMM06E_012 when action Save, but i dont' like this solution because i would need to copy not only the FM call, but else all the code involved in fill the parameters.
    So, i think other solution is to create the record for vorga = 'A', fcode = 'KO'  in T168F and T168 tables.
    If somebody can helpe, my doubts are:
    1. what implicates this record creation in these tables T168/T168F, that is, wich is the usage of these tables in the system ??     
    2. Where can i see the meaning of t168-vorga values (AG, A, K, F etc.)  ??
    3. In wich transaction can i create records to these tables ??
    4. Could be any problem if i add that records to these tables ??
    Any help will be apreciated !!
    (Excuse the long Topic text)
    Thanks
    Frank

    Hi Frank,
    2. Look the table T167T (to find this, I was going into the SE11, Data element: VORGA, : table, ...)
    3. The table T167T could be updated with the SM30/SM31 transaction. But you have a warning message.
    4. See the message, in the previous answer
    Rgd
    Frédéric

  • Internal table with same variable and one select query

    Hi,
    I am a new bee here with may be a silly question.
    I have a internal table as below.
    DATA: BEGIN OF IT_ORDERDETAILS OCCURS 0,
            VBELN LIKE VBAK-VBELN,        "Order number
            BSTNK LIKE VBAK-BSTNK,        "customer PO
            ERDAT LIKE VBAK-ERDAT,        " Order created date
            MATNR LIKE VBAP-MATNR,        "Sales order line item
            KWMENG LIKE VBAP-KWMENG,      "Quantity
            D_VBELN like likp-vbeln,      " delivery no
            POSNR like lips-posnr,        " delivery item
            KUNNR LIKE LIKP-KUNNR,        "ship quantity
      END OF IT_ORDERDETAILS.
    Where VBELN field is in VBAK and LIKP table.
    VBELN in VBAK table = order #
    VBELN in LIKP table is = Delivery #
    I want to use join to fetch data in single select query.
    Below is the select query
    SELECT VBAK~VBELN
            VBAK~BSTNK
            VBAK~ERDAT
            VBAP~MATNR
            VBAP~KWMENG
            likp~vbeln
            lips~posnr
            LIPS~VGBEL
          INTO (IT_ORDERDETAILSvbak, IT_ORDERDETAILSbstnk,     IT_ORDERDETAILSerdat, IT_ORDERDETAILSmatnr, IT_ORDERDETAILSkwmeng, IT_ORDERDETAILSd_vbeln,IT_ORDERDETAILSposnr, IT_ORDERDETAILSkunnr)
    FROM VBAK left outer JOIN VBAP ON ( VBAKVBELN = VBAPVBELN )
    left outer JOIN LIPS ON ( VBAKVBELN = LIPSVGBEL )
      join LIKP on ( LIPSVBELN = LIKPVBELN )
    WHERE VBAK~ERDAT IN CR_DATE.
    I am getting error in the query.
    Please suggest.
    Thanks,
    Rajesh

    Hi rajesh.nayakbola,
    although this is not quite the right place for this, let me give you some notes:
    1. Code should be
    formatted as code
    by markin it with mouse and use above <> button.
    2. Internal tables shoult not be declared using OCCURS clause - this is last century style
    3. Internal tables do not need and should not have a header line, they should use TYPES for declaration
    4. Data should not be declared using LIKE: If they refer to dictionary TYPES, use TYPE. LIKE is only mandatory for data objects declared in your program, i.e. DATA IT_some_ORDERDETAILS like IT_ORDERDETAILS.
    5. If you get an error here, never write "I am getting error" but copy and paste the error message fully.
    - The fields in brackets in  the INTO clause never have ~ character, there is no IT_ORDERDETAILS~vbak, only IT_ORDERDETAILS-vbeln
    It could be something like this:
    TYPES:
      BEGIN OF TY_ORDERDETAILS,
      VBELN TYPE VBAK-VBELN, "Order number
      BSTNK TYPE VBAK-BSTNK, "customer PO
      ERDAT TYPE VBAK-ERDAT, " Order created date
      MATNR TYPE VBAP-MATNR, "Sales order line item
      KWMENG TYPE VBAP-KWMENG, "Quantity
      D_VBELN TYPE likp-vbeln, " delivery no
      POSNR TYPE lips-posnr, " delivery item
      KUNNR TYPE LIKP-KUNNR, "ship quantity
    END OF TY_ORDERDETAILS.
    DATA:
      IT_ORDERDETAILS TYPE TABLE OF TY_ORDERDETAILS.
    SELECT VBAK~VBELN
      VBAK~BSTNK
      VBAK~ERDAT
      VBAP~MATNR
      VBAP~KWMENG 
      likp~vbeln AS D_VBELN
      lips~posnr
      LIKP~KUNNR
    INTO CORRSPONDING FIELDS OF TABLE IT_ORDERDETAILS
    FROM VBAK left outer JOIN VBAP ON ( VBAK~VBELN = VBAP~VBELN )
      left outer JOIN LIPS ON ( VBAK~VBELN = LIPS~VGBEL )
      join LIKP on ( LIPS~VBELN = LIKP~VBELN )
    WHERE VBAK~ERDAT IN CR_DATE.
    Regards,
    Clemens

Maybe you are looking for

  • Related to po table

    in which table i can get purchase order net value at header levet

  • Can I run window 8.1 pro on hp a450n

    Can I run window 8.1 pro on hp a450n with upgrade 2gb ram.

  • Don't know how to close UI-Window Component

    I don't know how to write a close function for UI windows component. This is what i did. 1) Dragged windows UI component to the library. 2) Dragged button from UI to stage 3) Gave instance name to the button as my_button 4) For frame 1, i added this

  • CKMLCPAVR cockpit

    Hi gurus, I am implementing the Alternative valuation scenario and I have a question in alternative valuation run. I have the following situation: This is the period 10 for the current period. Period 9 and 10 are open periods in logistics side. First

  • Error CSS Value not supported.

    I'm trying to use a css file but the compiler keeps shouting about these errors: "CSS Value for 'color' not supported." regarding this line in the .css: .processParamMandatory { color: inherit; and "CSS Value for 'font-size' not supported." regarding