How to update based on condition during insert on child table

hi all,
i have three tables, first table enquiry(enqid, item, type) where all enquiries are entered. after that table bom (bomid, item, enqid, rawmatl) and route (bomid, routeid,routename). in this bom & route are Master Detail table, where entries are made on a later period. the requirement is to update 'type' in enquiry table during insert on Route table.
for 1 row in bom table there will be more than 5 rows in route table. the condition to update type field in enquiry is, scan the first 5 rows of route table during insert and if routename field contains 'JG' the update type with 'J'. if 'JG' is not there scan the same 5 rows for 'ED' and update type with 'E'. if 'ED' is not there scan for 'CN' and update type with 'C' like this 3 more to test and update.
thanks in adv. am on 8i
Kris

yes, trigger or proc. or package
any idea how to do this...?

Similar Messages

  • How to update cgicmd.dat file during runtime?

    I'd like to know how do update cgicmd.dat file during runtime. For example, I run a report one.jsp as
    http://<machine>:<port>/reports/rwservlet?one.jsp&USERID=uid/pwd@db&DESTYPE=cache&mode=bitmap&desformat=htmlcss
    within this report there is a hyperlink to open another report named two.jsp.
    before creating this hyperlink, I'd like to update cgicmd.dat file with passed in userID, pwd, and connection, so two.jsp can use this key for userinfo
    so I can create hyperlink as follows
    srw.set_hyperlink('/reports/rwservlet?report=two.jsp'||
    '&cmdkey=userinfo&DESTYPE=cache&mode=bitmap&desformat=htmlcss');
    Thanks

    To my knowledge the cgicmd.dat is only read when the OC4J starts, so you would have to come up with another solution. Using Single-Sign-On (SSO) is quite a good idea, and it's there for cases like this.
    Regards,
    Martin Malmstrom

  • Date not changing based on timezone during insert into database...

    I have a bpel project that gets data in GMT and insert into a database that's based on EST timezone...for some reason during insert into database, I expect it to reflect the time in EST time, but it's not doing so. It's a standard oracle bpel project and there was no customization to the date input. The following are the details:
    input data:
    <InvoiceDate>
    <GLogDate>20110613213249</GLogDate>
    <TZId>UTC</TZId>
    <TZOffset>+00:00</TZOffset>
    </InvoiceDate>
    date I get after transformation:
    <ns5:invoiceDate> 2011-06-13T21:32:49 </ns5:invoiceDate>
    date that gets inserted into the database:
    6/13/2011 9:32:49 PM
    Any thoughts as to what's going on? Is this the intended fuctionality or how does it adjust itself to the daylight saving? I thought database itself would handle it in this case.
    Thanks,
    Amkay

    WpgMom --
    From your description, it sounds totally like you are using Manually Scheduled tasks, which is not what you should be using in your project.  If you look at the Gantt bars in the Gantt Chart view of your project, if the Gantt bars are a turquoise color,
    you are using Manually Scheduled tasks, and that would be the reason that the dates do not automatically calculate for you.  If this is the case, click the Select All button to select every task in the project.  In the Tasks section of your Task
    ribbon, click the Auto Schedule button.  From this point forward, your project schedule will automatically recalculate every time you make any kind of schedule edit.
    Also, in the lower left corner of the Microsoft Project application window, you will probably see a button that says New Tasks: Manually Scheduled.  Click this button and select the Auto Scheduled option.
    To avoid all of these problems in all future projects, click File > Options.  In the Project Options dialog, click the Schedule tab.  In the Scheduling Options for This Project section, click the pick list where you see the name of your project
    and select the All New Projects item on the pick list.  Click the New Tasks Created pick list and select the Auto Scheduled option.  Click the OK button.
    Hope this helps.
    Dale A. Howard [MVP]

  • How to update cost related condition type amount in sales order without disturbing other condition types.

    Hi ,
    How to updae only one item condition  ZYV0 value in sales order. If I can see we have several options from pricing type to update condition types but here My requirement is to update only one condition amount .If I can see other pticing types they will update all condition types .
    -Exclusive option is checked for all the tables maintained in access sequence,
    Below options were not worked for me.
    -In condition type ----> Condition category has been updated with "D"(Tax) pricing type-"G" to update in sales order
    - This option worked for me but  condition category  "F"(frieght) and pricing type -H but in conditions tab when I update two condition amounts are activated for one condition type like below.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    Regards

    Hi Rita,
    Tried with condition category "u" and updated with pricing type "U" . It works as same I used old logic.
    with condition categories "D" and "F" it will update old and new condition record values in sales order.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    I have updated  here existing condition record value from 30 % to 50 % validity periods are not changed.
    Regards

  • How to update multiple Price conditions in FM CRM_ORDER_MAINTAIN

    Hi All,
          need to update multiple price conditions in a contract Thru FM CRM_ORDER_MAINTAIN.
    please see the piece of code that am using...
      am able to update single price condition...but not able to populate 2 or more .......i,e..ADD A Condition
    i,e...DATA : ls_cond TYPE prct_cond_external_input,
           lt_cond TYPE prct_cond_external_input_t.
    DATA : ls_con TYPE PRCT_COND_DU,
           lt_con TYPE PRCT_COND_DU_TAB.
    Create Condition Type
    *ls_con-KNUMV = lv_header_guid.
    *ls_con-KPOSN = lv_item_guid.
    ls_con-stunr  = '134'.
    IF Y EQ 1.
      ls_con-ZAEHK = '001'.
    ELSE.
       ls_con-ZAEHK = '002'.
    *ENDIF.
    *ls_con-kschl = 'ZFP1'.
    **ls_cond-waers = 'CNY'.
    *ls_con-kbetr = '0.00'.
    *ls_con-kpein = '1'.
    ls_cond-kschl = 'ZFP1'.
    ls_cond-waers = 'CNY'.
    ls_cond-kbetr = '0'.
    ls_cond-kpein = '1'.
    ls_cond-knumh = lv_item_guid .
    CLEAR ls_Price_doc.
    ls_Price_doc-ref_guid = lv_item_guid.
    ls_Price_doc-ref_kind = 'A'.
    IF Y EQ 1.
    ls_Price_doc-ref_handle = '000000001'.
    ELSE.
      ls_Price_doc-ref_handle = '000000002'.
    ENDIF.
    *ls_price_doc-PRIC_COND[] = lt_cond[].
    *INSERT ls_con into table ls_price_doc-PRIC_COND.
    INSERT ls_cond into table ls_price_doc-COND_ADD.
    INSERT ls_price_doc INTO TABLE lt_price_doc.
    ls_input_fields-ref_guid    = lv_item_guid.
    ls_input_field_names-fieldname = 'KNUMH'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'KPOSN'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'KSCHL'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'KPEIN'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'STUNR'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'ZAEHK'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'WAERS'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    ls_input_field_names-fieldname = 'KBETR'.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CLEAR ls_input_fields.
    Ls_input_fields-ref_guid    = lv_item_guid.
    ls_input_fields-ref_kind    = 'B'.
    ls_input_fields-objectname  = 'PRIDOC'.
    *ls_input_fields-logical_key = '0001'.
    ls_input_fields-field_names = lt_input_field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CLEAR ls_input_fields.
    CLEAR ls_Price_agreement.
    Clear ls_cond.
    I kept this under code. loop, for item records.....
    Though the internal table lt_price_doc. is holding all the records, it is updating only one record. can you any one pls guide me ,

    This example works fine for me. Modify it according to your needs...
    Price
                  IF it_item-value IS NOT INITIAL.
                    ls_cond-kschl = 'PR00'. " add price
                    ls_cond-kbetr = it_item-value.
                    ls_cond-waers = st_head-currency.
                    INSERT ls_cond INTO TABLE ls_pridoc_com-cond_add.   
                    index_2 = 1.
                    CLEAR: ls_cond.
                  ENDIF.
    Discount
                  IF it_item-discount IS NOT INITIAL.
                    ls_cond-kschl = 'ZPPP'. " add discount
                    wa_procent_calc = it_item-discount * 10.
                    ls_cond-kbetr = wa_procent_calc."it_item-discount.
                    ls_cond-waers = '%'."st_head-currency.
                    INSERT ls_cond INTO TABLE ls_pridoc_com-cond_add.   
                    index_2 = 1.
                    CLEAR: ls_cond, wa_procent_calc.
                  ENDIF.
                  IF index_2 = 1.
                    ls_pridoc_com-ref_handle = counter.
                    ls_pridoc_com-ref_kind = 'B'.
                    INSERT ls_pridoc_com INTO TABLE gt_pridoc_com.
                    CLEAR: index_2,ls_pridoc_com.
                  ENDIF.

  • How to update the pricing conditions in Products.

    Hi All,
    I have created a Product Using  Function Modules. Now i need to update the Pricing Conditions into it. Can anyone suggest me with  the exact Function Module and Tables that are used to Update the pricing conditions?Can anyone provide me with a sample report program written to update the pricing conditions.?
    Points will be awarded for useful answers.
    Thanks In Advance,
    Shwetha Korlepara.

    Hi,
    Can you check if these FM's are useful:
    CRM_MKTPL_GET_BP_SALES_AREAS
    CRM_MKTPL_AL_FILL_PRODUCT
    Hope this helps.
    Regards,
    Anup

  • Hide column based on condition on other column in table

    hi,
    am using BIP 10.1.3.2 to generate reports.In the template i need to hide one column based on condition on other.am using SQL query as my data source type.can anybody help me ?

    Use <?if:?> condition in the RTF, but its mainly for the rows not column. You can work around this by handeling in backend. Or take two separate tables, one with the column which you want to hide and another table without that column and before calling that table use IF condition.
    Regards,
    Amit D
    Persistent Systems Ltd.

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • How can i find the latest row inserted in a table

    i have a table with five columns and there is no primary key and everyday 100's of rows will be inserted to this table ,infact by mistake i have inserted a row and i just want to find out which is the last row i have inserted in to this particular table is there any way to find out this please......

    That's not guaranteed to give you the latest row added to the table. Oracle could place new rows anywhere depending on what happened to rows in the table previously, what space is available in the tablespace etc etc:
    SQL> create sequence dt_test_rowid_seq start with 1 increment by 1;
    Sequence created.
    SQL>--generate some test data
    SQL> CREATE TABLE dt_test_rowid as
      2  select     object_id,
      3     object_name,
      4     dt_test_rowid_seq.nextval ins_sequence
      5  from
      6     dba_objects
      7  where
      8     object_id is not null
      9  and
    10     rownum <10000;
    Table created.
    SQL>--here, the latest addition to the table....
    SQL> select max(ins_sequence) from dt_test_rowid;
    MAX(INS_SEQUENCE)
                 9999
    SQL>... reflects the highest rowid
    SQL> select ins_sequence from dt_test_rowid where rowid=(select max(rowid) from dt_test_rowid);
    INS_SEQUENCE
            9999
    SQL>--get rid of a load of rows
    SQL> delete from dt_test_rowid where mod(object_id,2)=0;
    2521 rows deleted.
    SQL>--insert a load more
    SQL> insert into dt_test_rowid
      2  select     object_id,
      3     object_name,
      4     dt_test_rowid_seq.nextval ins_sequence
      5  from
      6     dba_objects
      7  where
      8     object_id is not null
      9  and
    10     rownum <1000;
    999 rows created.
    SQL>--and here the latest addition to the table...
    SQL> select max(ins_sequence) from dt_test_rowid;
    MAX(INS_SEQUENCE)
                10998
    SQL>--...is NOT reflected by the highest rowid
    SQL> select ins_sequence from dt_test_rowid where rowid=(select max(rowid) from dt_test_rowid);
    INS_SEQUENCE
            9999

  • Update data to upper case in parent/child tables

    Hi Gurus!
    In production we have a product table and which is being reference by many tables making it parent child relationship. By mistake, we realized that last month some product were added in lower case and now we got a request to update all these product codes to upper case so that the existing code that use these tables have no impact. Appreciate if you can give some idea on how can I update the existing data in the parent table to upper case along with the child records?
    Regards
    Sri

    Are the product code that you need to update what is stored in the child tables? If so, then you would need to do it in several steps, something like:
    Identify the child tables
    SELECT table_name, constraint_name
    FROM user_constraints
    WHERE r_constraint_name = (SELECT constraint_name
                               FROM user_constraints
                               WHERE table_name = 'PRODUCT_TABLE' and
                                     constraint_type = 'P');Create the new upper case product code in product table:
    INSERT INTO product_table
    SELECT UPPER(product_code), other_columns
    FROM product_table
    WHERE product_code <> UPPER(product_code);Update the child tables to uppercase the product codes
    UPDATE child1
    SET product_code = UPPER(product_code)
    WHERE product_code <> UPPER(product_code);finally, delete the lower case product codes from product_table
    DELETE FROM product_table
    WHERE product_code <> UPPER(product_code);John

  • How to get the primary key names right for child tables?

    I have a logical model with a parent table and two child tables. The engineering strategy is "table per child". The parent has an primary key attribute. This is a screen shot:
    https://lh5.googleusercontent.com/-iKMtA3Say5c/UIkG1iktgEI/AAAAAAAAAtc/mrwFeHm4gi4/s800/child_pk_log.png
    When I engineer the model I get two primary keys with the same name name, which is the name of the parent:
    https://lh3.googleusercontent.com/-N88a9VwoPKw/UIkG1spbXpI/AAAAAAAAAtY/eonf8WdUZ6I/s800/child_pk_rel.png
    The correct names would be CHILD1_PK and CHILD2_PK. I can change the relational model by applying the naming rules but the next engineering will trash the names again.
    How can I fix this?

    Hi,
    the problem with PK name is fixed in Data Modeler 3.2.
    You can change PK name in relational model it won't be changed on next engineering
    Philip

  • On insert into parent table insert into child tables

    hi all,
    please suggest me an idea for below scenario in plsql
    i have a main table where every day 10k records are inserted,
    now when ever the main table gets inserted the same records should inserted into two other child tables.
    main table will have 20 columns and two child tables will have 10 each columns with one common column in all three tables.
    suggest me if a trigger is best or a procedure is best for this if possible with a solution.
    thanks in advance

    look at INSERT ALL
    sample from http://psoug.org/reference/insert.html
    INSERT ALL
      INTO ap_cust VALUES (customer_id, program_id, delivered_date)
      INTO ap_orders VALUES (order_date, program_id)
      SELECT program_id, delivered_date, customer_id, order_date
        FROM airplanes;

  • How to update the z-condition type in pricing procedure in a quote

    Hi Gurus,
    I need your help to solve my issue.
    I have created a RFC which will trigger any time there is a CRM Quote/ CRM Order create or change occurs. IN response of the RFC i will get the rate and rate type for the line items .
    When the service  returns with rate value the SAP system will insert this value by inserting z-condition type  in to the pricing structure. The normal pricing function module will then carry the process forward.
    Todo this ,Can i code the RFC call in Order_save badi ,but where can i get the pricing sturcure  data to update the returned rate values in the pricing.
    and also one more thing ,In ecc  I am using the CUCB_GET_CONFIGURATION to get product configurations. for the same which FM can i use in CRM.
    Please reply me ASAP.

    hei,
    you can use field KOMP-KZWI1 - KZWI6 to store your condition type. then it can be used for analysis in SIS.
    if you want to put more than one condition type to field KOMP-KZWI1, go to V/08 (pricing Procedure), put "1" in condition subtotal.
    Best Regard,
    Hendry

  • How to Update the New Condition values for list of sales orders

    Hi
    Client requirement is they have set of old Sales Orders to be executed. But the material prices have been revised in the meantime. Now they want to update the current prices in the sales order before proceeding further.

    Hi,
    Though Lakshmi suggested you the right option, it may not be carried out for Sales Documents in random and will be much suited for Sales Documents with continuous sequence like 00010, 00011, 00012, 00013, etc.
    If you want to New Pricing to be carried out for Specific Lists of documents like 00010, 00017, 00043, 00057, etc, then you can do by following option:
    Go to Transaction "MASS", Select the Table - VBAK and Field - PRSTD and proceed by entering the Sales Documents Lists to carry out New Pricing.
    Hope this will be helpful to you.
    Rgds,

  • Insert values to one table based on a value inserted into another table

    Hi,
    I've got a form based off a report which creates a new project. I've added an additional process to this form to insert four new values into another table as soon as the new project is created and the PK for that project is generated. This was working last week (of course!) and now seems to not work at all. It's complaining that the PK I was getting from my first insert was null. Here is one the the statements in my process I'm trying to run:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    The complaint I get that it's getting null where :P45_PROJECT_SEQ should be.
    Thoughts?
    Thanks,
    Jon

    Hi Andy,
    Thanks for the tip. Those two values didn't match and I updated them so they do and I'm still getting a "cannot insert NULL..." error.
    When I turn on debug I see that I'm getting the PK and I see the value. Here's my debug output:
    0.24: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select PROJECT_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P45_PROJECT_SEQ := get_pk; end;
    0.25: ...Session State: Saved Item "P45_PROJECT_SEQ" New Value="252"
    0.25: ...Process "Process Row of PROJECT": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:PROJECT:P45_PROJECT_SEQ:PROJECT_SEQ|IUD
    0.26: ...Session State: Save "P45_PROJECT_SEQ" - saving same value: "252"
    0.26: ...Process "reset page": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 45
    0.27: Nulling cache for application "120" page: 45
    0.27: ...Process "Add Week Groups": PLSQL (AFTER_SUBMIT) insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER); insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY') +
    0.28: Encountered unhandled exception in process type PLSQL
    0.28: Show ERROR page...
    0.28: Performing rollback...
    I notice that when it runs my process "Add Week Groups" it's not displaying all of the SQL. But the SQL is fine, it's right here:
    insert into week_group values(week_group_seq.nextval, (SELECT trunc(NEXT_DAY(SYSDATE, 'FRIDAY')) FROM dual), 0, '', :P45_PROJECT_SEQ, sysdate, :APP_USER);
    Hmmm....what about the "reset page" action in the last of the 0.26 lines?
    Thanks,
    Jon

Maybe you are looking for

  • ECC 6.0 with baseline - send PO via e-mail

    Hi forum experts, We are having some problems with configuring our system to send POs via e-mail. We are trying to use the following setting, but when the PO is saved (and triggers an output) an error appears without any items in processing log. No e

  • Callable statements and cursors in database

    Hi, I am using a callable statement (from a JSP) that calls a big stored oracle procedue. The stored procedure inserts/deletes/updates many tables. But once i close the statement(I am sure i closed it in finally block), when i monitor the database, t

  • Is there a software to administer and monitor ipod touches remotely?

    Hi, we have recently purchased 3 linea pro barcode scanning cases (like they have in the apple store) to fit on three 4th gen ipod touches. These are going to be used to order and process products through three individual retail outlets. We have an a

  • Unix command to delete files with .cache extension

    I was wondering if anyone knew of a unix command that can be sent to another computer that will delete all files on the hard drive with a certain extension such as .cache. Like: rm *.cache Thank you!

  • Timecard Preferences for specific users

    Hi, We have created an approval style which proceeds to HR Supervisor for components like Vacation etc and for direct project gets auto approved. Now we want to rollout this functionality in Production in parts i.e we want this thing to be enabled fo