Updating multiple fields ... need an advice.

Hello all,
I have a bit of a trouble with updating multiple fields in one table...
Lets say we have two tables. Table one is called t_employe for example:
create table t_employe (
year number,
line varchar2(1),
counter number,
value number)Lets set some random data into table:
insert all
into t_employe (year, line,counter, value)
values(2011,'3','2946','3344')
into t_employe (year, line,counter, value)
values(2011,'3','2947','4433')
into t_employe (year, line,counter, value)
values(2011,'3','2948','4455')
into t_employe (year, line,counter, value)
values(2011,'3','2949','5544')
select * from dualOk second table would be:
create table to_update (
year number,
line varchar2(1),
counter number,
date_pos_1 date,
value_pos_1 number,
date_pos_2 date,
value_pos_2 number,
date_pos_3 date,
value_pos_3 number,
date_pos_4 date,
value_pos_4 number,
date_pos_5 date,
value_pos_5 number)Data:
insert all
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2946',sysdate,'5434',null,null,null,null,null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2947',sysdate,'11',sysdate,'123',null,null,null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2948',sysdate,'33',sysdate,'44',sysdate,'8908',null,null,null,null)
into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
values(2011,'3','2949',sysdate,'1',sysdate,'2',sysdate,'343',sysdate,'78',null,null)
select * from dualOk now what i want to do is to update table to_update fields where value_pos is NULL. To explain it better imagine
collums are from left to right in that order value_pos_1, value_pos_2, value_pos_3 .... Now i would want to check for each row
if value_pos_1 is null ... if it is then update. Finist with this row and move to the next. If its not move to value_pos_2 in
same row and again check if its null. If it is ... update, if not, again move forward. Each cullum value_pos_X has a cullom date_pos_x
which has to be updated same as Value_pos_ cullums (if value_pos_X is null then coresponding date_pos_X will be null as well - thats
a fact in my table).
So is this doable by using only one update?
I manage to write a select statment using case clause which does those things perfectly only for value_pos_X fields. I wonder if i can use it in my
update statment?
select
case when a.value_pos_1 is  null then b.value else
     case when a.value_pos_2 is  null then b.value else
          case when a.value_pos_3 is  null then b.value else
               case when a.value_pos_4 is  null then b.value else
                    case when a.value_pos_5 is  null then b.value else to_number('99999','9999,99')
end
end
end
end
end  as value
from to_update a,t_employe b
where a.year = b.year
and a.line= b.line
and a.counter = b.counter Any suggestions how to pull this one of?
Thank you!

SQL> select  *
  2    from  to_update
  3  /
      YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
      2011 3       2946 27-AUG-11        5434
      2011 3       2947 27-AUG-11          11 27-AUG-11         123
      2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908
      2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78
SQL> merge
  2    into to_update a
  3    using (
  4           select  a.rowid rid,
  5                   b.value
  6             from  to_update a,
  7                   t_employe b
  8             where a.year = b.year
  9               and a.line= b.line
10               and a.counter = b.counter
11          ) b
12     on (
13         a.rowid = b.rid
14        )
15     when matched then update set value_pos_1 = nvl2(value_pos_1,value_pos_1,b.value),
16                                  value_pos_2 = nvl2(value_pos_1,nvl2(value_pos_2,value_pos_2,b.value),value_pos_2),
17                                  value_pos_3 = nvl2(value_pos_1 + value_pos_2,nvl2(value_pos_3,value_pos_3,b.value),value_pos_3),
18                                  value_pos_4 = nvl2(value_pos_1 + value_pos_2 + value_pos_3,nvl2(value_pos_4,value_pos_4,b.value),value_pos_4),
19                                  value_pos_5 = nvl2(value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4,nvl2(value_pos_5,value_pos_5,b.value),value_pos_5)
20  /
4 rows merged.
SQL> select  *
  2    from  to_update
  3  /
      YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
      2011 3       2946 27-AUG-11        5434                  3344
      2011 3       2947 27-AUG-11          11 27-AUG-11         123                  4433
      2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908                  4455
      2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78                  5544
