Urgent help needed in inserting data into a custom table in oracle WorkFlow

Hi
I am trying to get data from the WF and insert into a custom table..
I read that workflow procedures WONT allow commits...
Oracle Workflow will not support autonomous commits in any procedure it calls directly. If you need to perform commits, then embed your SQL in a subprocedure and declare it as an autonomous block. This subprocedure must be capable of being rerun. Additionally, note that Oracle Workflow handles errors by rolling back the entire procedure and setting its status to ERROR. Database updates performed by autonomous commits cannot be rolled back, so you will need to write your own compensatory logic for error handling
Have anyone did this..
Please give me some idea ...It is urgent
I am getting data using getitemattribute..and try to insert it into a custom table
thanks
kp

Pl do not post duplicate threads - insert dont work in Workflow
Srini

Similar Messages

  • Drop, create and insert data into few intermediate tables

    Hi All,
    I need to schedule a process to drop, create and insert data into few intermediate tables on a weekly basis. Here is what i need to do in the stored procedure, which can be scheduled weekly.
    DROP TABLE TABLE_NAME1;
    DROP TABLE TABLE_NAME2;
    DROP TABLE TABLE_NAME3;
    CREATE TABLE TABLE_NAME1
    CREATE TABLE TABLE_NAME2
    CREATE TABLE TABLE_NAME3
    INSERT INTO TABLE_NAME1 SELECT ....;
    INSERT INTO TABLE_NAME2 SELECT ....;
    INSERT INTO TABLE_NAME3 SELECT ....;
    Any suggestions, examples or code on how to accomplish this task would be very helpful. Any question pls let me know.
    Thanks in advance.

    I am using the intermediate tables in an extract process. The idea was that the table would be created prior to calling the extract procedure and once the data written to the intermediate table had been processed the table would be dropped. This would be repeated each time the extract process is run. From a DBA's point or view, would it be better to just leave the table on the database and truncate it after each run or is removing it entirely best?

  • DB Adapters inserting data into 2 diff tables of same database giving issue

    Hello,
    I am using Oracle soa suite 11g BPEL.
    I need to insert data in 4 different tables of same Oracle database with the requirement of rollback all data if error occurs anywhere.
    I have configured the DB adapater as XA enabled on console .
    In code:-
    I am using 2 DBAdapters to insert data one by one in 2 diff tables of same DB (using INSERT ONLY operations). Before each invoke activity i am using a transformation activity to prepare the input variable of the DBAdapter.
    When i run this code i get below error:-
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [DBINS_DIANA.XxontPoiHdrsIface]. Caused by java.sql.BatchUpdateException: ORA-02049: timeout: distributed transaction waiting for lock . ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
    If i use a wait activity between the 2 invokes i get the data inserted fine , but that means the transactions between inserts would be committed which i want to be rollback fully in case of any errors.
    Can anyone have a clue what is wrong here?
    Thanks
    Shivani

    Hi Anagha,
    Have a look at these links:
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/d5653fd1d3b81ae10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/frameset.htm
    Regards,
    Chandra

  • Insert data into a database table from a string

    Hi,
    I am need to insert data into a table from  the text file. I pull the data into an internal table using GUI_UPLoad. I read the data into an internal table and concatenate data into a string. I need to do this because the structure of the table is dynamic. it is used to upload a series of tables each with different structure, But the data is stored in the string v_tabledata.  How to do that.
    after uploading the data  from the textt file into a table
    oop at i_final.
       v_tabname = i_final-table_name.
      concatenate i_final-table_rec1 i_final-table_rec2 i_final-table_rec3
                  i_final-table_rec4 i_final-table_rec5 into v_tabledata.
    from  'v_table data'  i need to upload the data into a table and the structue of the table is known dynamically. Any thoughts using field symbols?
    Thanks,
    VG

    Let me see if I've understood your issue
    You have a file to be uploaded into an internal table but this file has many different layouts and then you don't know how to link these fields with the internal table...is it your issue?
    Then you've read the internal table, you've sent it to a string divided by space or something else and then are you trying to read this string to send it to a table?
    We could read the standard tables which maintain the program names, table names etc... (DD* tables, as the DD03L table) and then create some rules...
    We could create a parameter table to read your file/table dynamically...
    Please, try to rewrite in other words your problem...because there are a lot of ways to achieve your issue...
    Alexandre Mendes

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • Insert data into msql thru table trigger

    Hi,
    I installed dg4msql 11.2 and I would like to insert some data into our msql thru one of our Oracle table after insert table,
    I used the syntax below
    insert into test@dg4msql ("PN") values (:new.PN)
    but the below error problem if I insert data into my Oracle table,
    ORA-02054: transaction 4.17.15898 in-doubt
    ORA-028500, connect from ORACLE to a non-Oracle system returned this message
    [Oracle][ODBC SQL Server Driver][SQL Server] Invalid object name "RECOVER.HS_TRANSACTION_LOG
    Do I have to create the HS_TRANSACTION_LOG table in my msql server to resolve this problem?
    Thanks
    Vincent

    Vincent,
    If the gateway insert is being done as part of a trigger then it will almost certainly be part of a distributed transaction so yes, you will have to create the transaction log table and the recovery user in the SQL*Server database.
    As well as the gateway documentation have a look at this note in My Oracle Support -
    Note.227011.1 How to Setup DG4MSQL to Use Distributed Transactions          (Doc ID 227011.1)
    Regards,
    Mike

  • Update real time account general data into a custom table

    Hi,
    I have created a z table for storing account general data for some business requirement. I have created a program and executing batch job to update this z table on periodic basis. Can anyone suggest some other alternative solution to update this z table whenever an account gets created/modified in CRM system? Instead of running a batch job periodically, I need a real time replication of the account data in this custom table.
    Thanks and Regards,
    Sneha.

    Hi,
    Thanks for your reply.
    But, Can you elaborate the solution, Can we use Business Transaction Events(BTEs) for updating Partner data? Will these be triggered for Account Creation/Modification. If so, Can u suggest any BTE which can be used for my requirement?
    Thanks and Regards,
    Sneha.

  • Please help me in inserting data into table from XML message.

    Hi Experts,
    Please provide a procedure to implement my below requirement.
    Since I am new to queue concept.
    [code]- <MESSAGES>
    - <MESSAGE ID="3026900">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    - <MSG>
    - <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    - <WORK_UNIT GROUP="LEAD_TIME" ACTION="UPDATE" AFFECTED="LEAD_TIME">
    - <RECORDSET TABLE_NAME="LEAD_TIME">
    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <rs:data>
      <z:row business_unit_id="3838" geo="AT" sku="A0814818" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      <z:row business_unit_id="202" geo="GB" sku="A0814819" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      <z:row business_unit_id="2828" geo="BE" sku="A0814820" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
    - <WORK_UNIT GROUP="LEAD_TIME" ACTION="ADD" AFFECTED="LEAD_TIME">
    - <RECORDSET TABLE_NAME="LEAD_TIME">
    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <rs:data>
      <z:row business_unit_id="202" geo="GB" sku="A0814821" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      <z:row business_unit_id="2828" geo="BE" sku="A0814822" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
    - <WORK_UNIT GROUP="LEAD_TIME" ACTION="DELETE" AFFECTED="LEAD_TIME">
    - <RECORDSET TABLE_NAME="LEAD_TIME">
    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <rs:data>
      <z:row business_unit_id="202" geo="GB" sku="A0814817" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      <z:row business_unit_id="2828" geo="BE" sku="A0814816" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>[/code]
    The above XML message is receieved by our oracle queue.Once the message is receieved to our queue.
    We have to process the message according to the action(UPDATE ADD DELETE).
    From this message we have to process only 3 fields (geo  sku lead_time).
    These three feilds data should be processed into the SKU_LEAD_TIME table based on the action.
    Req1:
    IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
    IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
    based on the below condition.
    [code]UPDATE LEAD_TIME_TABLE SET lead_time= lead time from xml message
    WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;[/code]
    Req2:
    IF the action is delete then the records should be deleted from the "LEAD_TIME_TABLE" table.
    based on the below condition.
    [code]DELETE FROM LEAD_TIME_TABLE
    WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;[/code]
    Req3:
    IF the action is add then the records should be inserted in the "LEAD_TIME_TABLE"  and "LEAD_TIME_TABLE_STAGING" table
    based on the below conditions.
    Req3.1:
    If SKU from XML message is available in "SKU_TABLE" table
    then the three parameter(GEO SKU LEAD_TIME) values from XML message should be inserted into "LEAD_TIME_TABLE" table.
    Req3.2:
    If SKU from XML message is not available in "SKU_TABLE" table
    then the three parameter(GEO SKU LEAD_TIME) values from XML message should be inserted into "LEAD_TIME_TABLE_STAGING" table.
    Req3.3:
    Once the new SKU is avilable in "SKU_TABLE" table then the corresponding SKU record should be
    inserted into "LEAD_TIME_TABLE" table and that record should be deleted from  "LEAD_TIME_TABLE_STAGING" table.
    I am posting required scripts and test cases.
    [code]CREATE TABLE LEAD_TIME_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class CHAR(1),geo VARCHAR2(6),lead_time NUMBER,created DATE);
    CREATE TABLE LEAD_TIME_TABLE_STAGING(sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
    CREATE TABLE SKU_TABLE(sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
    INSERT INTO SKU_TABLE VALUES('A0814817','GB',30);
    INSERT INTO SKU_TABLE VALUES('A0814818','AT',30);
    INSERT INTO SKU_TABLE VALUES('A0814819','GB',30);
    INSERT INTO SKU_TABLE VALUES('A0814820','BE',30);
    INSERT INTO SKU_TABLE VALUES('A0814821','GB',30);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814817','GB',30);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814818','AT',20);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814819','GB',20);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814820','BE',20);
    INSERT INTO LEAD_TIME_TABLE_STAGING VALUES('A0814822','BE',30);[/code]
    From the above message.
    Test case for req3.1:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814821" is available in SKU_TABLE table.
    so the record should be inserted in the LEAD_TIME_TABLE.
    [code]SELECT * FROM LEAD_TIME_TABLE;
    SKU        GEO   LEAD_TIME
    A0814817    GB    30
    A0814818    AT    20
    A0814819    GB    20
    A0814820    BE    20
    A0814821    GB    30[/code]
    Test case for req3.2:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814822" is not available in SKU_TABLE table.
    so the record should be inserted in the LEAD_TIME_TABLE_STAGING.
    [code]SELECT * FROM LEAD_TIME_TABLE_STAGING;
    SKU        GEO   LEAD_TIME
    A0814822    BE     30[/code]
    Test case for req3.3:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814822" is not available in SKU_TABLE table.
    Once I insert SKU number "A0814822" in SKU_TABLE table.
    The corresponding records automatically should be inserted in the LEAD_TIME_TABLE
    and should be deleted from LEAD_TIME_TABLE_STAGING.
    [code]SELECT * FROM LEAD_TIME_TABLE_STAGING;  --- should return NULL.
    SELECT * FROM LEAD_TIME_TABLE;
    SKU        GEO   LEAD_TIME
    A0814817    GB    30
    A0814818    AT    20
    A0814819    GB    20
    A0814820    BE    20
    A0814821    GB    30
    A0814822    BE    30[/code]
    Please help me.
    Thanks in advance.

    Hi,
    I have resolved this issue.
    But I have stuck up in implementing some of the scenarios.
    Req1:
    IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
    IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
    based on the below condition.
    UPDATE LEAD_TIME_TABLE SET lead_time= lead time from xml message
    WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;
    Req3:
    IF the action is add then the records should be inserted in the "LEAD_TIME_TABLE"  and "LEAD_TIME_TABLE_STAGING" table
    based on the below conditions.
    Req3.1:
    If SKU from XML message is available in "schema_name.SKU_TABLE" table.
    The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of XML message and "sid" of MAPPING table WHERE business_unit_id=sid.
    then the three parameter(GEO SKU LEAD_TIME) values from XML message and two fields MODEL,CLASS from SKU_TABLE
    should be inserted into "LEAD_TIME_TABLE" table.
    Req3.2:
    If SKU from XML message is not available in "schema_name.SKU_TABLE" table
    The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of XML message and "sid" of MAPPING table WHERE business_unit_id=sid.
    then the four parameter(BUSINESS_UNIT_ID GEO SKU LEAD_TIME) values from XML message
    should be inserted into "LEAD_TIME_TABLE_STAGING" table.
    Req3.3:
    Once the new SKU is avilable in "schema_name.SKU_TABLE" table then the corresponding SKU record should be
    inserted into "LEAD_TIME_TABLE" table and that record should be deleted from  "LEAD_TIME_TABLE_STAGING" table.
    The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of LEAD_TIME_TABLE_STAGING and "sid" of MAPPING table WHERE business_unit_id=sid.
    I am posting required scripts and test cases.
    [code]CREATE TABLE LEAD_TIME_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class CHAR(1),geo VARCHAR2(6),lead_time NUMBER,created DATE);
    CREATE TABLE LEAD_TIME_TABLE_STAGING(business_unit_id NUMBER,sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
    CREATE TABLE SKU_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class VARCHAR2(10));
    CREATE TABLE mapping(sid NUMBER,schema_name VARCHAR2(20));
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814817','GB',30);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814818','AT',20);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814819','GB',20);
    INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814820','BE',20);
    INSERT INTO SKU_TABLE VALUES('A0814817','M125','C111');
    INSERT INTO SKU_TABLE VALUES('A0814818','M127','A111');
    INSERT INTO SKU_TABLE VALUES('A0814819','M126','A111');
    INSERT INTO SKU_TABLE VALUES('A0814820','N100','B111');
    INSERT INTO SKU_TABLE VALUES('A0814821','P123','B111');
    INSERT INTO mapping VALUES(202,'WEDB');
    INSERT INTO mapping VALUES(2828,'HR');
    INSERT INTO mapping VALUES(3838,'BB');
    [/code]
    Test case for req3.1:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814821" is available in schema_name.SKU_TABLE table.
    so the record should be inserted in the LEAD_TIME_TABLE.
    [code]SELECT * FROM LEAD_TIME_TABLE;
    SKU        MODEL  CLASS  GEO   LEAD_TIME
    A0814817    M125   C111   GB     30
    A0814818    M127   A111   AT     20
    A0814819    M126   A111   GB     20
    A0814820    N100   B111   BE     20
    A0814821    P123   B111   GB     30
    [/code]
    Test case for req3.2:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814822" is not available in SKU_TABLE table.
    so the record should be inserted in the LEAD_TIME_TABLE_STAGING.
    [code]SELECT * FROM LEAD_TIME_TABLE_STAGING;
    BUSINESS_UNIT_ID       SKU        GEO   LEAD_TIME
    2828               A0814822    BE     30[/code]
    Test case3.3.3:
    The action for SKU numbers "A0814821"  "A0814822" are insert.
    The SKU number  "A0814822" is not available in SKU_TABLE table.
    Once I insert SKU number "A0814822" in SKU_TABLE table.
    The corresponding records automatically should be inserted in the LEAD_TIME_TABLE
    and should be deleted from LEAD_TIME_TABLE_STAGING.
    [code]INSERT INTO SKU_TABLE VALUES('A0814822','P123','B111');
    SELECT * FROM LEAD_TIME_TABLE_STAGING;  --- should return NULL.
    SELECT * FROM LEAD_TIME_TABLE;
    SKU        MODEL  CLASS  GEO   LEAD_TIME
    A0814817    M125   C111   GB     30
    A0814818    M127   A111   AT     20
    A0814819    M126   A111   GB     20
    A0814820    N100   B111   BE     20
    A0814821    P123   B111   GB     30
    A0814822    P123   B111   GB     30[/code]
    I am able to implement Req1 and Req3.1 for action UPDATE and INSERT in single merge statement.
    However my code is not taking care of all my requirements.
    Please find my below code.
    [code]   CREATE OR REPLACE PACKAGE BODY messg_values_process
       AS
        procedure ProcessInboundLtimeMessage(p_xml_message XmlType)
        is
        begin
            for work_unit in (
                select message.MESSAGE_ID
                     , work_unit.ACTION
                     , work_unit.LEADTIME_NODES
                  from XmlTable(
                        '/MESSAGES/MESSAGE'
                        passing p_xml_message
                        columns
                            MESSAGE_NO          for ordinality
                          , MESSAGE_ID          number path '@ID'
                          , WORK_UNIT_NODES     XmlType path 'MSG/WORK_SET/WORK_UNIT'
                       ) message
                     , XmlTable(
                        XmlNamespaces(
                            'urn:schemas-microsoft-com:rowset' as "rs"
                          , '#RowsetSchema' as "z"
                        '/WORK_UNIT'
                        passing message.WORK_UNIT_NODES
                        columns
                            WORK_UNIT_NO        for ordinality
                          , ACTION              varchar2(10 char) path '@ACTION'
                          , LEADTIME_NODES       XmlType path 'RECORDSET[@TABLE_NAME="LEAD_TIME"]/xml/rs:data/z:row'
                       ) work_unit
        LOOP
                CASE work_unit.ACTION
                  WHEN 'ADD'    THEN MergeData(work_unit.LEADTIME_NODES);
                  WHEN 'UPDATE' THEN MergeData(work_unit.LEADTIME_NODES);
                  WHEN 'DELETE' THEN RemoveData(work_unit.LEADTIME_NODES);
                  ELSE null;
                END CASE;
            END LOOP;
        END ProcessInboundLtimeMessage;
            procedure MergeData(p_leadtime_nodes XmlType)
        is
        begin
            if (p_leadtime_nodes is not null) then
                merge into LEAD_TIME_TABLE old
                using(
                    select *
                      from XmlTable(
                            XmlNamespaces(
                                'urn:schemas-microsoft-com:rowset' as "rs"
                              , '#RowsetSchema' as "z"
                            '/z:row[not(@business_unit_id=following-sibling::z:row/@business_unit_id)]'
                            passing p_leadtime_nodes
                            columns
                                ITEM_NO             for ordinality
                              , BUSINESS_UNIT_ID    number path '@business_unit_id'
                              , GEO                 varchar2(20 char) path '@geo'
                              , SKU                 varchar2(20 char) path '@sku'
                              , LEAD_TIME           number path '@lead_time'
                ) NEW
                   ON (old.VK_UNIT = new.SKU
                  AND old.GEO=new.GEO)
                when matched then update
                   set old.LEAD_TIME = new.LEAD_TIME
                when not matched then INSERT
                     ( old.VK_UNIT
                     , old.MODEL
                     , old.CLASS
                     , old.GEO
                     , old.LEAD_TIME
                     , old.COUNTDOWN
                     , old.LAST_UPDATED_DATE
                     values
                     ( new.SKU
                     ,'A123'
                     ,'A1234'
                     , new.GEO
                     , new.LEAD_TIME
                     , 'N'
                     , sysdate
            end if;
             exception
            when others then
                LogDataError(
                    'MergeData Procedure Failed #: '||chr(10)||sqlerrm
                  , null
                  , null
        END MergeData;
    END messg_values_process;
    /[/code]
    Please help me.
    Thanks.

  • Help needed in pushing data into Table view Popup

    Hi All,
    I am trying to create a custom pop up and populate this with Reason code and descriptions. For this, i have created a popup and placed a table view on the popup. But when i am stuck how to push data into the popup from an internal table.
    Any pointers on this will be really helpful.
    Regards,
    Udaya

    Hi,
    Even I am facing the similar issue.  I have created custom component with four views for my requirement and created one view set and displaying the viewset in the pop up screen.  I also created event handler and added required coding to open the pop up screen.
    I have added event handler in BT116H_SRVO component and now the pop up is opend with the required fields but the field is not having any data the value is empty in the pop up screen.  I also binded context node details in the standard component.
    While debugging I found that the collection wrapper is empty, so the data is not populated in the pop up screen.  So kindly hlep me how to fill the collection wrapper and populate data inside the pop up screen.
    kindly let me know how to overcome this issue. 
    Thanks and Regards,
    Kannan.

  • Help needed to insert data from different database

    Hi ,
    I have a requirement where i need to fetch data from different database through database link .Depending on user request , the dblink needs to change and data from respective table from mentioned datbase has to be fetched and populated .Could i use execute immediate for this, would dblink work within execute immediate .If not , could pls let me know any other approach .

    What does "the dblink needs to change" mean?
    Are you trying to dynamically create database links at run-time? Or to point a query at one of a set of pre-established database links at run-time?
    Are you sure that you really need to get the data from the remote database in real time? Could you use materialized views/ Streams/ etc to move the data from the remote databases to the local database? That tends to be far more robust.
    Justin

  • Doubt on inserting data into rcv interface tables

    Hi all,can anyone kindly suggest me what are the mandatory columns in rcv_headers_interface and rcv_transactions_interface tables to insert data so that after running Material Transaction Processor concurrent program the data in these interface tables should populate in rcv_shipment_headers and rcv_shipment_lines.
    I am close on this,but i am getting some errors in po_interface_errors like "transaction_type" is invalid in rcv_transactions_interface table and invalid "shipment_num" in rcv_headers_interface.
    So, someone kindly suggest me what exactly i need to insert into these tables.
    FYI..this is what i inserted
    INSERT INTO rcv_headers_interface
    HEADER_INTERFACE_ID,
    GROUP_ID,
    PROCESSING_STATUS_CODE,
    RECEIPT_SOURCE_CODE,
    TRANSACTION_TYPE,
    AUTO_TRANSACT_CODE,
    LAST_UPDATE_DATE,
    LAST_UPDATE_LOGIN,
    LAST_UPDATED_BY,
    CREATION_DATE,
    CREATED_BY,
    VALIDATION_FLAG,
    COMMENTS,
    SHIPMENT_NUM,
    FROM_ORGANIZATION_ID,
    SHIP_TO_ORGANIZATION_ID,
    EXPECTED_RECEIPT_DATE,
    RECEIPT_HEADER_ID
    SELECT
    landed_cost_interface_s.NEXTVAL,              --Header Interface ID
    landed_cost_interface_groups_s.NEXTVAL,       --Group ID
    'PENDING',                                    --Processing Status Code
    'INVENTORY',                                  --Receipt source Code
    'RECEIVE',                                    --Transaction Type
    'DELIVER'  ,                                   --AUT Transact Code
    lc.last_update_date,                          --last update date
    lc.last_updated_by,                           --last updated by
    fnd.user_id,                                  --Last Update Login
    sysdate,                                      --creation date
    lc.created_by,                                --created by
    'Y',                                          --Validation Flag
    'Receiving Through Interface',                --Comments
    lc.file_number,                                --Shipment Number
    81,                                           --From Org
    82,                                           --To org
    sysdate,                                      --Expected Receipt Date
    regal.regal_inv_landed_cost_seq.nextval       --Receipt Header ID
    FROM   regal.regal_inv_landed_cost_tab lc,
            fnd_user fnd
    WHERE  lc.last_updated_by = fnd.last_updated_by
    AND    lc.file_number='NOV612';
    INSERT INTO rcv_transactions_interface
                 HEADER_INTERFACE_ID,
                 GROUP_ID,
                 INTERFACE_TRANSACTION_ID,
                 TRANSACTION_TYPE,
                 TRANSACTION_DATE,
                 PROCESSING_STATUS_CODE,
                 PROCESSING_MODE_CODE,
                 TRANSACTION_STATUS_CODE,
                 CATEGORY_ID,
                 QUANTITY,
                 LAST_UPDATE_DATE,
                 LAST_UPDATED_BY,
                 CREATION_DATE,
                 CREATED_BY,
                 RECEIPT_SOURCE_CODE,
                 DESTINATION_TYPE_CODE,
                 AUTO_TRANSACT_CODE,
                 SOURCE_DOCUMENT_CODE,
                 UNIT_OF_MEASURE,
                 INTERFACE_SOURCE_CODE,
                 ITEM_ID,
                 UOM_CODE,
                 EMPLOYEE_ID,
                 SHIPMENT_HEADER_ID,
                 SHIPMENT_LINE_ID,
                 TO_ORGANIZATION_ID,
                 SUBINVENTORY,
                 FROM_ORGANIZATION_ID,
                 FROM_SUBINVENTORY,
                 EXPECTED_RECEIPT_DATE,
                 SHIPPED_DATE
    SELECT
         landed_cost_interface_s.CURRVAL,              --Header Interface ID
         landed_cost_interface_groups_s.CURRVAL,       --Group ID
         landed_cost_interface_s.NEXTVAL,              --Interface_transaction_id
         'RECEIVE',                                       --Transaction Type
         sysdate,                                      --Transaction Date
         'PENDING',                                    --Processing Status Code
         'BATCH',                                      --Processing Mode Code
         'PENDING',                                    --Transaction Status Code
         129,                                      --Category ID   
         lc.quantity_received,                          --Quantity
         lc.last_update_date,                          --last update date
         lc.last_updated_by,                           --last updated by
         sysdate,                                      --creation date
         lc.created_by,                                --created by
         'INVENTORY',                                  --Receipt source Code
         'INVENTORY',                                  --Destination Type Code
         'DELIVER' ,                                    --AUTO Transact Code
         'INVENTORY',                                  --Source Document Code
          msi.primary_unit_of_measure ,                --Unit Of Measure
          'RCV',                                       --Interface Source Code
          msi.inventory_item_id,                        --Item ID
          msi.description,                              --Item Description
          msi.primary_uom_code,                         --UOM COde
          fnd.user_id,                                  --User
          V_A,                                         --Shipment Header ID
          V_B,                                         --SHipment Line ID
          82,                                           --To Organization ID
          'Brooklyn',                                     --Sub Inventory ID
          81,                                            --From Organization
          'Vessel',                                      --From Subinventory
          sysdate,                                       --Expected Receipt Date
          sysdate                                        --Shipped Date
      FROM
         regal.regal_inv_landed_cost_tab lc,
         fnd_user fnd,
         mtl_system_items msi
      WHERE
                 lc.organization_id = msi.organization_id
            AND  lc.inventory_item_id = msi.inventory_item_id
            AND  lc.last_updated_by = fnd.last_updated_by
            AND  msi.created_by = fnd.created_by
            AND  lc.file_number='NOV612';Any help is appreciated.
    Thanks in advance!!

    Thanks for your reply Sandeep Gandhi,i followed your advice and went through that metalink note but it didn't help much.Errors are cropping up every time,i am testing with only one value right now.Am i missing something like the flow of the whole process..
    --->First i have loaded data into mtl_interface table
    --->Next,i am trying to insert into rcv_headers_interface and rcv_transactions_interface
    So,is there any link between the data i am passing into mtl interface table and rcv interface tables?
    Thanks in advance!!
    Edited by: sandy on Oct 18, 2011 9:38 PM
    Edited by: sandy on Oct 19, 2011 10:03 AM

  • Insert data into an OR Table

    Can I please have some help to insert some data into a table.
    I have created an Peripheral_objtyp object and then created a table from this object:
    create type Peripheral_objtyp as Object (
    PeriphNo NUMBER,
    Comp_ref REF Computer_objtyp,
    PeriphName varchar2(20),
    PeriphType varchar2(20)
    create table Peripheral_objtab of Peripheral_objtyp (PeriphNo Primary Key) Object ID Primary Key
    Here is the Computer_objtyp:
    create type Computer_objtyp as object (
    CompNo Number,
    CompName      Varchar2(20),
    CompOS          Varchar2(20),
    CompProcessor     Varchar2(20),
    CompRAM          Varchar2(20),
    CurrentUser_obj CurrentUser_objtyp,
    HardDriveList_var HardDriveList_Vartyp )
    I am wanting to insert some data into the Peripheral_objtab. This is the code I have tried:
    INSERT INTO Peripheral_objtab
    SELECT 1, REF(C), 'Test', 'Test'
    FROM Computer_objtab C
    Where C.CompNo = 1;
    I am getting this error:
    SQL Error: ORA-22979: cannot INSERT object view REF or user-defined REF
    22979. 00000 - "cannot INSERT object view REF or user-defined REF"
    *Cause:    Attempt to insert an object view REF or user-defined REF in a
    REF column created to store system generated REF values"
    *Action: Make sure the REF to be inserted is not from an object view
    or from a user-defined REF column

    Difficult to know what is causing the issue without a complete test case (with sample data).
    Is Computer_objtab's object identifier the primary key as well ?
    Maybe the Comp_ref column has to be scoped, but that's just a guess at this point.
    BTW, you should have posted your question in the {forum:id=68} forum.

  • Inserting data into dynamic internal tables

    Hello everyone, i need some suggestions on the following problem:
    I have created a dynamic table that consist of storage locations(SL) belonging to a plant. Each record in the internal table would need to display all the SL on the same line. I have succesfully created it and displayed it on an ALV, the problem now is how to insert data for the dynamically created storage locations:
    EXAMPLE: Created dynamic itab
    colA | colB | SL1 | SL2 | ... | SLn | colC | <--header
    data | data | 100 | 120 | ... | 200 | data | <--record
    I would like to insert data from the fields of another itab into SL1 to SLn. How can i go about doing it?
    Data from ColA to ColC has been filled through:
    <i>loop at itab into w_itab.
    move-corresponding w_itab to <dyn_tab>.
    endloop.</i>
    I cannot do the same to the SLs as the fields is dynamically created during runtime and the fieldname is different from the data that i am to insert in into.
    Any ideas?

    Hi,
      I have the following code in my BADI:
    ct_value_list is defined in the parameters of the method as a type standard table.
    Create values list reference
    CREATE DATA lv_value_list_ref LIKE LINE OF ct_value_list.
    ASSIGN lv_value_list_ref->* TO <lfs_value_list>.
      IF CT_VALUE_LIST IS INITIAL.
        lv_tabix = sy-tabix.
        IF NOT LT_DATA[] IS INITIAL.
          LOOP AT lt_data assigning <lfs_data>.
            assign <lfs_data> to <lfs_value_list>.
          assign <lfs_value_list> to <lv_value_list>.
            ASSIGN COMPONENT lc_prvar OF STRUCTURE <lfs_value_list>
            TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
    Get the material id
            READ TABLE it_matkey_tab ASSIGNING <lfs_matkey>
              WITH KEY matnr = <lfs_attribute>.
            IF sy-subrc = 0.
              lv_matid = <lfs_matkey>-matid.
            ENDIF.
            ENDIF.
            ASSIGN COMPONENT lc_mktgr OF STRUCTURE <lfs_value_list>
              TO <lfs_attribute>.
            IF <lfs_value_list> IS ASSIGNED.
            READ TABLE it_loc ASSIGNING <lfs_loc>
              WITH KEY locno = <lfs_attribute>.
            IF sy-subrc = 0.
              lv_locid = <lfs_loc>-locid.
            ENDIF.
            READ TABLE it_matloc ASSIGNING <lfs_matloc_int>
              WITH KEY matid = lv_matid
                       locid = lv_locid.
           if sy-subrc = 0.
          MATLOC: Assignment of Values - START
              ASSIGN COMPONENT 'MATLOCID'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-matlocid.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
                INSERT <lfs_matloc_int> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'PLANNER_SNP'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-planner_snp.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'AT101'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-at101.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'AT102'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-at102.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'AT103'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-at103.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'AT104'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-at104.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
              ASSIGN COMPONENT 'AT105'
                OF STRUCTURE <lfs_matloc_int> TO <lfs_attribute>.
              IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_matloc_int>-at105.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
              ENDIF.
            endif.
           ENDIF.
            ASSIGN COMPONENT 'PRVAR'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-prvar.
               INSERT <lfs_value_list> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'PARPR'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-parpr.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'VARID'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-varid.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'VARCT'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-varct.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'VARTX'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-vartx.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'DMOAP'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-dmoap.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'PRDID'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-prdid.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BRFAM'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-brfam.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MATKL'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-matkl.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BRDIF'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-brdif.
               INSERT <lfs_attribute> INTO TABLE ct_value_list.
            ENDIF.
            ASSIGN COMPONENT 'MEIND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-meind.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MKLEN'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-mklen.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'PCKTY'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-pckty.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'ITPCK'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-itpck.
               INSERT <lfs_attribute> INTO TABLE ct_value_list.
            ENDIF.
            ASSIGN COMPONENT 'PMEIN'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-pmein.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MKTHK'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-mkthk.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'FLIND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-flind.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'EDTID'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-edtid.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BNDTY'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-bndty.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'ITBND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-itbnd.
                INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'ITCSE'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-itcse.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'TPCOL'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-tpcol.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'SPFLV'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-spflv.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'PRSHP'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-prshp.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MKTGR'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-mktgr.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'SUBMK'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-submk.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BOMHD'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-bomhd.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BRDSC'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-brdsc.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MKSTR'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-mkstr.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'EDDSC'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-eddsc.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'EDCAT'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-edcat.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'CCIND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-ccind.
             INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'CGSTY'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-cgsty.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'FLTTY'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-fltty.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'CPIND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-cpind.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MBIND'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-mbind.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'USPRP'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-usprp.
             INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'EDDET'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-eddet.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'BRGEW'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-brgew.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'NTGEW'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-ntgew.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'GEWEI'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-gewei.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'VOLUM'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-volum.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'VOLEH'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-voleh.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'DMOAPP1'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-dmoapp1.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'MAKTX'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
               <lfs_attribute> = <lfs_value_list>-maktx.
               INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
            ASSIGN COMPONENT 'RPLVL'
                OF STRUCTURE <lfs_value_list> TO <lfs_attribute>.
            IF <lfs_attribute> IS ASSIGNED.
              <lfs_attribute> = <lfs_value_list>-rplvl.
              INSERT <lfs_attribute> INTO TABLE <lv_value_list>.
            ENDIF.
         ENDLOOP.
        ENDIF.
    ENDIF.
    I get a shortdump in the code for the above code. There are diff types of inserts that I am trying to do and each one gives a short dump.
    Looking forward to your inputs.
    Your program is not applicable in my case as I have ct_value_list passed as a changing parameter of type standard table in my APO BADI.
    cheers
    Aveek

  • Insert data into two related tables in one transaction

    Hi all,
    I’ve got problem with developing functionality.
    Background:
    I’ve got two tables: OFFER_HEADER and OFFER_CONTENT
    For now, user has to insert and commit the OFFER_HEADER(single-row view), then content becomes reachable and OFFER_CONTENT(multi-row view) can be filled. It is being done by choosing record from PRODUCTS form and inserting values into OFFER_CONTENT. Product data can be modified on the CONTENT form canvas.
    My goal:
    I know that is not convenient way to implement the functionality. I want to insert all the data(header and content) in one transaction. What is the best way to do it?
    Thanks in advance,
    Best Regards,
    Bartek

    1. User is on the OFFER_CONTENT canvasOk
    2. User presses ‘+’ buttonOk
    3. On the screen is displayer PRODUCT list
    4. User set focus on desired product
    5. Using popup menu user choose ‘Add’ option
    6. PRODUCT list is being closedSo, the functionlatity is like a LoV?
    7. OFFER_CONTENT is being shown with set of information from the productOk, you would either take the values directly from the fields of the PRODUCT-list and copy them into the OFFER_CONTENT-fields, or you just get something like the PRODUCT-ID from your PRODUCT-list and use a SELECT to read the product-details into the OFFER_CONTENT-block
    8. User can then manually change desired elements of the recordOk.
    So, where do you have the need to do an INSERT in your scenario?

  • Insert Data into a PK Table from a Non-PK Table

    Suppose I have a Table A with 10 columns in Schema 1 and there are 100 records in it. Now I create a Table B with the same 10 columns but create 4 columns as Primary Key in another Schema 2. I want to Insert the data from Table A into Table B but the 100 rows of data have duplicate entries of Primary Key and so I get Primary Key constraint violation. I want to know whether I will be able to Insert data by a quey and if so how?

    Tried to simulate ur scenario in my environment...check the insert statement...you can implement it to get ur solution.
    Here it goes:
    SQL> desc testt; <table u want to insert from,this has no pk>
    Name Null? Type
    DEPTNO NUMBER
    JOB VARCHAR2(10)
    SQL> desc testt_t;<table to be loaded,table with pk>
    Name Null? Type
    DEPTNO NOT NULL NUMBER
    JOB VARCHAR2(10)
    SQL> select * from testt;
    DEPTNO JOB
    10 aaa
    11 bbb
    12 ccc
    10 aaa
    11 bbb
    12 ccc
    10 aaa
    7 rows selected.
    SQL> select * from testt_t;
    no rows selected
    SQL> insert into testt_t (select t1.deptno,t1.job from testt t1 where t1.rowid =(select min(t2.rowid
    ) from testt t2 where t1.DEPTNO=t2.DEPTNO and t1.JOB=t2.job));
    3 rows created.
    SQL>

Maybe you are looking for