Inserting record in standard table

Dear Sapians
I want to insert a record in standard table PRPS for testing one scenario. we tried to insert through abap program but we are unable to insert data in the PSPNR field.
Best regards
Sukumaran.E

hi,
check this code it may help u,
TABLES : AFKO,
         AFPO.
DATA : BEGIN OF GI_AFKO OCCURS 1,
       AUFNR LIKE AFKO-AUFNR,
       END OF GI_AFKO.
data gi_AFPO like ZPRODUCT occurs 0 with header line.
*DATA : BEGIN OF GI_AFPO  OCCURS 100,
      MANDT LIKE
      MATNR LIKE AFPO-MATNR,
      DWERK LIKE AFPO-DWERK,
      END OF GI_AFPO.
DATA: gv_date(11)," LIKE ekpo-aedat,
      gv_date1(11),
      year(4),
      month(2),
      day(2),
      flag(1),
      read_flag(1).
START-OF-SELECTION.
  gv_date1 = sy-datum.
  year = gv_date1+0(4).
  month = gv_date1+4(2).
  day = gv_date1+6(2).
  year = year - 3.
  CLEAR gv_date1.
  CONCATENATE year month day INTO gv_date1.
  select aufnr
         from afko
         into table gi_afko
         where ( GLTRP <= sy-datum AND gltrp >= gv_date1 ) .
  IF SY-SUBRC = 0.
    select matnr
        dwerk
        from afpo
        into CORRESPONDING FIELDS OF table gi_afpo
        for all entries in gi_afko
        where aufnr = gi_afko-aufnr.
  ENDIF.
  SORT GI_AFPO BY MATNR.
  IF NOT GI_AFPO[] IS INITIAL.
    MODIFY ZPRODUCT FROM TABLE GI_AFPO.
    IF SY-SUBRC = 0.
      MESSAGE I003 WITH 'VALUES UPDATED IN TO TABLE ZPRODUCT'.
    ELSE.
      MESSAGE I003 WITH 'VALUES NOT UPDATED IN TO TABLE ZPRODUCT'.
    ENDIF.
regards
siva