SQL> Or yhis might be more readable:
merge
  into to_update a
  using (
         select  a.rowid rid,
                 b.value
           from  to_update a,
                 t_employe b
           where a.year = b.year
             and a.line= b.line
             and a.counter = b.counter
        ) b
   on (
       a.rowid = b.rid
   when matched then update set value_pos_1 = case when value_pos_1 is null then b.value else value_pos_1 end,
                                value_pos_2 = case when value_pos_1 is not null and value_pos_2 is null then b.value else value_pos_2 end,
                                value_pos_3 = case when value_pos_1 + value_pos_2 is not null and value_pos_3 is null then b.value else value_pos_3 end,
                                value_pos_4 = case when value_pos_1 + value_pos_2 + value_pos_3 is not null and value_pos_4 is null then b.value else value_pos_4 end,
                                value_pos_5 = case when value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4 is not null and value_pos_5 is null then b.value else value_pos_5 end
/SY.

Similar Messages

  • Import Format script required to update multiple fields

    Further to my previous post yesterday (Import Format script required to work across multiple fields I now need my import script to update multiple (two) fields at the same time, based on criteria set across multiple fields. So far, I can use DW.Utilities.fParseString to assess the values across multiple fields, but I now need to update not only the field in question, but also an additional field at the same time. For example:
    Function TBService(strField, strRecord)
    ' How do I update a second field at the same time?
    Dim strField2 As String
    If Left(strField, 1) = "S" Then
    If DW.Utilities.fParseString (strRecord, 3, 8, ",") = "B1110" Then
    strField2 = "N101"
    Else
    strField2 = "Network N/A"
    End If
    TBService = strField
    Else
    TBService = "Service N/A"
    End If
    End Function
    Is this even possible? Should I be looking at creating an event script which would work post-import? Or can this be done right here in the import script?

    All the logic you require can be encapsulated in the import script for the second field. You don't need to reference the second field in the first import script.
    Edited by: SH on May 2, 2012 5:39 PM

  • Update multiple fields using select query efficiently – 9i

    I need to populate a table called prop_charact used for synching data to a legacy system.
    Prop_charact has fields that are found in a few other tables (no one field is found in more than one table outside of prop_charact). I want to pull the data from the corresponding fields in the source tables and put it into prop_charact. I only want to populate prop_charact with records that have been updated, but want to pull all fields for those records (whether or not that field has been updated). I am getting the list of updated records from a transaction history table.
    After getting that list, I was not sure what to do with it.
    I put what I want to do in terms of strictly SQL. I am thinking there are more efficient (less system resources) ways of doing this, but I am not sure what to pursue. I can use PL/SQL, but please keep in mind I am limited to using version 9i. Anyone have any hints about what I should look into using instead of just thes particular SQL statements?
    insert into eval.prop_charact (parcelno, propertyid)
    select distinct p.parcelno, p.propertyid
    from eval.transaction_history tr,
    admin.properties p
    where tr.propertyid = p.propertyid
    and trim(tr.tablename) in ('PROPERTIES', 'PROPERTYCHARACTERISTICS','EQID','NEWCHARACTERISTICS','DIMENSIONS', 'NON_RESIDENTIALS')
    and trim(tr.fieldname) in ('BLDGCODE', 'CATCODE', 'UNFINISHED', 'TOPOGRAPHY', 'GARAGETYPE', 'GARAGESPACES', 'OPENSPACES',
    'VIEW', 'GENERALCONSTRUCTION', 'YEARBUILT', 'ESTIMATEDYEAR', 'TOTALROOMS', 'TOTALBEDROOMS',
    'BASEMENTTYPE', 'NUMBEROFFIREPLACES', 'HEAT', 'CENTRALAIR','CONDITION','SITE_TYPE','TOTALDWELLINGAREA',
    'PLOTFRONT','PLOTDEPTH','PLOTSQFT','SHAPE','STORIES','FULLBATHROOMS','PARTBATHROOMS','MULTIPLE_BLDGS')
    and tr.trans_date >= to_date('01-01-2010', 'MM/DD/YYYY')
    and tr.trans_date < sysdate
    order by p.parcelno;
    update
    select p.BLDGCODE pBLDGCODE, epc.BLDGCODE epcBLDGCODE, p.CATCODE pCATCODE,epc.CATCODE epcCATCODE,
    p.UNFINISHED pUNFINISHED, epc.UNFINISHED epcUNFINISHED,
    pc.TOPOGRAPHY pcTOPOGRAPHY, epc.TOPOGRAPHY epcTOPOGRAPHY,
    pc.GARAGETYPE pcGARAGETYPE, epc.GARAGETYPE epcGARAGETYPE,
    pc.GARAGESPACES pcGARAGESPACES, epc.GARAGESPACES epcGARAGESPACES,
    pc.OPENSPACES pcOPENSPACES, epc.OPENSPACES epcOPENSPACES, pc.VIEW_ pcVIEW_, epc.VIEW_ epcVIEW_,
    pc.GENERALCONSTRUCTION pcGENERALCONSTRUCTION,
    epc.GENERALCONSTRUCTION epcGENERALCONSTRUCTION,
    pc.YEARBUILT pcYEARBUILT, epc.YEARBUILT epcYEARBUILT,
    pc.ESTIMATEDYEAR pcESTIMATEDYEAR, epc.ESTIMATEDYEAR epcESTIMATEDYEAR,
    pc.TOTALROOMS pcTOTALROOMS, epc.TOTALROOMS epcTOTALROOMS,
    pc.TOTALBEDROOMS pcTOTALBEDROOMS, epc.TOTALBEDROOMS epcTOTALBEDROOMS,
    pc.BASEMENTTYPE pcBASEMENTTYPE, epc.BASEMENTTYPE epcBASEMENTTYPE,
    pc.NUMBEROFFIREPLACES pcNUMBEROFFIREPLACES, epc.NUMBEROFFIREPLACES epcNUMBEROFFIREPLACES,
    pc.HEAT pcHEAT, epc.HEAT epcHEAT, pc.CENTRALAIR pcCENTRALAIR, epc.CENTRALAIR epcCENTRALAIR,
    e.CONDITION eCONDITION, epc.CONDITION epcCONDITION,
    n.SITE_TYPE nSITE_TYPE, epc.SITE_TYPE epcSITE_TYPE,
    d.TOTALDWELLINGAREA dTOTALDWELLINGAREA, epc.TOTALDWELLINGAREA epcTOTALDWELLINGAREA,
    d.PLOTFRONT dPLOTFRONT, epc.PLOTFRONT epcPLOTFRONT,
    d.PLOTDEPTH dPLOTDEPTH, epc.PLOTDEPTH epcPLOTDEPTH,
    d.PLOTSQFT dPLOTSQFT, epc.PLOTSQFT epcPLOTSQFT,d.SHAPE dSHAPE, epc.SHAPE epcSHAPE,
    pc.STORIES pcSTORIES, epc.STORIES epcSTORIES,
    n.FULLBATHROOMS nFULLBATHROOMS,epc.FULLBATHROOMS epcFULLBATHROOMS,
    n.PARTBATHROOMS nPARTBATHROOMS, epc.PARTBATHROOMS epcPARTBATHROOMS,
    nr.MULTIPLE_BLDGS nrMULTIPLE_BLDGS, epc.MULTIPLE_BLDGS epcMULTIPLE_BLDGS
    from eval.prop_charact epc, admin.properties p, admin.propertycharacteristics pc, admin.eqid e,
    admin.dimensions d, eval.newcharacteristics n, EVAL.non_residentials nr
    where epc.propertyid = p.propertyid and epc.propertyid = pc.propertyid and epc.propertyid = e.propertyid(+)
    and epc.propertyid = d.propertyid(+) and epc.propertyid = n.propertyid(+) and epc.propertyid = nr.propertyid(+)
    set epcBLDGCODE= pBLDGCODE, epcCATCODE= pCATCODE, epcUNFINISHED = pUNFINISHED,
    epcTOPOGRAPHY = pcTOPOGRAPHY, epcGARAGETYPE = pcGARAGETYPE, epcGARAGESPACES = pcGARAGESPACES,
    epcOPENSPACES = pcOPENSPACES, epcVIEW_ = pcVIEW_, epcGENERALCONSTRUCTION = pcGENERALCONSTRUCTION,
    epcYEARBUILT = pcYEARBUILT, epcESTIMATEDYEAR = pcESTIMATEDYEAR, epcTOTALROOMS = pcTOTALROOMS,
    epcTOTALBEDROOMS = pcTOTALBEDROOMS, epcBASEMENTTYPE = pcBASEMENTTYPE,
    epcNUMBEROFFIREPLACES = pcNUMBEROFFIREPLACES, epcHEAT = pcHEAT, epcCENTRALAIR = pcCENTRALAIR,
    epcCONDITION = eCONDITION, epcSITE_TYPE = nSITE_TYPE, epcTOTALDWELLINGAREA = dTOTALDWELLINGAREA,
    epcPLOTFRONT = dPLOTFRONT, epcPLOTDEPTH = dPLOTDEPTH, epcPLOTSQFT = dPLOTSQFT,
    epcSHAPE = dSHAPE, epcSTORIES = pcSTORIES, epcFULLBATHROOMS = nFULLBATHROOMS,
    epcPARTBATHROOMS = nPARTBATHROOMS, epcMULTIPLE_BLDGS = nrMULTIPLE_BLDGS;

    The following example may be of help.
    SQL> create table mytable(col1 number(1),
      2  col2 date);
    Table created.
    SQL> insert into mytable values(1,sysdate);
    1 row created.
    SQL> select * from mytable;
          COL1 COL2
             1 20-AUG-04
    SQL> update mytable
      2  set (col1,col2) = (select 2, sysdate-1 from dual);
    1 row updated.
    SQL> select * from mytable;
          COL1 COL2
             2 19-AUG-04

  • Update multiple fields with same/diffrent name

    I have the form is displayed  order no, message and sent_date. Mesage and Date sent are editable.  I can change value from both colums in diffrent values then hit submit for update.  My code below is loop thur message and date sent field then update them based on the pk ID.  Unfortunately, it didn't work as the expected.  Can you please help?
    Oder NO
    Message
    Date Sent
    5463
    first message
    12-10-12
    5463
    second message
    10-13-12
    <cfset myIds = ArrayNew(1)>
    <cfform name="update" method="post">
    <cfloop query="qMesg">
       <cfscript>
            ArrayAppend(myIds, "#id#");
            </cfscript>
         <cfinput type="text" value="#mesg#" name="mesg">
         <cfinput type="text" value="#dateformat(sent_date, 'mm-dd-yy')#" name="sent_date" validate="date" />
         <cfinput type="submit" name="submit" value="Update">
    </cfloop>
      <cfset myIdsList = #ArrayToList(myIds, ",")#>
       <cfinput type="hidden" name="ids" value="#myIdsList#">
    </cfform>
    <!---update--->
    <cfif isDefined("form.submit")>
    <cfloop index="idIdx" list="#newsids#" delimiters=",">
    <cfloop list="#form.mesg#" index="x">
    <cfloop list="#form.sent_date#" index="y">
          update [tblMessg]
         set mesg = <cfqueryparam value="#x#" cfsqltype="cf_sql_varchar">,
               sent_date = <cfqueryparam value="#y#" cfsqltype="cf_sql_date">
       where id = <cfqueryparam value="#idIdx#" cfsqltype="cf_sql_integer">
      </cfloop>
    </cfloop>
    </cfloop>
    </cfif>

    I am with Dan on this (identifying the field names with IDs), but prefer cfloop to cfoutput within cfform. Furthermore, I would put the submit button outside the loop.
    <cfloop query="qMesg">
        <cfscript>
        ArrayAppend(myIds, "#id#");
        </cfscript>
        <cfinput type="text" value="#mesg#" name="mesg#id#">
        <cfinput type="text" value="#dateformat(sent_date, 'mm-dd-yy')#" name="sent_date#id#" validate="date" />
    </cfloop>
    <cfinput type="submit" name="submit" value="Update">
    With proper handling, one loop should be sufficient on the action page.
    <cfloop index="idIdx" list="#form.ids#" delimiters=",">
        <cfset current_message = form["mesg" & idIdx]>
        <cfset current_date_sent = form["sent_date" & idIdx]>
        <cfquery>
        UPDATE tblMessg
        SET mesg = <cfqueryparam value="#current_message#" cfsqltype="cf_sql_varchar">,
        sent_date = <cfqueryparam value="#current_date_sent#" cfsqltype="cf_sql_date">
        WHERE id = <cfqueryparam value="#idIdx#" cfsqltype="cf_sql_integer">
        </cfquery>
    </cfloop>

  • Updating multiple fields at once

    i have a form with a check box
    <cfinput type="checkbox" name="update_friend" value="1"
    checked="yes">
    then on the action page my query reads
    <cfparam name="FORM.update_friend" default="0">
    <cfquery datasource="#application.datasource#">
    UPDATE user_friend
    SET update_friend = #FORM.update_friend#
    WHERE id_friend =#FORM.id_friend# (THIS IS THE PRIMARY KEY
    FOR THE TABLE I AM TRYING TO UPDATE)
    </cfquery>
    when i submit this, i am getting a mysql error message,
    any help would be appreciated
    thanks

    ok let me explain a bit more...
    i have a system which shows what your friends have been doing
    on my website...what artists they have added into the database
    etc(Updates)....what i am trying to do is allow people to choose
    which friends they would like to recieve updates for...
    so i have a column called update_friend which is set to
    default 1 in the friends table...then I have a query on the updates
    page which shows the activity of all of your friends with a 1 in
    the update_friend column...
    to allow people to control which friends they recieve updates
    from I have a form which checkboxes
    <a href="
    http://www.musicexplained.co.uk/delete/updates_opt.cfm">click</a>
    if you want to remove a friend from your updates list you
    would decheck the checkbox next to their name and then submit...
    what i would then like to happen.....is for the query to
    update the checked check boxes with 1 so the user will still
    recieve updates from those people, and update the unchecked check
    boxes with 0 so they no longer recieve updates from them
    if I have 4 checked check boxes out of the 7 i am getting a
    list (1,1,1,1) as an output, which would suggest initially that the
    <cfparam name="FORM.update_friend" default="0"> isnt working,
    but regardless of this I would like if john was checked, dave was
    checked, mary was checked and james was checked, and then hilary,
    donny and gas was unchecked.......john, dave, mary and james would
    be updated with 1 in their update_friend columns, and the rest
    would be updated with 0 ..
    so essentially the query would be
    UPDATE user_friend
    SET update_friend = 1,1,1,1,0,0,0
    WHERE id_friend IN (12,13,14,15,16,17,18)
    thanks

  • Updating multiple fields using a single update statement.

    Hi All,
    I am a beginner to Oracle. I have used the following Hint in an update query that is executed in Oracle 10G. We recently updated the Oracle to version 11g and when executing the query getting the following Error: ORA-01779: cannot modify a column which maps to a non key-preserved table. PFB the query. Please suggest me some ways that I can do to avoid this error.
    UPDATE /*+ bypass_ujvc */
    (SELECT t1.STG_DEL_CONDITION, t2.condition
    FROM stg_reports_membenft_latest T1 JOIN (select ods_ssn_grp,sys_id, first_value(STG_DEL_CONDITION) over(PARTITION BY ods_ssn_grp,sys_id
    ORDER BY STG_DEL_CONDITION DESC) AS
    condition from stg_reports_membenft_latest) T2
    ON T1.ods_ssn_grp = T2.ods_ssn_grp AND T1.SYS_ID=T2.SYS_ID ) x
    SET x.STG_DEL_CONDITION = x.condition;
    Thanks and Regards,
    Karthik Sivakumar.

    I used the below query and got the Result.
    Thank You all
    MERGE INTO stg_reports_membenft_latest x1
    USING (SELECT distinct ods_ssn_grp,
    sys_id,
    First_value(STG_DEL_CONDITION) OVER(partition BY ods_ssn_grp,sys_id
    ORDER BY STG_DEL_CONDITION DESC)
    AS condition
    FROM stg_reports_membenft_latest) x2
    ON ( x1.ods_ssn_grp = x2.ods_ssn_grp
    AND x1.SYS_ID = x2.sys_id )
    WHEN matched THEN
    UPDATE SET x1.STG_DEL_CONDITION=x2.condition;

  • Copy Field Formats into multiple fields

    I have a form that has a spreadsheet layout. Multiple fields need to be formatted as currency or date. Outside of using Java scripts is there a way to copy the formatting of one filed to multipe others? I want to avoid Java script because I'm lousy with it.

    Is it possible to have each field separated by a comma? Space
    delimiters won't work since not all cities & states are one
    word (ie. New York, New York) however a comma delimiter would allow
    you to use simple list functions to extract the data.
    If this isn't possible but the data is always in the format:
    city<comma>state<space>zip, then you could extract the
    city using comma as the delimiter and then extract the zip code
    using the ListLast() function with space as the delimiter which
    would leave you with the state as the remaining text. This would
    only work however if your data is consistently in the format
    described above.
    Failing this you could build two tables with states and
    cities and then use them to identify valid states and cities and
    extract the data that way.
    cheers

  • I am trying to update the Subcontracting type of PO using 'BAPI_PO_CHANGE'. However i am able to update this field . Can someone advice me how to do.

    HI,
    I am trying to update the Subcontracting type of PO using 'BAPI_PO_CHANGE'. However i am able to update this field .
    Can someone advice me how to do.
    My code sample is :
    wl_poitem-po_item = l_ebelp.
    wl_poitemx-po_item = wl_poitem-po_item.
    wl_poitemx-po_itemx = c_x.
    *C--material procurement indicator need to update
    *   the type of procurement
    wl_materialind-po_item       = wl_poitem-po_item.
    wl_materialindx-po_item      = wl_poitem-po_item.
    wl_materialindx-po_itemx     = c_x.
    wl_materialind-item_no       = wl_poitem-po_item.
    wl_materialindx-item_no      = wl_poitem-po_item.
    wl_materialindx-item_nox     = c_x.
    wl_materialind-mat_provision = 'S'.
    wl_materialindx-mat_provision = c_x.
    wl_materialind-sched_line      = '0001'.
    wl_materialindx-sched_line     = '0001'.
    wl_materialindx-sched_linex    = c_x.
    wl_materialind-entry_quantity  = wl_poitem-quantity.
    wl_materialindx-entry_quantity = c_x.
    wl_materialind-plant           = wl_poitem-plant.
    wl_materialindx-plant          = c_x.
    wl_materialind-material        = wl_poitem-material.
    wl_materialindx-material       = c_x.
    wl_materialind-item_cat        = 'L'.
    wl_materialindx-item_cat       = c_x.
    wl_extensionin-structure  = 'BAPI_TE_MEPOITEM'.
    wl_extensioninx-structure = 'BAPI_TE_MEPOITEMX' .
    wl_extensionin-valuepart1+222(1) = '1'.
    wl_extensioninx-valuepart1+24(1) = c_x.
    APPEND wl_poitem  TO tl_poitem.
    CLEAR  wl_poitem.
    APPEND wl_poitemx TO tl_poitemx.
    CLEAR  wl_poitemx.
    APPEND wl_materialind TO tl_materialind.
    CLEAR  wl_materialind.
    APPEND wl_materialindx TO tl_materialindx.
    CLEAR  wl_materialindx.
    APPEND wl_extensionin  TO tl_extensionin.
    CLEAR  wl_extensionin.
    APPEND wl_extensioninx TO tl_extensioninx.
    CLEAR  wl_extensioninx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
       EXPORTING
         purchaseorder = l_ebeln
         versions      = wa_version
       TABLES
         return        = tl_return
    *    poitem        = tl_poitem
    *    poitemx       = tl_poitemx
         pocomponents  = tl_materialind
         pocomponentsx = tl_materialindx
         extensionin   = tl_extensionin
         extensionout  = tl_extensioninx.
    READ TABLE  tl_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc NE 0.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
    ENDIF.

    In the above question i mean- I am UNABLE to update

  • Need to update custom fields in MSEG table using "BAPI_GOODSMVT_CREATE"

    Hi All,
    There is a requirement to update custom fields in table MSEG which are part of append structure. There is a option to update the custom fields using the one of the tables parameters "EXTENSIONIN". Anyone please advice how can I update the custom field thru EXTENSIONIN.
    Thanks in advance.
    cheers,
    Vijay

    see the help
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
    Regards
    Kiran Sure

  • Need Network Advice: Multiple IP numbers.

    Hello I need some advice on setting up my office's network. I have a small amount of network knowledge, mostly just setting up my home networks and our offices simple existing network. Right now we have Verizon internet. The network looks like this -
    1 static IP -> Verizon Modem/Router -> 24port gig switch -> wired to 8 offices -> connected to 8 computers.
    We are canceling Verizon and getting Comcast with 5 IP addresses. Our goal is to continue using a network like we have, but add a server on the side for clients and remote employees to drop files. We have 2 mac mini's ready for the task of being servers with OSX Tiger on them. I would like to set one or both of them up as FTP servers, so we can hand out login/pass info and people can ftp into them to drop stuff or pick stuff up.
    Anyone have any advice for how to setup a network with multiple IP addresses? Do I need more than 1 router? Which router is best for Mac, because we will need a new one to replace verizons. Any advice on where I can find information on setting up the FTP server on our mac mini with Tiger? I've looked around, but I don't think the sites I found were using Tiger, menus weren't exact and I couldn't get it to work.
    Thanks for the help!
    Our office is ALL mac, 5x_8-core 2x_imac 2x_macpro 2x_mini

    You don't need a "Gigabit router". It's way, way overkill (and $$$$$$) for your network.
    The Comcast link is going to max out at about 15-20mpbs, so any router with 100mpbs links is going to be more than sufficient.
    As it happens, I wouldn't get a router anyway. Comcast are going to provide you with a router (they need to in order to terminate the RG-58 cable connection they drop and provide an ethernet port (that ethernet port, BTW, will be 100base-T).
    What you really need is a firewall. One that can handle multiple public IP addresses and allow specific incoming traffic (e.g. the FTP servers).
    I would recommend something from NetScreen. You may be able to pick up one of their NetScreen 5GTs pretty cheap now they're end of life (I have several of these around my network, including one in the exact same configuration you're talking about here). Failing that the SSG-5 would be sufficient.
    They also have the advantage of being able to run as a VPN endpoint should you need that functionality.
    At the end of the day your network topology would look something like:
    Comcast router -> (NetScreen) Firewall -> Switch -> Clients
    All the clients will connect to the switch and can talk amongst themselves at gigabit speeds. Any internet traffic would pass from the switch to the firewall and out to the big bad world.

  • I need to run the program in back ground and then update two fields

    hi gurus
    i need to run the program in back ground and then update two fields in the z table by mm02 transaction by using bapis , can any one give me the code for this.
    Message was edited by:
            Rocky

    hi
    good
    go through this link
    http://www.sapdb.org/7.4/htmhelp/34/ee7fba293911d3a97d00a0c9449261/content.htm
    thanks
    mrutyun^

  • Need to update multiple records using store procedure

    Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
    for example my source is
    emp_name sal
    abhi 2000
    arti 1500
    priya 1700
    i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
    i have tried following code
    create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select sal into p_sal from emp;
    if sal<2000 then
    update emp set sal= sal+200;
    end i;f
    end;
    and i have called the procedure using following codes
    set serveroutput on
    declare
    p_sal emp.sal%type;
    v_cursor sys_refcursor;
    begin
    upt_sal(p_sal,v_cursor);
    fetch v_cursor into p_sal;
    dbms_output.put_line(p_sal);
    end;
    the program is executing but i should get o/p like this after updating
    1700
    1900
    but i am getting first row only
    2000
    and record is not upsating...please help me with this
    thanks

    Hi Alberto,
    thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
    and i have similar kind of requirement where i need to deal with procedure which returns more than one row
    my source is
    empno ename salary
    111,abhi,300
    112,arti,200
    111,naveen,600
    here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
    here i have written store procedure like this
    create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select ename,salary into p_ename,p_salary from emp where empno=p_empno;
    end;
    and i have called this by using
    declare
    p_salary emp.salary%type;
    p_ename emp.ename%type
    v_cursor sys_refcursor;
    begin
    show_emp_det(111,p_ename,p_salary,v_cursor);
    fetch v_cursor into p_ename,p_salary;
    dbms_output.put_line(p_ename);
    dbms_output.put_line(p_salary);
    end;
    here i should get
    abhi,300
    naveen,600
    but i am getting first row only
    abhi,300
    but i want to fetch both rows...pls help me to find the solution

  • How to update multiple based on particular field

    Hi All,
    I have a requirement i.e, i have to update two fields based on another field in OIM 11g
    like
    emp_type cashier_ind store_ind
    H N N
    S Y Y
    here based on emp_type i need update casher_ind and store_ind as shown above, as per my knowledge i think i have to use entity adapter for this is it ryt? can any one help in this

    Use Post Process Event Handlers
    Check Metalink: 1262803.1

  • Need Check Box Help using Acrobat Multiple Fields

    I am trying to get the check marks on this form to act as individual units that can be tabbed through (going down left column, then to right column). I used the "Place Multiple Fields" command to get all the check boxes in. Now, when I do my preview test run, if one box is checked more than one gets checked off someplace else in the form. I want them each work as their own unit and not be associated wiht the other boxes. Do I have to draw each one of these in individually to get this to work the way I want it to work? I am guessing that can't be true. This is a computer after all.I am betting it is an adjustment I need to make to the "Place Mulitple Field"  command when I put them in???? I know this one will be a simple answer witha simple soultion. I'm tap dancing all around it and just can't get it. The visual shoudl expalin it all. Thank you.
    I check on one box in the left column and it also checks other boxes in the right column or elsewhere.

    You need to give each separate check box a unique name. If check boxes have the same name and export value, they will behave that way. If several check boxes have the same name but unique export values, they will behave as a group, where only one in the group can be selected, very similar to how a radio button group normally would behave.

  • I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    Thanks for your response. I do believe I have the information needed for each form on a separate line in Excel. There is a first name, middle name, last name, city, and zip column. And field is entered on a different line for all the information. I'm really stuck.

