Count records and update total in table

I have a class schedule that people use to register for a class. The schedule displays how many people are registered but that is a manual entery be me in the database. Is there a way to set this up to where all of the registrations for a class are counted and the total displayed in the schedule?
Using Access 2007.
registratron form
action page
schedule page
thnks Jim

Hi Again,
I tried both the subselect and the two query method with no luck. The two query method did return less errors. I have included code and would really appreciate some feeback  thank you --jim
form--------------------- 
<cfinput type="text" name="name" message="Please enter your full name." required="yes" id="name">
        </div>
<div class="register">
<label for="county">COUNTY:</label>
  <cfselect name="county" query="qcounty" value="county">
            <option value="" selected="selected">Select a County</option>
            </cfselect></div
<div class="register">
<label for="email">EMAIL:</label>
                        <cfinput type="text" name="email" message="Please enter a valid email address" required="yes" validate="email"></div>
            <br />
          <div class="register">             
            <cfinput type="submit" name="submit" value="Register">  <cfinput type="reset" name="Reset " value="Reset Form">
       </div></fieldset></cfform>
action page-------------------
  <cfinsert datasource="WebAdmin" tablename="mobiltyTrainingRegistration"
          formfields=" Name, Email, County, Phone1, Phone2, Phone3, Class, classID, Comment">
<!--- populate #registered field in schedule--->
          <cfquery name="qAttendance" datasource="webAdmin">
       select count(class) as total
       from mobiltyTrainingRegistration</cfquery>
       <cfquery name="qAttendance" datasource="webAdmin">
       insert into mobilityClassSchedule(status) values ("#qAttendance.RecordCount#")</cfquery>
schedule page-------------------------------------
<cfoutput query="training">
    <tr>
      <td class="c7" width="39%" align="left" style="font-size:0.90em;"> #Class#</td>
        <td class="c7" width="19%" align="center" style="font-size:0.90em; text-align:left;">#Location#</td>
        <td class="c7" width="21%" align="center" style="font-size:0.90em;">#DateFormat(DropDate, "mmm-dd-yy")#</cfoutput>
  <cfoutput query="qAttendance">
          <td width="21%" align="center" style="font-size:0.95em;">#qAttendance.Recordcount#</td> 
</tr></cfoutput></table>