Similar Messages

  • How to change records in standard tables ?

    how to change records in standard tables ?

    HI,
    If you are asking from program..Then you can use BDC or BAPI to update the records in teh standard tables..
    OR
    use the corresponding tcode to update the record
    Thanks
    Naren

  • Inserting records into a table with all caps

    Hello
    I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table?
    Thanks.

    You can use UPPER(..) function in your insert statement, so that values are converted to UPPER, before insert.
    If you want to check at table level, you can achieve that by writting a before insert trigger and in that trigger check
    IF UPPER(:new.<col>) != :new.<col> THEN
    RAISE_APPLICATION_ERROR(-20101,'Error: Not all values are in upper case')
    END IF;

  • Please Help me in inserting record in a table

    Hi,
    Kindly help me on how to insert records in a table that the values are from the another table.
    for example :
    i have table1, all of the records in column1 of table1 will be inserted to table2 column2 . .
    I already tested it to a visual foxpro programming language and it's ok, i used this command :
    *"INSERT INTO table1 (column1) SELECT column2 FROM table2"*
    but when I try it to a JAVA Program, there's an error.
    Please help me.. Thank You.

    Sir, this is what you mean?
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
    at remittance.utility.security.frmRole.addtoPermission(frmRole.java:197)
    at remittance.utility.security.frmRole.btnADDActionPerformed(frmRole.java:177)
    at remittance.utility.security.frmRole.access$200(frmRole.java:22)
    at remittance.utility.security.frmRole$3.actionPerformed(frmRole.java:92)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

  • How to insert records into the Table?

    Dear Sir,
    I'm new to JDeveloper. Now I managed to create a Frame in JDeveloper with many Text fields and a button. In the back end, I have a procedure to insert records to a table, to which I pass the values of the fields as parameters. Now I'm not getting the steps to call the PL/SQL Stored procedure when I click on the button. I'm using Oracle 9i JDeveloper version 9.0.3.1. and Oracle 9i Database.
    Please give me the complete steps to achieve my task - it is quite urgent.
    Thanking You in advance.
    Regards,
    Senthil .A. Perumal.

    The JDBC tutorial will show you how to call a stored procedure from Java:
    http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm
    One more thing, why are you using such an old version of JDeveloper? any reason not to upgrade to the 10.1.3 version of JDeveloper?
    Also you might want to look into ADF and how it makes these type of database interactions easier.
    See this demo:
    http://www.oracle.com/technology/obe/obe1013jdev/adf_swing/master_detail_page_adfswing_bc.htm

  • Inserting records from internal table to database table

    Hi all,
    i want to insert records from internal table to zDatabase table, can u plz guide me which statement is better in performance to insert the records.
    1) insert one by one record from internal table
    loop at itab.
    insert ztable from wa.
    endloop.
    2) insert total records at a time
    INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or let me know if any other statement is there with high performance.
    i internal table contains nearly 40000 records.
    thanks.

    Hi,
    Insert the entire table at atime rather than a record so as to increase the performance.
    you can use INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or
    MODIFY ZPRODUCT FROM TABLE GI_AFPO.
    Regards,
    Raj.

  • Using Crystal 2008 to insert records into a table

    Hi,
    We have a unique need to use Crystal to insert records into a table. We have managed to test a report that can write into a temporary table.  This is done by using sql command object  and uses  the following code :
    INSERT INTO TEMP_TABLE  (ORDERID)
    VALUES ({?orderid})   (-- where orderid a parameter).
    This test report asks for an order id and then inserts the record perfectly fine.
    Now moving on to the real report - This report basically prints orders in batches and we want to insert order id into a temporary table to ensure we don't print orders that were already printed. To do this we created a sub report "insert orders" that has the above insert command. The main report passes the orderid to subreport and the idea is that the subreport would insert each time an order is passed. So if main report printed 50 orders ids, the then it would do 50 inserts individually into the temp table. 
    This however is NOT working. The report runs fine but there is no insert.  Our hunch is that  Crystal is not committing after every order id is passed from the main report.  Not sure if we can set the AUTO COMMIT ON  as a default somewhere?
    Wondering if any one has attempted this or has any insights?
    Regards,
    Mohit.
    Environment is - Crystal 2008 and Oracle 11GR2, we are using Oracle drivers (and not odbc)

    Hmmm... I don't use Oracle but the syntax looks good...
    You've already tested it and I assume that you are using the same driver in the production report as you used in the test, so that shouldn't be an issue...
    how are you pulling the data? Is the final SELECT statement that pulls the report data in the same command as the INSERT script, or is the INSERT script in it's own command?
    The reason I ask... If you are trying to pass a multi-valued parameter to a command, it won't work. If you have the insert command as it's own command while the data is being pulled with linked tables or a separate command, it is possible that the report itself will execute as expected w/o passing a value to the insert script.
    If it's all in 1 command (as it should be), a bad parameter would fail in the final SELECT causing an error.
    Also... are rows null or empty string values being added to table when the report executes? This would be an indication that the command is being executed but isn't getting the parameter value.
    Jason

  • Find the latest updated or the latest inserted record  in a table

    Hi All,
    Thanks in advance
    Just a simple question
    How do we find the latest updated or the latest inserted record in a table ?
    Provide some queries in SQL?

    You can order by rowid desc to get lately inserted records, but I'm not sure about updated records.That is incorrect, Oracle might use old rowid's even in inserts and you cannot assure that the max(rowid) refers to the latest record.
    If the table is created with rowdependencies one can use ORA_ROWSCN pseudo column to check on date/time when the last dml has been performed over that table. But, that has some limitations too, Old snapshots will be erased hence one can check the last dml with a time frame of few days.
    Regards,
    Prazy

  • Retrive last inserted  record  from database table

    Hi,
    some body inserting a record into table 'A' through some procedure/java program.i want to retrive the last inserted record from database table.records are not stored in order.Can any body help me.

    In general, unless you are storing a timestamp as part of the row or you have some sort of auditing in place, Oracle has no idea what the "first" or "last" record in a table is. Nor does it track when a row was inserted.
    - If you have the archived logs from the point in time when the row was inserted, you could use LogMiner to find the timestamp
    - If the insert happened recently (i.e. within hours), you may be able to use flashback query to get the value
    - If you're on 10g or later and the table was built with ROWDEPENDENCIES and the insert happened in the last few days and you can deal with a granularity of a few seconds and you don't need 100% accuracy, you could get the ORA_ROWSCN of the row and convert that to a timestamp.
    If this is something you contemplate needing, you need to store the data in the row or set up some sort of auditing.
    Justin

  • How to find last inserted record in the table.

    Version: Oracle 10g
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".
    As i come to know that Rowid is not result perfect results. Please provide your inputs.

    user13416294 wrote:
    Version: Oracle 10gThat is not a version. That is a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".Not possible as your data model does not cater for it. That simple.
    If there is a need to determine some order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or more attributes are needed to represent that information. Thus your data model in this case is unable to meet your requirements.
    If the requirements are valid, fix the data model. In other words - your question has nothing to do with Oracle and nothing to do with rowid, rowscn or other pseudo columns in Oracle. It is a pure data modeling issue. Nothing more.

  • Can BO Enterprize SDK inserts records into user table

    From Infostore can we create a jsp script using Java SDK to inserts records into user table??
    Thanks
    Amar

    Hi Amar,
    I want to retrieve data/records from Infostore and insert into a user table using JSP script. Is it possible to do this?
    Infostore is a database used by BO Server. so any changes made in infostore through BO enterprise session is valid.
    Say u want to retrive on of report present in folder <my folder>.
    The you have to query for that. for eg.
    boinfostore.query("select * from ci_infoobjects where si_kind ='report' and si_foldername='my folder'");
    Create/add/insert any new information in infostore is done by functionalities provide by SDK.
    like adding the user or scheduling a report will add new object to infostore.
    If you directly access cms database and make any changes then , I am afraid you will end up with nightmare.
    So it is always recommneded to access infostore/ cms database only from bo session.
    For more information refer below link
    [http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm]
    then under Contents
    BusinessObjects Enterprise SDK >>  COM developer guide and API reference >> Query Language Reference
    do revert if any queries
    Thanks,
    Praveen.

  • Reg : first inserted record in a table

    Hello all,
    Could any of you help me in writing a query to get the first
    inserted record into a table.
    Suppose I've the following table :
    my_table : structure
    Name Null? Type
    ID NOT NULL NUMBER
    Ive inserted value 20 into the table first, and then inserted
    value 10. I want to retrieve the first inserted record with
    value 20. How do I write the query for that ??????
    Awaiting for the reply,
    Thanks in Advance...
    Srini

    One small disagreement with Andrew's posting, but
    rownum is assigned to rows after they have been identified
    as part of the result set, but before the ORDER BY is
    applied. Hence the two queries ...
    select * from my_table
    where rownum = 1
    order by id ASC
    ... and ...
    select * from my_table
    where rownum = 1
    order by id DESC
    ... will probably return the same result.
    However in neither case is the result guaranteed to be the
    first inserted row.
    If you had created a table very recently, and it had only a
    single extent, you could get the first row of the first block of
    that extent with ...
    select * from my_table where rowid =
    (select min(rowid) from my_table)
    ... but as Andrew says, the only way to do the job properly is
    to timestamp the rows as they are inserted. Anything else
    would only be of theoretical interest.

  • How to insert record in sorted table

    Hi,
    Please tell me how to inser the record in the sorted internal table. This is the code which is not working properly. just tell me what r the changes need to b done.
    Thanks,(reward points for sure)
    DATA: BEGIN OF connection,
            cityfrom TYPE spfli-cityfrom,
            cityto   TYPE spfli-cityto,
            distid   TYPE spfli-distid,
            distance TYPE spfli-distance,
          END OF connection.
    DATA connection_tab LIKE sorted TABLE OF connection
                        WITH  KEY cityfrom
                                     with header line.
    SELECT cityfrom cityto distid distance
           FROM spfli
           INTO connection.
      INSERT connection INTO connection_tab.
    ENDSELECT.
    loop at connection_tab.
    write: / connection_tab-cityfrom, connection_tab-cityto, connection_tab-distid, connection_tab-distance.
    endloop.
    connection-cityfrom = 'Bangalore'.
    connection-cityto = 'Delhi'.
    connection-cityfrom = 'KL'.
    connection-cityfrom = '2500'.
    insert connection to  connection_tab .
    loop at connection_tab.
    write: / connection_tab-cityfrom, connection_tab-cityto, connection_tab-distid, connection_tab-distance.
    endloop.

    Hi,
    sorry that's by mistake.. but  i m getting runtime error if i insert record into sorted table
    DATA: BEGIN OF connection,
    cityfrom TYPE spfli-cityfrom,
    cityto TYPE spfli-cityto,
    distid TYPE spfli-distid,
    distance TYPE spfli-distance,
    END OF connection.
    DATA connection_tab LIKE sorted TABLE OF connection
    WITH  unique KEY cityfrom
    with header line.
    SELECT cityfrom cityto distid distance
    FROM spfli
    INTO connection.
    INSERT connection INTO connection_tab.
    ENDSELECT.
    loop at connection_tab.
    write: / connection_tab-cityfrom, connection_tab-cityto, connection_tab-distid, connection_tab-distance.
    endloop.
    connection-cityfrom = 'Bangalore'.
    connection-cityto = 'Delhi'.
    connection-distid = 'KL'.
    connection-distance = '2500'.
    insert connection into table connection_tab .
    loop at connection_tab.
    write: / connection_tab-cityfrom, connection_tab-cityto, connection_tab-distid, connection_tab-distance.
    endloop.

  • How can i use BAPI to insert a few records  into standard table

    Can anyone help me with how can i use BAPI to insert some records into a standard table from an internal table?

    Hi,
    First of All try to Explain your Question first.
    This is a general question without mentioning the Table you want to Update.
    Please give the details before posting a question  so it will help people to understand your Problem.
    Regards
    Sandipan

  • How can i use BAPI to insert a few records into standard table usobt_c

    I needed to compare the records of this table on two different systems and update the records that were in system A but not in system B into system B. Please give your inputs.

    Hi,
    First of All try to Explain your Question first.
    This is a general question without mentioning the Table you want to Update.
    Please give the details before posting a question  so it will help people to understand your Problem.
    Regards
    Sandipan

Maybe you are looking for

  • Running report from forms

    hi, I am having problems in running report from form. I am using oracle 9i on windows 2000 server and no 9iAS at the moment. On client side, i have windows xp and 9iDS installed. I want to run report from forms in 9iDS testing environment. my forms a

  • Archiving Adapter Engine Messages

    For AE we have implemented the Archiving: The steps for AE we took are as follows: 1. Created archive store, and after that done home path synch and assigned it to an archive path. 2. created the archiving  background job in RWB with rules and have d

  • Problem in HTMLB..Please Help...urgent....:(

    Hello All, Please refer to the below code: package com.sap.NewOrderAssignment; import java.io.Serializable; import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.GregorianCalendar; import com.sapportals.htmlb.*;

  • What do I do if my ipod doesn't produce sound

    what do I do if my ipod doesn't produce sound

  • Logic/Motu 828/Logic control problems!!  I'm lost!

    Hi guys, I have a mac pro OS 10.4.8, Logic 7.2.3, Motu 828 Mark 2, Micro Lite midi hardware, a Xio Synth and a mackie logic control. Everytime I launch my Logic my mackie does something different. Sometimes it works, sometimes it doesnt, when I go to