SOP: How to update ratio values

Hi everyone,
I have defined an Information Structure with some characteristics and ratios, all of them associated to some ZTable fields.
Well, I would be very grateful whether someone could tell how to update ratio values in my Information Structure. I mean I would like to know which are the steps I have to follow in order to update tha value of my ratios everytime its associated ZField changes its value.
I have the idea of using this Information Structure in a "Level-by-Level" planning type using Product Groups.
Thanks in advance and best regards.
Ben.

Hi again,
Actually I have already created my planning type with some macro instructions and I have checked that they work properly in MC94. I have also created a planning hierarchy as you requested.
But my problem doesn't deal with this. The key figures that I have included in my structure represent values in SAP (i.e. Sold units, Security stocks...).
What I need to do is update the value of that key figures in my structure for all the combinations of my characteristics.
I hope my explanation is quite better this time.
Thanks.

Similar Messages

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • Reg:How to update VC values using BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    We are creating sales order using the BAPI_SALESORDER_CREATEFROMDAT2 FM but we also want to update variant configuration values in those sales orders. I'm passing these tables (ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_VALUE) to the FM.'
    The sales order is been created but the VC characteristics are not getting updated.
    After the FM I am calling the commit also..
    Am I missing anything..Please guide me how to update the VC values..

    hi,
    use swo1 for uploading BAPIs
    regards,
    uttam.

  • User_sdo_geom_metadata - how to update tolerance value

    Hello,
    I need to update my tolerance values within the DIMINFO field of the user_sdo_geom_metadata table. I'm new to updating "objects" via sql.
    Could someone provide an SQL example of how to update the tolerance value(s).
    Thanks very much,
    David Hagemann

    I need to query points at a certain distance from the interstate.
    This is my query
    =======================
    select objectid
    from Table_points , interstates
    where highway = 'I 95'
    and mdsys.sdo_within_distance (
    Table_points.shape, interstates.geom,
    'distance=2.5 layer_gtype=POINT') = 'TRUE';
    =======================
    This is the error I got
    ERROR at line 1:
    ORA-13285: Geometry coordinate transformation error
    ORA-29400: data cartridge error
    ORA-22060: argument [2] is an invalid or uninitialized number
    ORA-06512: at "MDSYS.SDO_3GL", line 160
    ORA-06512: at "MDSYS.SDO_3GL", line 266
    ORA-06512: at line 1
    =========================
    Anyone has an idea where I am wrong
    Thanks
    Tan

  • How to update Elements value inside existing xml file

    Hi Gurus,
    Am somehow new to java and working on xml with java, i have a scenario where i want to update the elements of my existing xml file, i know its possible as i have posted one code on this forum which updates the values of the arrtibutes of existing xml file. Ref :
    http://forum.java.sun.com/thread.jsp?forum=34&thread=186091&start=15&range=15&hilite=false&q=
    But am not able to use the same code to update the vlaues of the attribute.
    if i have this xml file :
    <?xml version="1.0"?>
    <RootElement>
    <Transaction>
    <Task9>
    <TaskID>Task9</TaskID>
    <Description>My Test Case</Description>
    <Time>12/12/2004</Time>
    </Task9>
    </Transaction>
    <Transaction>
    <Task2>
    <TaskID>Task2</TaskID>
    <Description>Testing my xml</Description>
    <Time>12/12/2004</Time>
    </Task2>
    </Transaction>
    </RootElemen>
    Now i want to update teh </Description> and </Time> field using the code that i have given above in the link.
    If any one can help me ill really appreciate.

    The value of an element is stored in a child node of that element. For example, let's say that "e" references the node <Description> then:
    e.getFirstChild().getNodeValue() => "My Test Case"

  • How to update the value in xml file using transformer after setNodeValue

    Hi,
    This is my code
    I want to set update the values in xml file using transformer..
    Any one can help me
    This is my Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    Jsp Page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <% String str="";
    String str1="";
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    out.println("Before change");
    NodeList n11 = doc.getElementsByTagName("name");
    Node n22= n11.item(0).getFirstChild();
    str1 = n22.getNodeValue();
    out.println(str1);
    out.println("After change");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    node.setNodeValue(name);
    NodeList n1 = doc.getElementsByTagName("name");
    Node n2= n1.item(0).getFirstChild();
    str = n2.getNodeValue();
    out.println(str);
    catch(Exception e)
    out.println(e) ;
    %>
    <h1><%=str%></h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>

    hi check this exit...
    IWO10012

  • How to update the value of setter and getter..!!

    Hii all i am developing an portal application in which i display the metadata information related to a document(Stored in UCM) in a popup in my application...
    The user can also update the information through the application.
    in my popup i have a trh : table layout in which i have a Select Onechoice field as
    <trh:cellFormat id="xcfcSecurityGrp">
    <af:selectOneChoice value="#{MetaDataFields.DSecurityGroup}" id="ddldSecurityGroup" showRequired="false"
    autoSubmit="true"
    immediate="true">
    <f:selectItems value="#{ContentDataBean.TSecurityGrpList}" id="si1"/>
    </af:selectOneChoice>
    </trh:cellFormat>
    The MetaDataFields.DSecurityGroup show the current security group on document
    and
    ContentDataBean.TSecurityGrpList provide the user with the list of security group to update.
    The current security group i am getting through a map which consist of metadata information for a document :-
    public void setDSecurityGroup(String dSecurityGroup) {
    this.dSecurityGroup = dSecurityGroup;
    public String getDSecurityGroup() throws IdcClientException, IOException {
    Map<String,String> mapValue=ep.getDocumentPropertiesSystem();
    dSecurityGroup=mapValue.get("dSecurityGroup");
    return dSecurityGroup;
    The problem is that whenever i am updating the value for the security group, i am getting the old value, the problem is that i have to every time get value from the map only as it consist metadata information for the current selected document..
    Is there is any way through which i can update the value for this field..??
    Thanks
    JDeveloper - 11.1.1.6.0

    Hi,
    Try binding ValueChangeListener on the selectList. Also set autoSumit property to true.
    Thanks,
    Pandu

  • How to update the value inside a field symbol ?

    ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO <fs_field>.
    <fs_field> = itab_stpo-menge.
    COLLECT <fs_line> INTO <fs_table>.
    .processing some code......
    ASSIGN COMPONENT 'MENGE' OF STRUCTURE <fs_line> TO  <fs_field>.
    <fs_field> = ( itab_stpo-menge * itab_plpo-vgw03 ).
    COLLECT <fs_line> INTO <fs_table>.
    Hi, guys,
    May i know is there a way to update the value in inside a field symbol?
    I feel hard to figure out the way to solve this situation. Kindly give me some help or perhaos tell me other altenative way to do it also can.
    Thanks in advance.
    Edited by: Jiansi Lim on Apr 25, 2008 8:09 PM

    hi check this...
    For a structured data object s, you can use the statement
    ASSIGN COMPONENT comp OF STRUCTURE s TO FS.
    Here the comp is the component name or its index number in the structure.
    Find the following sample code -
    DATA: BEGIN OF LINE,
    COL1 TYPE I VALUE '11',
    COL2 TYPE I VALUE '22',
    COL3 TYPE I VALUE '33',
    END OF LINE.
    DATA COMP(5) VALUE 'COL3'.
    FIELD-SYMBOLS: <F1>, <F2>, <F3>.
    ASSIGN LINE TO <F1>.
    ASSIGN COMP TO <F2>.
    DO 3 TIMES.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.
    WRITE <F3>.
    ENDDO.
    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.
    WRITE / <F3>.
    The output is:
    11 22 33
    33
    I need to update one field in Internal table
    regards,
    venkat

  • How to update column value dynamically

    Hi All,
    I have created a simple mapping and selected insert/update on target table. In target table there is one column record_type which will hold either 'NEW' (if new record is inserting) or 'UPDATED'(if existing record is updating) value. Please let me know how can I do this using OWB PL/SQL map?
    Thanks
    Bhushan

    Hi Sanjaya,
    Thank you for your reply.
    I like your approch but i think there is need to pass 'UPDATED' when intersect is being used and 'NEW' when minus is being used.
    I have developed an OWB map as mentioned in below steps.
    1. Chose source (TableA) and target (TableB) as source using table operator.
    2. Joined TableA to TableB on col1 using left outer join using joined operator.
    3. In expression operator I have calculated value for TableB.col3 using below logic.
    CASE WHEN TableB.col1 IS NULL THEN 'NEW' ELSE 'UPDATED' END
    4. Mapped columns from expression operator to target table.
    I would like to know you comments on above approch. My OWB map has generated below merge statement.
    MERGE INTO TableB
    USING(SELECT MERGESQL.col1,MERGESQL.col2, CASE WHEN MERGESQL.col3 is null then 'NEW' else 'UPDATED' END col3
    FROM (SELECT TableA.col1, TableA.col2,TableB.col1 AS col3
    FROM TableA
    LEFT OUTER JOIN TableB
    ON (TableA.col1 = TableB.col1)) MERGESQL
    ON (col1 = MERGESQL.col1)
    WHEN NOT MATCHED THEN INSERT(col1,col2,col3) VALUES(MERGESQL.col1,MERGESQL.col2,MERGESQL.col3)
    WHEN MATCHED THEN
    UPDATE SET col2 = MERGESQL.col2,
    col3 = MERGESQL.col3;

  • How to update the value of a column when a row is deleted

    Hi,
    My requirement is basically i have a table .Below is a sample data along with sample data
    Column A Column B ColumnC
    1 SAM 0
    2 RAM 0
    Now if i run a delete statement saying
    delete from Table where ColumnA =1 then i want to see the value of ColumnC to be updated as 1.The row shouldnt be deleted however the value of ColumnC should be changed to 1.
    Can someone please help me with any suggestions? I can create a trigger but i havent worked with triggers so not sure on how to use it.
    Please let me know if i am unclear or if you need any details.
    Thanks

    As I understand what you need is an INSTEAD OF DELETE trigger like below
    CREATE TRIGGER Trg_TableName
    ON TableName
    INSTEAD OF DELETE
    AS
    BEGIN
    UPDATE t
    SET ColumnC = 1
    FROM TableName t
    WHERE EXISTS (SELECT 1
    FROM DELETED
    WHERE ColumnA = t.ColumnA
    END
    this will set ColumnC to 1 and will not do an actual delete of the row.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to update precision value in number datatype

    hello all
    i hava a database containing data in that there is a table which contan a number datatype
    that is number(10)
    the table contain large amount of data
    now i need the precision value 2
    that is number(10,2)
    how i can update is
    i try alter command the do this bu the error is there the table contain data
    so please suggest the solution
    thanks in advance

    The number of columsn has nothing to do with it. The number of rows has nothing to do with it.
    Here is a step-by-step example to address your problem. I will change DATA_OBJECT_ID from NUMBER to NUMBER(10,2) even though there are thousands of rows in the table, the column is "in the middle " of the table, and there are many rows with non-null values in that column.
    07:02:43 > create table t3 as select * from all_objects;
    Table created.
    Elapsed: 00:00:06.22
    07:04:08 > desc t3
    Name                                      Null?    Type
    OWNER                                     NOT NULL VARCHAR2(30)
    OBJECT_NAME                               NOT NULL VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_ID                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                   NOT NULL DATE
    LAST_DDL_TIME                             NOT NULL DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    NAMESPACE                                 NOT NULL NUMBER
    EDITION_NAME                                       VARCHAR2(30)
    07:04:12 > alter table t3 modify (data_object_id number(10));
    alter table t3 modify (data_object_id number(10))
    ERROR at line 1:
    ORA-01440: column to be modified must be empty to decrease precision or scale
    Elapsed: 00:00:00.98
    07:08:05 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id)
    07:09:06   2  from t3;
      COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
        184456                   0             1526320                         12225                 70092
    1 row selected.
    Elapsed: 00:00:00.11
    07:09:41 > alter table t3 add (temp_data_object_id number(10,2));
    Table altered.
    Elapsed: 00:00:00.07
    07:10:27 > update t3 set temp_data_object_id = data_object_id, data_object_id = null;
    184456 rows updated.
    Elapsed: 00:00:04.49Notice that our column of interest is now entirely null, so the restriction against reducing its scale or precision will not longer impact us.
    07:11:00 >
    07:11:17 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id) from t3;
      COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
        184456                                                                     0                     0
    1 row selected.
    Elapsed: 00:00:00.04
    07:11:51 > alter table t3 modify (data_object_id number(10,2))
    07:12:33 > /
    Table altered.
    Elapsed: 00:00:00.07
    07:12:35 > update t3 set data_object_id=temp_data_object_id;
    184456 rows updated.
    Elapsed: 00:00:04.01
    07:14:40 > select count(*), min(data_object_id), max(data_object_id), count(distinct data_object_id), count(data_object_id) from t3;
      COUNT(*) MIN(DATA_OBJECT_ID) MAX(DATA_OBJECT_ID) COUNT(DISTINCTDATA_OBJECT_ID) COUNT(DATA_OBJECT_ID)
        184456                   0             1526320                         12225                 70092
    1 row selected.
    Elapsed: 00:00:00.09
    07:14:49 > alter table t3 drop column temp_data_object_id;
    Table altered.
    Elapsed: 00:00:02.40
    07:15:11 > desc t3
    Name                                                              Null?    Type
    OWNER                                                             NOT NULL VARCHAR2(30)
    OBJECT_NAME                                                       NOT NULL VARCHAR2(30)
    SUBOBJECT_NAME                                                             VARCHAR2(30)
    OBJECT_ID                                                         NOT NULL NUMBER
    DATA_OBJECT_ID                                                             NUMBER(10,2)
    OBJECT_TYPE                                                                VARCHAR2(19)
    CREATED                                                           NOT NULL DATE
    LAST_DDL_TIME                                                     NOT NULL DATE
    TIMESTAMP                                                                  VARCHAR2(19)
    STATUS                                                                     VARCHAR2(7)
    TEMPORARY                                                                  VARCHAR2(1)
    GENERATED                                                                  VARCHAR2(1)
    SECONDARY                                                                  VARCHAR2(1)
    NAMESPACE                                                         NOT NULL NUMBER
    EDITION_NAME                                                               VARCHAR2(30)
    07:15:15 >

  • How to update column values in a table where that column is referring to different tables

    i have a table Order it has columns
    OrderID, Name, Total
    1            trade   value populated from i.e. tradeorder table
    2            fixed   value is populated from fixedorder table
    3            annual  value populated from another table
    I m thinking of creating function for every order id to call those tables..
    and there are many insertions taking place in order table ,,at the moment its 20 rows ..
    kindly provide your suggestions

    You can group rows in order table and update the set of row from the specific table. For instance
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [TRADEORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='TRADE'
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [FIXEDORDER] B ON A.ORDERID=B.ORDERID WHERE A.NAME='FIXED'
    UPDATE [ORDER] SET [TOTAL]=B.[TOTAL] FROM [ORDER] A INNER JOIN [ANOTHERTABLE] B ON A.ORDERID=B.ORDERID WHERE A.NAME='ANNUAL'
    Regards, RSingh

  • How to update condition value using e1edp05 segment during order creation

    Hi,
    I have a requirement where I need to update the item level condition value (komv-kbeter)  to the condition type (komv-kschl) from the incoming idocs (orders05).
    But  the same is configured  in such a way to populate automatically with the default condition value zero during the order creation level using VA01 at condition tab.
    I am able to populate condition values from incoming idoc using segment E1EDP05 which is good, but it was getting created as new entry with the same condition type  instead of updating the condition value to the existing condition type(which got populated from automatically from configuration) .
    So I want to restrict to one entry instead of two with same condition type. Is there any userexit/gap to restrict automatic population of condition type thru programming or to update with idoc (orders05) value rather than inserting as new row?
    My client doesn’t want to restrict the pricing automation from configuration. So I have to handle through programming level.
    Your  inputs are appreciated

    It doesn't really matter if it's a credit/debit memo, it's the same transaction anyway and pretty much the same functionality. What is your requirement exactly? Do you always have to override the price from Siebel or, let's say, some price is automatically proposed and you might or might not need to override it?
    We use a custom (Z..) condition for price override. When a material is entered in VA01, some price (condition PR00, for example) is assigned automatically. Then, let's say, a special price has been negotiated with this customer just for this purchase. So the user goes into Conditions, types in condition code Z... and types in the new price. This basically annuls the previous PR00 condition. I'm not a functional consultant and can't give you all the config details, but your SD person should be able to help.
    I'm still positive that conditions cannot be removed or changed by IDoc. One thing I would suggest for your situation: do not create ZCD2 condition initially and then just add ZCD2 condition when you receive the data from Siebel. Otherwise it seems that you would have to write a user exit or a requirement to deal with the duplicate conditions.

  • How to update unique values

    I want to update the unique values, if they are not inserted... Please help in this regard
    CREATE OR REPLACE PROCEDURE PR IS
    lv_operator VARCHAR2(1) := 'N';
    TYPE subset_rt IS RECORD
    ltt_whse_loc oe_sales_ord_commit.whse_loc%TYPE,
    ltt_shape oe_sales_ord_commit.shape%TYPE,
    ltt_isize oe_sales_ord_commit.isize%TYPE,
    ltt_grade oe_sales_ord_commit.grade%TYPE,
    ltt_length oe_sales_ord_commit.length%TYPE,
    ltt_pieces NUMBER,
    ltt_inv_lbs_commit oe_sales_ord_commit.inv_lbs_commit%TYPE,
    ltt_roll_lbs_commit oe_sales_ord_commit.roll_lbs_commit%TYPE,
    ltt_ishcom_lbs oe_sales_ord_commit.ishcom_lbs%TYPE);
    TYPE subset_aat IS TABLE OF subset_rt
    INDEX BY PLS_INTEGER;
    aa_subset subset_aat;
    errors NUMBER;
    dml_errors EXCEPTION;
    PRAGMA EXCEPTION_INIT(dml_errors, -24381);
    BEGIN
    lv_operator := sy_checkpriv(USER,
    'SY_OPERATIONS');
    SELECT whse_loc,
    shape,
    isize,
    grade,
    length,
    0,
    inv_lbs_commit,
    roll_lbs_commit,
    ishcom_lbs
    BULK COLLECT INTO aa_subset
    FROM oe_sales_ord_commit_temp
    WHERE processed_datetime IS NULL
    AND username = decode(lv_operator,
    'Y',
    username,
    USER);
    BEGIN
    FORALL indx IN 1 .. aa_subset.COUNT SAVE EXCEPTIONS
    INSERT INTO
    (SELECT loc,
    shape,
    isize,
    grade,
    length,
    pieces,
    inv_lbs_commit,
    roll_lbs_commit,
    ishcom_lbs FROM oe_inventory_temp)
    VALUES
    aa_subset(indx);
    EXCEPTION
    WHEN OTHERS THEN
    *+<<Trap the rows that have failed due to dup_val_on_index exception and update the inv_lbs_commit,+*
    *+roll_lbs_commit, ishcom_lbs columns in oe_inventory_temp table>>+*
    -- loc,shape, isize,grade, length, pieces are composite primary keys.
    errors := SQL%BULK_EXCEPTIONS.COUNT;
    DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
    FOR i IN 1..errors LOOP
    DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
    'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
    DBMS_OUTPUT.PUT_LINE('Error message is ' ||
    SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
    DBMS_OUTPUT.PUT_LINE(aa_subset(SQL%BULK_EXCEPTIONS(i).ERROR_INDEX));
    END LOOP;
    END;
    END PR;
    /

    Due to the following restriction a number of simple collections is used instead of the collection of records.
    [FORALL Statement|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm#sthref2742]: You cannot refer to individual record fields within DML statements called by a FORALL statement. Instead, you can specify the entire record with the SET ROW clause in an UPDATE statement, or the VALUES clause in an INSERT statement.
    10g syntax of FORALL statement is used:
    SQL> select * from a;
           INT DT         STR
             1 10.02.2009 123
             2 11.02.2009 567
    SQL> desc a
    Name                                      Null?    Type
    INT                                       NOT NULL NUMBER(38)
    DT                                                 DATE
    STR                                                VARCHAR2(20)
    SQL> select * from a;
           INT DT         STR
             1 10.02.2009 123
             2 11.02.2009 567
    SQL> DECLARE
      2    TYPE T_Int_List IS TABLE OF A.Int%TYPE INDEX BY PLS_INTEGER;
      3    TYPE T_Dt_List IS TABLE OF A.Dt%TYPE INDEX BY PLS_INTEGER;
      4    TYPE T_Str_List IS TABLE OF A.Str%TYPE INDEX BY PLS_INTEGER;
      5  
      6    vInts T_Int_List;
      7    vDts T_Dt_List;
      8    vStrs T_Str_List;
      9 
    10    eBulk_Error EXCEPTION;
    11    PRAGMA EXCEPTION_INIT(eBulk_Error, -24381);
    12  BEGIN
    13    vInts(1) := 2;
    14    vDts(1) := sysdate - 1;
    15    vStrs(1) := '888';
    16 
    17    vInts(2) := 3;
    18    vDts(2) := sysdate - 22;
    19    vStrs(2) := '0000';
    20 
    21    BEGIN
    22      FORALL indx IN INDICES OF vInts SAVE EXCEPTIONS
    23        INSERT INTO A(Int, Dt, Str)
    24          VALUES(vInts(indx), vDts(indx), vStrs(indx));
    25    EXCEPTION
    26      WHEN eBulk_Error THEN
    27        DECLARE
    28          vErr_Count INTEGER;
    29          vErr_Message VARCHAR2(2000);
    30          vErr_Indices T_Int_List;
    31        BEGIN
    32          vErr_Count := SQL%BULK_EXCEPTIONS.COUNT;
    33          -- Getting the indices of rows with duplicate key
    34          -- FOR vI IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP - Doesn't work for some reason on 10.2.0.1.0
    35          FOR vI IN 1 .. vErr_Count LOOP
    36            IF SQL%BULK_EXCEPTIONS(vI).Error_Code <> 1 THEN
    37              -- Error other that duplicate key is reraised
    38              vErr_Message := SQLERRM(-SQL%BULK_EXCEPTIONS(vI).Error_Code);
    39              Raise_Application_Error(-20001, vErr_Message);
    40            END IF;
    41            vErr_Indices(SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX) := SQL%BULK_EXCEPTIONS(vI).ERROR_INDEX;
    42          END LOOP;
    43       
    44          -- Bulk update
    45          FORALL vI IN INDICES OF vErr_Indices
    46            UPDATE A SET
    47                Dt = vDts(vI),
    48                Str = vStrs(vI)
    49              WHERE Int = vInts(vI);
    50        END;
    51    END;
    52  END;
    53  /
    PL/SQL procedure successfully completed.
    SQL> select * from a;
           INT DT         STR
             1 10.02.2009 123
             2 09.02.2009 888
             3 19.01.2009 0000Regards,
    Dima
    Edited by: DimaCit on Feb 10, 2009 10:39 AM

  • ScriptUI: How to update Listbox values? (CC2014)

    Is there way to update listbox element that filled with JS array elements. If I push more elements to the array, how I can re-render it in ScriptUI? Is there way to do this.
    I know there is way just to add elements to listbox like in Peter Kahrel's PDF. But this isn't so dynamic:
    var w = new Window ("dialog");
    var myList = w.add ("listbox", undefined, ["one", "two", "three"]);
    var b = w.add ("button", undefined, "Add");
    b.onClick = function () {myList.add ("item", "zero", 0)}
    w.show ();
    How about if I wan't to update listbox when I have changed my arrays, like below:
    // Create example array
    var testArr = ['item1', 'item2']
    $.writeln(testArr.length);
    startGUI();
    function startGUI() {
        // Window
        var win = new Window( "palette", script_name, undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"];
        // Listbox
        var myListbox = win.add ("listbox", undefined, testArr, 
            numberOfColumns: 1, 
            showHeaders: true, 
            columnTitles: ['Name']
        // Add Item To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {  
            testArr.push ('item3');
            $.writeln(testArr.length);
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {  
            win.close();  
        win.show();
    Maybe there is some update funtion on ScriptUI. I tried to search solution without success. Any help?

    I updated your own script to show how I removed the listbox
    I added a group to host the listbox, the purpose of the group is to be used as a placeholder( to add the new listbox in the right place) and to easily get the listbox to be removed
    // listboxEditFromJSArray.jsx - Sakari Niittymaa
    // https://forums.adobe.com/message/6785515
    //#target illustrator
    // Create example array
    var testArr = ['item1', 'item2', 'item3'];
    startGUI();
    function startGUI() {
        // Main Window
        var win = new Window( "palette", "Test Listbox", undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"];
        // Listbox Group
        var grpListbox = win.add('group');
        grpListbox.alignChildren = ['fill', 'fill'];
        var myListbox = addListBox (grpListbox, testArr);
        // add ListBox
      function addListBox(container, testArr) {
            var listbox = container.add("listbox", undefined, testArr,  
                numberOfColumns: 1,  
                showHeaders: true,  
                columnTitles: ['Name']
            return listbox;
        // BTN: Add Items To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {
            testArr.push ('item' + (testArr.length + 1));
            grpListbox.remove(grpListbox.children[0]);
            myListbox = addListBox (grpListbox, testArr);
            win.layout.layout(true);
            //updateListboxArray(myListbox);
            //$.writeln (testArr.length + "  " + myListbox.items.length);
        // BTN: Remove Selected
        var removeSelectedItems = win.add("button", undefined, "Remove Selected");
        removeSelectedItems.onClick = function() {
            // Remove selected listbox item from array
            testArr.splice( myListbox.selection.index, 1 );
            updateListboxArray(myListbox);
        // BTN: Clear Listbox
        var removeAllItems = win.add("button", undefined, "Clear Listbox");
        removeAllItems.onClick = function() {
            // Clear the array
            testArr = [];
            updateListboxArray(myListbox);
        // Update listbox items
        function updateListboxArray(listbox) {
            // Clear listbox first
            listbox.removeAll();
            // Create new listbox items from array
            var i = 0;
            while (listbox.items.length < testArr.length) {
                listbox.add ("item", testArr[i]);
                i++;
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {  
            win.close();  
        // Window Settings
        win.onResizing = function () { this.layout.resize(); };
        win.onShow = function () { win.layout.resize(); };
        win.center();    
        win.show();

Maybe you are looking for