Similar Messages

  • Comparing Two tables with 300k records and update one table

    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results  will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    ef2019c7-080c-4475-9cf4-2cf1b1057a41 wrote:
    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.
    Why are you trying to use PL/SQL tables?  If tabl_1 and tabl_2 are regular database tables, it will be much simpler and faster just to use them.
    Depending on your requirements, you can do an UPDATE or MERGE, either in SQL or in PL/SQL.

  • Insert,  Delete and Update options in Table control

    Experts,
    I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
    can any one send the code for the above please...
    Thanks in advance..

    Hi,
    Following steps will help you.
    1.TOP-INCLUDE
    DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: WA LIKE KNA1.
    DATA: ANT TYPE I,CUR TYPE I.
    DATA: OK_CODE TYPE SY-UCOMM.
    CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
    IN FLOWLOGIC
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CLEAR_DATA.
    LOOP AT ITAB1.
    MODULE MOVE_DATA.
    ENDLOOP.
    ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
    SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
    CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
    DOUBLE CLICK ON MODULE “CLEAR_DATA”.
    write the in this module as below.
    CLEAR ITAB2. REFRESH ITAB2.
    DOUBLE CLICK ON MODULE “MOVE_DATA”.
    write the code in this module as below.
    APPEND ITAB1 TO ITAB2.
    ACTIVATE PAI AND WRITE THE CODE AS BELOW.
    CASE OK_CODE.
    WHEN 'FETCH'.
    SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
    TABCTRL-LINES = SY-DBCNT.
    WHEN 'ADD'.
    GET CURSOR LINE CNT.
    CNT = TABCTRL-TOP_LINE + CNT - 1.
    CLEAR WA.
    INSERT WA INTO ITAB1 INDEX CNT.
    WHEN 'MODIFY'.
    GET CURSOR LINE CNT.
    READ TABLE ITAB2 INDEX CNT.
    LOOP AT ITAB2.
    MODIFY KNA1 FROM ITAB2.
    ENDLOOP.
    SELECT * FROM KNA1 INTO TABLE ITAB1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    SAVE,CHECK AND ACTIVATE ALL.
    CREATE TCODE AND EXECUTE.
    contact if u hv any issues regarding this code.
    reward points,if it is useful.
    Thanks,
    Chandu.

  • Condition records and tax code combination table

    CAn I know the table where both condition record and tax code stored.

    Hi Jose,
    I think you have quoted the tax procedure table.  There i have not found the tax codes. 
    My requirement is both condition records and tax codes combination table.
    I want to see for which condition type which tax code has been assigned.

  • COUNTING RECORDS AND DETERMINING AVERAGES IN REPORT WRITER

    I HAVE 10 GROUPS. I WANT TO BE ABLE TO COUNT RECORDS AND DETERMINE THE AVERAGE DAYS FOR EACH GROUP. I GET DAYS BY SUBTRACTING THE RECEIVED DATE FROM THE RESULT DATE. I WANT TO DETERMINE THE AVERAGE DAYS AND THE NUMBER OF RECORDS IN THE TOP 10%, THE TOP 20%, THE TOP 30%, THE TOP 40%, THE TOP 50%, THE TOP 60%, THE TOP 70%, THE TOP 80%, THE TOP 90%, AND THE TOP 100%. HOW DO I CODE MY LOOP IN PLSQL TO DO THIS? CAN I DO THIS IN REPORT WRITER?

    I am not sure about the exact thing that you are requiring. but you can get the top 100 and top 20 or top 300 etc. by using the ROWNUM function in sql statement.
    thanks

  • How to select and duplicate the records and update some column values using cursor

    I have a table with 920 records, we need to update the end date to 6/30/2014 for 920 records and I need to create all 920 records with start date is 7/1/2014 and update the external value to
    CCC.
    Note: the table primary key is not auto increment, but I have sp to get the latest key for that.
    Existing table.  
    ID
    Source Name
    Internal value
    External value
    Start date
    End date
    1
    XXX
    AAA
    BBB
    1/1/2013
    6/30/2015
    Create new records
    ID
    Source Name
    Internal value
    External value
    Start date
    End date
    921
    XXX
    AAA
    CCC
    7/1/2013
    12/30/2015

    Hi ManuGT
    If I understand what you need then you ask for:
    1. updating all current rows (920 rows in the table now)
    2. insert new rows which are duplicates of the preiviews rows, but with value 'CCC' insteade of 'BBB'
    If so, there is not reason to use a cursor and it is highly NOT RECOMMENDED to use ant type of loop.
    You should work with SET and do it all in 2 simple queries:
    -- first we duplicate the existing rows,
    -- but we use the values 'CCC" and '20140107' for the new rows values
    INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
    from test
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
    UPDATE test
    SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    Unfortunately you did not post DDL+DML! Therefore we cant see your table structure and the data sample and we can only guess. I used Saeid's post as the basic DDL+DML.
    Please next time post DDL+DML
    here is the full code with the DDL+DML that i used:
    -- This is our DDL - A create table query:
    create table test
    ( id int identity(1,1) primary key,
    SourceName nvarchar(3),
    InternalValue nvarchar(3),
    ExternalValue nvarchar(3),
    StartDate date,
    EndDate date
    go
    -- This is our DML - A query that insert some sample data
    declare @i int = 1 ;
    while @i < 921
    begin
    insert test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    values ('XXX', 'AAA', 'BBB', '1/1/2014', '6/30/2014' ) ;
    set @i += 1 ;
    end ;
    GO
    -- Here is the solution for the problem as I understood your needs:
    -- first we duplicate the existing rows,
    -- but we use the values 'CCC" and '20140107' for the new rows values
    INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
    from test
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
    UPDATE test
    SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Here we just check how the result look like :-)
    select *
    from test ;
    -- And since we do not realy need this table in our server... Here we clean the DDL (you probaby DO NOT WANT TO EXECUTE THIS!)
    DROP table test
    GO
    I hope this was useful :-)
    [Personal Site] [Blog] [Facebook]

  • How to insert past record after updating the master table in history table through store PROC

    Master Table
    Party Status
    A Active
    B Inactive
    C Active
    D Inactive
    Duplicate Table
    Party Status
    A Active
    B Active
    C Active
    D Inactive
    Updated Master Table
    Party Status
    A Active
    B Active
    C Active
    D Inactive
    Party History Table
    B Inactive
    I have two table one master and another duplicate I need to update master table based on duplicate table insert the record which updated into Party history table as shown above. need help to write store proc.

    Check MERGE syntax in BOL (example D). There should be a sample with output, e.g.
    insert into PartyHistory (Party, [Status])
    select Party, [Status] FROM
    (MERGE Master M using Duplicate D on M.[Party]=D.[Party]AND M.[Status]<>D.[Status]
    WHEN MATCHED THEN UPDATE
    SET [Status] = D.[Status]
    OUTPUT Deleted.[Party], Deleted.[Status], $Action) AS Changes (Party, [Status], Action) WHERE Action = 'UPDATE'
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to Query and Update/Insert Large Tables ...

    I have the following 2 tables:
    Table 1: Pricing
    This table holds pricing details of all Items (roughly 150,000 items). One Item has three types of prices Standard, Promotion, and Discounted. Therefore the table contains roughly 150,000 * 3 records. Also the prices may get updated frequently every day.
    Item#---Type------------FromDate---ToDate-----Price
    ===================================
    AAA-----Standard------01/01/05---31/12/05---1.50
    AAA-----Promotion----16/12/05---20/12/05---1.40     
    AAA-----Discounted---10/12/05---15/12/05---1.20
    BBB-----Standard------01/01/05---31/12/05---1.60
    BBB-----Promotion----17/12/05---18/12/05---1.30
    BBB-----Discounted---10/12/05---15/12/05---1.50
    Table 2: BestPrice
    At a given date, this table contains the best price (lowest price) of each item for the following 21 days (including the current date). The POS system is accessing this table to get the daily best price for billing customers.
    Item#----Date--------BestPrice
    =====================
    AAA------17/12/05----1.40
    AAA------18/12/05----1.40     
    AAA------19/12/05----1.40
    AAA------20/12/05----1.40
    AAA------21/12/05----1.50
    BBB------17/12/05----1.30
    BBB------18/12/05----1.30
    BBB------19/12/05----1.60
    BBB------20/12/05----1.60
    BBB------21/12/05----1.60
    Problem Statement:
    Table 2 (BestPrice) needs to get updated from Table 1 (Pricing) at least once every day with the best price for each item for the next 21 days (including the current day). What’s the most efficient method to perform this job?

    I don't know really why your application needs to use BestPrice table!
    It is not clear what it does for it because querying will not be better than querying the pricing table. This will be very fast with an index on intem#
    On the other hand, why do you use three rows per item in Pricing table? it could be one row per item.
    Any way, to populate the table for the first time :
    insert into bestprice
    select item#
         , dte
         , min(price) bestprice
    from pricing, (select trunc(sysdate) + rownum - 1 dte from dual connect by rownum <= 21) t
    where  dte  between fromdate and todate
    group by dte, item#Now, you can have a row trigger (update) on Pricing table which can change BestPrice table according to a change in Pricing tabe.
    Then you have to use a daily job that can be based on the following statement:
    update BestPrice B
    set dte = trunc(sysdate) + 20
      , BestPrice =
             select min(price)
             from Pricing P
             where P.item# = B.item#
                and B.dte between P.FromDate and P.ToDate
    where dte = trunc (sysdate) - 1Message was edited by:
    Michel SALAIS
    I forgot to say that that if your periods in the pricing table don't covere a desired date in the BestPrice table then my insert statement will not treat it and my update will put it to NULL

  • Implement the Logic in Mapping to select, compare and update on one table

    Hi All,
    We have a Sales Order history table *(HISTORY_TABLE)* and we want implement the below logic in warehouse builder where we are using only one table for checking the condition and selecting the records to update in the HISTORY_TABLE.
    Like
    SELECT ORDERNO, LINENO, ORDERTYPE FROM HISTORY_TABLE A
    WHERE EXISTS IN (SELECT ‘X’
    FROM HISTORY_TABLE B
    WHERE A. ORDERNO = B. ORDERNO
    AND   A. LINENO = B. LINENO
    AND   A.ORDERTYPE = B. ORDERTYPE
    HAVING MAX (B.PDDJ) = 0)
    Thanks in advance.

    Hi,
    you can implement this as
    SELECT A.ORDERNO, A.LINENO, A.ORDERTYPE FROM HISTORY_TABLE A,
    (SELECT ORDERNO,LINENO,ORDERTYPE FROM HISTORY_TABLE GROUP BY ORDERNO,LINENO,ORDERTYPE HAVING MAX(PDDJ) = 0) B
    WHERE A.ORDERNO = B.ORDERNO
    AND A.LINENO = B.LINENO
    AND A.ORDERTYPE = B.ORDERTYPE Use Aggregator (group by with having) and then Joiner
    Regards,
    Oleg

  • One submit button - Insert Record and Update Record

    I have a form in Dreamweaver CS3, using ASP VBScript and an
    Access database. When submitted, the form inserts a record into the
    table CountDate01. The record comes from a hidden field that gets
    its value from a field within that same table. There is no other
    data entered by the user in any other form fields. The info the
    form submits comes from: rsDate1Avail.Fields.Item("Date01").Value
    I would like if the same Submit button could also update a
    record in a second table (registrants) at the same time. I would
    like to submit the same info that comes from the hidden field to
    the second table. So it would be two actions occurring that both
    insert and update in 2 different tables from one submit button. Is
    this possible?
    Here is the code for the existing form action:
    <%
    If (CStr(Request("MM_insert")) = "submitDate1") Then
    If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_MumConn_STRING
    MM_editCmd.CommandText = "INSERT INTO CountDate01 (Date01)
    VALUES (?)"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param1", 135, 1, -1,
    MM_IIF(Request.Form("hiddenField"), Request.Form("hiddenField"),
    null)) ' adDBTimeStamp
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "form_FT_4.asp"
    If (Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0)
    Then
    MM_editRedirectUrl = MM_editRedirectUrl & "?" &
    Request.QueryString
    Else
    MM_editRedirectUrl = MM_editRedirectUrl & "&" &
    Request.QueryString
    End If
    End If
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If
    %>

    >I have a form in Dreamweaver CS3, using ASP VBScript and
    an Access
    >database.
    > When submitted, the form inserts a record into the table
    CountDate01. The
    > record comes from a hidden field that gets its value
    from a field within
    > that
    > same table. There is no other data entered by the user
    in any other form
    > fields. The info the form submits comes from:
    > rsDate1Avail.Fields.Item("Date01").Value
    >
    > I would like if the same Submit button could also update
    a record in a
    > second
    > table (registrants) at the same time. I would like to
    submit the same info
    > that
    > comes from the hidden field to the second table. So it
    would be two
    > actions
    > occurring that both insert and update in 2 different
    tables from one
    > submit
    > button. Is this possible?
    Yes. Use a command on the redirect page to update the data.
    No, wait, the
    ASP COMMAND IMPLEMENTATION IS BROKEN IN CS3, and remains
    broken in CS4. So
    sorry, you'll have to hand-code it.
    Sorry, I'm just a little bit bitter about the callous
    attitude Adobe has
    shown in fixing the KNOWN BUGS IN THEIR SOFTWARE.

  • BTE for Parking a document and updating a custom table

    Hi
    I want to update a custom table whenever a new parking document got posted through FBV4. I want to use a BTE for this please advice....
    Moderator message: please do some research before asking.
    Edited by: Thomas Zloch on Mar 10, 2011 9:15 AM

    Hi Gaurav,
    First time the correct data i have entered..and pressed "Save" button it is going and updating .After that i given same priority to multiple absence types..it errored out.. till now everything is fine.. Again i changed to correct value.. and pressed "Save" button. It is error out with an error like :
    JBO-25001: Name LOCATOR_SELECT3 of object type View Row Set Iterator already exists
    Code :
    int rowCount = vo.getFetchedRowCount();
    RowSetIterator rIter1 = vo.createRowSetIterator("LOCATOR_SELECT3");
    rIter1.setRangeStart(0);
    rIter1.setRangeSize(rowCount);
    int g=0;
    rIter1.reset();
    for ( int i=0;i<rowCount;i++)
    XxchrResultSetVORowImpl row = (XxchrResultSetVORowImpl)rIter1.getRowAtRangeIndex(i);
    String priority = ((String)row.getAbsencePriority());
    System.out.println("First Priority" + priority);
    for ( int j=0;j<rowCount;j++)
    if(i==j)
    g++;
    //leave this row
    else
    XxchrResultSetVORowImpl rows = (XxchrResultSetVORowImpl)rIter1.getRowAtRangeIndex(j);
    String priority2 = ((String)rows.getAbsencePriority());
    //String priority2 = ((String)row[j].getAttribute("AbsencePriority"));
    System.out.println("Second Priority" + priority2);
    if(priority.equals(priority2))
    //that means priority is repeated
    throw new OAException("error",OAException.ERROR);
    rIter1.closeRowSetIterator();
    Serializable[] param = {Businessgroupname,Retroactivedays};
    am.invokeMethod("Apply");
    Thanks
    Preeti

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Z field addition in MM01 and updation of MARA table

    Hi ABAPers
    I have created a Z field in BASIC DATA1 TAB in MM01 transaction as Input/Output Enabled of length 1 and type CHAR.
      Screen Name: SAPLZMGD1
        Numer : 2313
    And also added the same field in MARA table (Append structure) .
    When I enter value in MM02 screen for this field and is getting updated in MARA table and in MM02/MM03 screen  as well.
    My requirement is to update this field through BAPI_MATERIAL_SAVEDATA throug a Z program.
    To update using  this BAPI , I have added this field to BAPI_TE_MARA and BAPI_TE_MARAX structures also and passing these values to EXTENSIONIN and EXTENSIONINNX tables.
    But it is not getting updated when I supplied this value to BAPI , whereas other Z fields getting populated in MARA table.
    So please let me know where Iam doing wrong or any settings I missed while creating Screen field -
    Your quick response is highly appreciated
    Thanks
    Satya

    Hi Reddy
    Thanks for your reply
    I did as you mentioned .
    The field that I created is not getting populated and the other Z field on the same screen and  same tab is getting populated correctly.
    YYXPTY  CHAR(4)
    YYHISIND CHAR(1)
    here the YYXPTY field is getting populated in MARA table correctly but not YYHISIND which is created by me.
    The code that I have written is as below :  [Please help me out]
    REPORT  ztest_yyxpty.
    DATA: wa_bapimara TYPE bapimathead,
          t_extn  TYPE STANDARD TABLE OF bapiparex,
          wa_extn TYPE bapiparex,
          t_extnx  TYPE STANDARD TABLE OF bapiparexx,
          wa_extnx TYPE bapiparexx,
          wa_return TYPE bapiret2,
          t_rettab  TYPE STANDARD TABLE OF bapi_matreturn2,
          wa_makt TYPE bapi_makt,
          t_makt TYPE STANDARD TABLE OF bapi_makt.
    wa_bapimara-material = '500000000000088999'.
    wa_bapimara-basic_view = 'X'.
    wa_extn-structure = 'BAPI_TE_MARA'.
    wa_extn-valuepart1+0(18) = '500000000000088999'.  "Material number
    wa_extn-valuepart1+65(4) = '0002'.       " field YYXPTY
    wa_extn-valuepart1+69(1) = 'A'.            " field YYHISIND
    wa_extnx-structure = 'BAPI_TE_MARAX'.
    wa_extnx-valuepart1+0(18) = '500000000000088999'.
    wa_extnx-valuepart1+27(1) = 'X'.         
    wa_extnx-valuepart1+28(1) = 'X'.
    APPEND wa_extn TO t_extn.
    APPEND wa_extnx TO t_extnx.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata            = wa_bapimara
      IMPORTING
        return              = wa_return
      TABLES
        materialdescription = t_makt
        returnmessages      = t_rettab
        extensionin         = t_extn
        extensioninx        = t_extnx.
    IF wa_return-type = 'S'.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    WRITE: wa_return-type, wa_return-message, wa_return-message_v1,
    wa_return-message_v2, wa_return-message_v3, wa_return-message_v4.

  • Remove all duplicate records and load into temp table

    Hi
    I have a table contains data like this.
    Emp No Designation location
    1111 SE CA
    1111 DE CT
    3456 WE NJ
    4523 TY GH
    We found that there are two duplicate records for emp no: 1111. I want to delete all duplicate records (in this case two records for emp no:1111) and load into the temp table.
    Please advice me how to do it.

    Oh look, you can search the forums...
    http://forums.oracle.com/forums/search.jspa?threadID=&q=delete+duplicates&objID=f75&dateRange=all&userID=&numResults=30

  • Creating addititional records from one record and spreading total accross

    Can anyone help me with the following script logic scenario...
    We have an account with $$ and wish to spread it accross the remaing months of another scenario. 
    For example, In 2012.Jan, we have an Actual amount = 10,000.  Also, 2012.Jan Forecast = 5,000. 
    I need to take the difference -5,000 and push it into Forecast 2012.Feb, 2012.Mar, ... 2012.Dec and spread it evenly (-454.55).

    Hi Danny,
    Welcome to the forums!
    Here is a sample script to get you going:
    //Scope in the ACTUAL and FORECAST categories
    *XDIM_MEMBERSET CATEGORY=ACTUAL,FORECAST
    //Only scan through the actual data and only use the forecast data in the GET command within the *REC statement down below
    *XDIM_NOSCAN CATEGORY=FORECAST
    //Scope in the time period 2012.DEC
    //You should eventually make this dynamic using a *SELECT statement
    *XDIM_MEMBERSET TIME=2012.JAN
    *WHEN *
    *IS *
    //This for loop should become dynamic using a *SELECT statement. Choosing the months to forecast
    *FOR %MYTIME% = 2012.FEB,2012.MAR,2012.APR,2012.MAY,2012.JUN,2012.JUL,2012.AUG,2012.SEP,2012.OCT,2012.NOV,2012.DEC
    //Note you will need to add a property to your CATEGORY dimension called FCST_NUM and put a value of 11 for the ACTUAL member. This value will need to be updated as the number of months to forecast changes.
    *REC(EXPRESSION=((%VALUE%-GET(CATEGORY="FORECAST"))/FLD(CATEGORY.FCST_NUM),CATEGORY=FORECAST, TIME=%MYTIME%)
    *NEXT
    *ENDWHEN
    *COMMIT
    Two caveats is that data must always reside in the ACTUAL category. Since the logic is looping through every record in the ACTUAL category. Also, all the other data must be at the same intersection or else the GET statement will be looking in the wrong place. i.e. DataSrc for the Actuals and Forecast has to be at the INPUT member or else you would need specify where the data is for forecast category in the GET statement.
    Let me know how this goes.
    Thanks,
    John

Maybe you are looking for