Maybe you are looking for

  • Opening a report designed in Report 10g in Excel format

    I have passed the desformat parameter as spreadsheet but still i find unnecessary blank cells between columns and rows. The report is created in Report Builder 10g manually without using the Report wizard. I have tried to remove all the spaces betwee

  • ITunes could not sync contacts because the synch server failed to synch....

    I have a laptop running Windows 7 (professional edition) 64 bit using Outlook 2010 and I get this same daggone message every time I try to synch contacts, calender, or notes (all Outlook 2010)...."iTunes could not synch contacts to the iPhone because

  • Bapi to update taxcode.

    Hi all, Can anybody tell me the bapi to update taxcode of sales order which is having a particular po. Plz let me know as early as possible.

  • Problem floppy disk

    How I configure the disketera for have a good working? I have problem of I/O SYSTEM: SunOS rches 5.10 Generic_118855-33 i86pc i386 # mount -F pcfs /dev/diskette /diskette mount: I/O error (check) # ps -ef |grep vold # /etc/init.d/volmgt stop # dd if=

  • Empty JSON response can't be serialized

    Hi, FB4 B2 I was getting an error from JSONSerializer object when the returned array has no elements inside. the returned JSON encoded raw data is a simple array representation: []. Is there anything I'm doing wrong, server side is php and I'm using