Handling Conditions for Add/Copy/Insert Rows

Insert Row, Copy Row Contents etc. get trapped in the "Data Change" Event.
My requirement is as follows,
When the user clicks on Add Row (from the toolbar). I have to display a Pop up, and accept an input. If the the input at the Pop up screen is valid, according to standard ALV functionality, a new row is inserted into the displayed table. BUT if the user input at the pop up is invalid, I need to exit the event WITHOUT inserting a new row.
I have been able to display the pop up, accept user input and validate it, within the Data Change event. But I am unable to exit the event without a new row being added.
I have tried manipulating the imported attributes (example clearing them etc) of the Data Change event, like good_cells, mod_cells etc. But even then a new row gets inserted into the display table.
Can you please give me a solution?

Hi Prasanjit,
sorry that i couldn't get abck to you soon.
see in general the ON_DATA_CHANGED event will get fired for the following conditions :
1) when you double click on a particluar row
2) when press F4 and choose a value
3) when you enter a value and DBLclick on the same.
In your case if you click on ADD rows and if you find that it triggers this event then you shoe your POP-up screen and ask the user for the accept or reject. based on his answer you set a flag(global) which will be used to add rows. once if this flag is set then call your screen used for ALV(OO-ALV).
Now in the PBO of this screen you check this flag as whether it is set or not, if set then add a blank row to your output internal table passing to ALV and clear this flag.
following changes to the code needs to be made :
  METHOD on_data_changed.
    DATA: is_cells TYPE lvc_s_modi.
do your necessary pop-up application and set the flag *** based on the  user's approval.
    if user apporves then
    ws_flg_add = 'X'.
    endif.
    if ws_flg_add eq 'X'.
    call screen 200.
    endif.
  endmethod.
Now in the PBO of the screen 200 do the necessary changes:
  if my_container is initial.
called when the screen is called for the first time
    create object my_container exporting container_name =      'CONTAINER'.
    create object my_application.
    SET HANDLER lcl_event=>on_f4 FOR ALL INSTANCES.
    SET HANDLER lcl_event=>on_data_changed FOR ALL
    INSTANCES.
    call method my_application->display.
    else.
called when the event gets trigerred.
    call method my_application->display.
  endif.
inside the method display i have checked the field and added a new row to the output table.
  method display.
prepare fieldcatalog
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
         EXPORTING
              i_structure_name = 'EGERH'
         CHANGING
              ct_fieldcat      = gt_fieldcat.
     CALL METHOD my_grid->set_ready_for_input
           EXPORTING
             i_ready_for_input = 1.
added a extra row.
    if ws_flg_add eq 'X'.
      clear gs_outtab.
      append gs_outtab to gt_outtab.
      clear ws_flg_add.
    endif.
set table for first display
    CALL METHOD my_grid->set_table_for_first_display
      EXPORTING
       i_structure_name = 'EGERH'
        is_layout        = gs_layout
      CHANGING
        it_outtab        = gt_outtab[]
        it_fieldcatalog  = gt_fieldcat.
  endmethod.
this was a simple way and there are some other options.
Regards,
Jagath.

Similar Messages

  • Getting the last inserted row

    Hi
    I want to get the ID for the last inserted row in another view (not the ones I have in my page), to pass it to a web service. How can I get it?
    This returns the first ID in the table: ${bindings.myIterator.RequestId}
    This one doesn’t work either: ${bindings.myIterator.currentRow.RequestId}
    It shows the following exception
    1. JBO-29000: Unexpected exception caught: java.lang.RuntimeException, msg=javax.servlet.jsp.el.ELException: Unable to find a value for "RequestId" in object of class "model.Travel_ViewRowImpl" using operator "."
    2. javax.servlet.jsp.el.ELException: Unable to find a value for "RequestId" in object of class "model.Travel_ViewRowImpl" using operator "."
    What does ${bindings.myIterator.currentRow.dataProvider} returns?

    Hi,
    while this is close to the correct syntax it is not complete
    ${bindings.myIterator.currentRow.RequestId}
    this would attempt to call set/get RequestId on the Row class, which doesn't have this property. It has a property getAttribute() but this doesn't allow you to pass an argumentbecause of EL limitations.
    Work around: Create an attribute binding for the "RequestId" attribute and call it with
    #{bindings.RequestId.inputValue}
    ADF always ensures that the currentRow's RequestId is the one obtained from the Attribute binding
    Frank

  • How do you copy a conditional format rule down successive rows in a Numbers spreadsheet, maintaining continuity between two values within the same row?

    I have a spreadsheet with multiple rows and I want to copy a conditional format pattern on each row.
    e.g.
    Condition: row 1/col A (A1) = row 1/col BC (BC1). Conditional Format: Italic, Fill Green. Now I want to copy that to succeeding rows in my spreadsheet.
    A2 = BC2 => Italic, Fill Green
    A3 = BC3 => Italic, Fill Green ..... and so on.
    I should be able to drag the format down through the spreadsheet, with the BC column increasing (2, 3, etc.) along with the A column, but that does not happen. if I try to drag the format through the spreadsheet, the BC column remains locked on BC1. You have to physically go into each iteration and change the BC column iteration. This is one major difference between Numbers and Excel. Never had the problem in Excel. I prefer Numbers, and that is why Im looking for help in this matter. Thanks much.
    Eugene O'Connor

    Hi Eugene,
    This is the designed behaviour in Numbers. To register your desire for a change, Provide Numbers Feedback, using the link in the Numbers menu (in Numbers), or using the link in this message. Make a Feature Enhancement request.
    There is a bit of shortcut in editing the cell references in the rules you have now:
    Select all of the cells that will contain this rule.
    Set up the rule for the first (A1), using BC1 as the cell reference.
    Set up your table (hide columns) so that you can see both columns (A and BC ) while the Conditional format rules dialogue is open.
    Starting at A2, use this loop:
    - Click the BC1 reference in the rule to select it.
    -Click on cell BCn in the table.
    -Click the Edit button twice (toggles to Done, then back to Edit).
    -Press the down arrow to move to the next cell.
    -Repeat.
    An even shorter method is to add a column before or after column A, use a formula to test if A1=BC1, etc. (which will increment as you fill down), then set the conditional rule for that columns cells to
    Text is TRUE
    Set default text colour to white, and conditional text colour to match the conditional fill colour. This will flag the cells matching your condition by colouring the adjacent cell (and hide the text by matching the background colour in both default and conditional modes).
    Regards,
    Barry

  • Price and Pricing conditions are not copied to PO for a line item !!

    Hi
    I have created a PO w.r.t a PR which has only one line item.
    Now, I add another line item to this existing PO, i get an error message that the Price and Pricing conditions are not copied.
    How do i rectify this error !!
    Where might be the link for this Price and Pricing conditions to get copied in to this PO ??
    MaruthiRam

    What kind of PR and in the PO same material you enter for new line or new material and do you have any funcitonal authorization assigned o your user id
    please reply

  • I am trying to insert rows for alert_id 22 with diff abc_id and xyz_id

    I am trying to insert rows for alert_id 22 with diff abc_id and xyz_id
    these inserts will store in two tables that I have to join in the cursor.
    I have written cursor without passing cursor parameters. but here i need to pass acb_id and xyz_id along with alert_id.
    then if these are saticified with alert_id 22 then I want to stop the loop run, else i need to continue the loop. bcause the abc_id and xyz_id are diff for alert_id 22
    This is the issue I am facing!
    Please let me know if you have any idea. Let me know how to use cursor parameters here and in loop.
    Sample proc like this::
    Declare
    main_cursor
    another_cur
    alert_cur
    begin
    need to check first abc_id,xyz_id is already exist with alert_id 22
    if this set of records already exists then
    exit from the loop
    else
    continue with
    loop
    here coming the insert statements with different condition getting from first two cursors.(this part is ok for me)
    end loop
    end if
    Please write the logic if any idea on this.
    -LRK

    I want to stop if already alert_id is exist!

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

  • In 10.2 docucorp, how to add a manual condition for a group

    Hi,
    I've grouped some faps in 10.2 by applying groupbegin and group end rules. Can I add a common manual condition for this group in 10.2?
    Thanks,
    Sai krishna

    Hi Sai krishna,
    No, sorry can't do it. The ability to add a "common" trigger to a group of faps appeared in release 11.3, when the concept of sub-forms was first introduced.
    Gaétan

  • ADF Table sorting not working for  newly inserted rows

    Hi,
    I am using Oracle Jdeveloper 11.1.1.6.2
    I am trying to sort the table after inserting the mew rows using ADF Table UI sort option, But the newly inserted rows are not getting sorted.
    The code i am using to add a row is:
            ComplianceLibraryAMImpl am = getDataControl();
            EmKeywordVOImpl rep = am.getEmKeywordVO1();
            NameValuePairs nvp = new NameValuePairs();
            nvp.setAttribute("KeywordName", keyword);       
            Row row1 = rep.createAndInitRow(nvp);
            rep.insertRow(row1);After this addition we are doing ppr on the table and then trying to sort using sort icon in table.
    But the newly added rows are not taking part in sort.
    What am i missing?
    Thanks,
    Tripuresh

    This is the expected behavior. Check bug 9109010 - newly added and unsaved rows don't participate in sorting as per design. Try saving the rows and then sorting.
    Regards,
    Aditya

  • Multiple rows affected message for a single insert

    Why would this show multiple 1 row affected statements in the messages tab? I tried tracing it, but it only shows a single statement:
    create table #ltbl_Temp (a int, b varchar(100))
    insert into #ltbl_Temp values (1, 'AAA')
    drop table #ltbl_Temp
    Proceduces:
    (1 row(s) affected)
    (1 row(s) affected)
    Here is the plan
    John M. Couch

    In SQL Server, everything is a transaction.
    When you enable Actual execution plan, additional row is to represent the execution plan.,ie, 1 row for your actual insert and the next is for actual execution plan.
    You may check without actual execution plan, it would show only 1 row(s) affected. In other way, you may check with only Estimated Execution plan, it would return only 1 row(s) affected( here no data returns)
    Hope the above is clear.
    EDIT:
    Eg:
    create table #ltbl_Temp (a int, b varchar(100))
    insert into #ltbl_Temp values (1, 'AAA'),(1,'BBB')--With actual execution plan(2 row(s) affected)
    (1 row(s) affected)--Without actual execution plan(2 row(s) affected)
    --Only with estimated plan(1 row(s) affected)drop table #ltbl_Temp

  • Auto value for the inserted row in ALV

    Hey experts,
    I was following this tutorialALV Grid – Insert row function
    but he has a strange code there what doesn't work and I don't know how it should be.
    This is that part:
       ASSIGN er_data_changed->mp_mod_rows->* TO  FROM ls_outtab INDEX sy-tabix.
    I'm a junior developer and I'm doing this first time and I can't figure it out, how to do it, I was also debuging the BCALV_EDIT_04, but I can't find there what I need.
    P.S. Moderator please don't delete my post, I'm working on it a few hours already.
    Regards,
    Robert

    Hi
    I don't know what the tutorial you're linked wanted to do anyway you can try this:
    data: l_ins_row type lvc_s_moce.
         loop at er_data_changed->mt_inserted_rows into l_ins_row.
           er_data_changed->modify_cell(
             exporting i_row_id       = l_ins_row-row_id
                       i_fieldname    = 'PLANETYPE'
                       i_value = 'BUBU' ).
         endloop.
    You need to do it in DATA_CHANGED event and you need to raise the events
    call method g_grid->register_edit_event
         exporting
           i_event_id = cl_gui_alv_grid=>mc_evt_enter.
       call method g_grid->register_edit_event
         exporting
           i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    in order to triggered DATA_CHANGED for a new line
    Max

  • ALV report-Add a count row at teh botttom.

    Hi!
    I would like to adda row to my ALV report at the bottom of the report which will show me the count of number of billing documents existing in the repport. Even when the report is fileterd on certain conditions , the total at teh bottom should change as per the records showing. basically I need to add a total row at teh bottom of my report which will give the number of billintg documents that show up in the report.
    Is it possible ? If so how do I go about please.
    Thanks

    I have this , but not sure where to insert the line count in this .
    *&      Form  CALL_ALV
    Call the ALV Grid function.
    FORM call_alv .
      SORT it_extract BY vbeln.
    repid is necessary since the ALV F.M. does not work properly with
    sy-repid.
      repid = sy-repid.
      alv_variant-variant  = pa_vari.
      alv_variant-report   = sy-repid.
      alv_variant-username = sy-uname.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = repid
          i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat             = t_fieldcat[]
          it_sort                 = gt_sort[]
          i_default               = 'X'
          i_save                  = 'A'
          is_variant              = alv_variant
          it_events               = gt_events[]
          is_print                = tp_print
        TABLES
          t_outtab                = it_extract2
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
      IF sy-subrc NE 0.
        MESSAGE w000 WITH text-004 ' ' ' ' ' '.
      ENDIF.
    ENDFORM.                    " CALL_ALV
    *&      Form  alv_eventtab_build
        Pass list of events to be triggered by the ALV function module
    FORM alv_eventtab_build USING  u_name  TYPE slis_alv_event-name
                                   u_form  TYPE slis_alv_event-form
                                   alv_lt_events  TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.   " structure for event handling
      ls_event-name = u_name.
      ls_event-form = u_form.
      APPEND ls_event TO alv_lt_events.
    ENDFORM.                    " alv_eventtab_build
          FORM TOP_OF_PAGE                                              *
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          i_logo             = 'NEWALTA_LOGO'
          it_list_commentary = gt_list_top_of_page.
    ENDFORM.                    " TOP_OF_PAGE
    You said the count will show along with or below the LOGO on top , but how do I incorporate the line count ihn it?

  • AJAX Report Refresh  a_report- Condition for display not being validated

    Hi ,
    I have a report which has the following condition for dispaly:
    Exists(SQL query returs atleast one row) - SELECT * from temp1The query for the report is : select * from temp1 Now I have a button on the page and on click of the button I call the below Javascript :
    function f_insert_Temp_table(pTrans){
          var l_Return = null;
          var get = new htmldb_Get(null,$x('pFlowId').value,
                  'APPLICATION_PROCESS=temp_table_insert',206);       // ODP to insert into temp1
          get.add('TRANS_ID_ITEM',pTrans);
          gReturn = get.get('');
         //alert(gReturn);
         //$x_Show('6342610690289435');
         $a_report('6342610690289435','1','15','15');
    }Everything executes fine and the report refreshes the rows but the condition used for display doesn't get checked when I call $a_report() ...
    I can see the ODP execute successfully and row gets inserted into temp1 which means report condition is satisfied .
    If I remove the condition for the report, I can see the report getting refreshed and showing new rows through the $a_Report() call.
    Is there something that needs to be added to the script or $a_report call to validate the condition too ?Is there a way I can validate the region condition too ?
    Appreciate any suggestions/pointers here. I really do not want to refresh the whole page.
    Thanks,
    Dippy
    Edited by: Dippy on Feb 5, 2010 11:05 AM

    Hi Flavio,
    Thanks for your support.I figured where I was going completely wrong.
    Its just that when the page loads for the first time the temp table is empty and hence the report is not being displayed which simply
    means that the report id Im passing into the a_report function is not rendered on the page. Hence no matter what the temp table contains the report id is absent from the page.
    I fixed it as follows :
    Remove the condition for the report.
    Added and item and computed(P_Compute) its value using select count(*) from temp.
    Added an onload JS function which does a $x_Show('Report_Region') if P_Compute > 0 or $x_Hide('Report_Region') if P_Compute <0 .
    Now in my JS function which has an AJAX call to an ODP does an $x_Show('Report_Region').
    Flavioc : the query for my report is simple
    select * from tempIt finally dawned upon me that I'm trying to catch hold of an ID that's not rendered.
    So one issue is solved now the other part would be figuring out how to make $a_report work with pagination etc .

  • Inserting rows in ALV

    Hi Experts,
           Which part of the program in BCALV_EDIT04 is responsible for inserting a row in the grid? there is code to handle the data in the inserted line, to check the cells modified using the protocol, and event handler too. Can you please explain which fm or subroutine or step adds a new row to the grid when teh insert button in tool bar is pressed.
    I also want some guidance reg the event handler thing. Is mouse click on the cell makes the methods of the protocol to be called? ( I am a java student.. learning SAP slowly.. can you please help me?)

    methods:
          get_inserted_rows
               exporting
                  inserted_rows type sflight_keys.
    This part of the code is responsible for inserting rows in a grid. We call this method to insert records in the Grid.
    There is no such function module implemented here. We implement the above functionality using <b>Classes and Methods</b>.
    Just go to transaction SE24. You'll have a list of Classes in that transaction. Also, we can implement methods using those classes.
    Regards,
    Pavan.

  • Add and Remove rows

    Hi,
    I have 2 tables, and I needed to add/remove some rows from the first table to the second.
    I've followed the tutorial: Link: [Add and Remove from a List|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/927d8c3c-0a01-0010-57b4-e89f505e2bff] and it works great!
    But the user can add two or more times the same row, so I need to avoid that. The user should be able to add every row only once!!
    I thought about some condition on button Add (for example, disable the ADD button if the same row is present in both tables, but it didnt work).
    Any ideas to achieve that?
    Thanks in advance!
    Best Regards
    Marcelo.

    Hi again Ahmed
    I've solved my problem, but now I'm facing a new issue about the same topic. 
    Following your tips, I've found a solution, but now, I need to copy a complete field of a table to the data store.
    For example, my table has 4 field (country, key, name and city), and I need to copy ALL the key values to the data store. So, if I have 4 rows in the table, let's say "key1", "key2", "key3", "key4"
    I've reached a solution, but it involves to walk throught the entire table, selecting every row automatically (I use a spinner) and "copying" every key field of every row to the data store. When I say "copying" I mean adding it to the same virtual field of the data store, that is to say, concatenating the key values one after another.
    The problem arises when the table has more than 100 records, because 100 is the top value that a spinner can reach.
    Any ideas about can bypass that limit?
    Thanks in advance, your help is really appreciated.
    Best regards
    Marcelo

  • Inserting rows

    hello every body
    if u can explain
    there is a form consists of
    1-(dept table) from scott schema
    2-text_item in a control block
    3-push_button in a control block
    4- when button pressed trigger on the push button
    --- what i want is when i write a value in the text_item then click the button
    i want the value be inserted in the (dept) block and i want it to be inserted in the record after the last record in the table
    and that did not happen when i tried that and i do not know why
    ---- what i did was
    the problem was
    when i click the button it really inserts the value in the table but it is not show unless i execute query a again
    and i do not want that i want when i click the button i see the value in front of me in the table
    --- the second problem is
    it does not insert the value in the last record but it inserts it in the first record .
    ---- the third is
    sure u know that any changes do not really inserted in the table in the database unless u click the (save) button
    --- what happens is when i click the (save) button , a mesage appears says that (no changes to save)
    but however it really save the data in the table in the schema although this message (no changes to save)
    please attend
    thanks everyone

    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>Announcement: Forums Etiquette / Reward Points
    </ul>
    It is always a good idea to list your Forms version as the solution could be different. Also, as your question seems to be a coding related issue, it would be helpful for you to show the code you wrote in your When-Button-Pressed trigger.
    I want the value be ins erted in the (dept) block and i want it to be inser ted in the record after the last record in the table Keep in mind, that where you i nsert a record is not exactly how Oracle will retrieve it. If you want your data ordered a certain way you should specify a sort order.
    when i click the button it really inse rts the value in the table but it is not show unless i execute query a again and i do not want that i want when i click the button i see the value in front of me in the table >
    If you add a record to your table through code using a DML statement, then the only way to display that record in your form is to requery the data block. Preferrably, you should just navigate to the last record of the block, add a new row and add your value to the Forms block. Oracle Forms is tightly intergrated with the database so any record you add, change or remove, the DML will automatically be handled by Oracle Forms. Consequently, you could have written code similar to the following to accomplish your task:
    /* Sample When-Button-Pressed */
    BEGIN
       /* assumes your block is named after your table */
       Go_Block('DEPT'); 
       Last_Record;
       Next_Record;
       :DEPT.DEPT_ID := :CONTROL.DEPT_ID
       ... Any other DEPT block assignments listed here
    END;The above sample code does not perform an explicit save so no changes have been sent to the database yet. If you try to exit your form, Forms will prompt you to Save your changes.
    --- the second problem is it does not inse rt the value in the last record but it inse rts it in the first record .>
    See my comment above about adding a sort order. If you want your records displayed in a specific order, then you should put an Order By clause on your block.
    ---- the third is sure u know that any changes do not really inser ted in the table in the database unless u click the (save) button
    --- what happens is when i click the (save) button , a mesage appears says that (no changes to save) >
    Do you have a C OMMIT or C OMMIT_FORM in your When-Button-Pressed trigger? If so, then you have already saved the changes to the table so when you click the Save button, this is a correct message.
    I get the impression that you are either in a class learning Oracle Forms or you are attempting to learn Oracle Forms on your own. I strongly suggest you purchase a book on developing with Oracle Forms. There are serveral good books out there, although most of them are for older versions of Oracle Forms, but they are still valuable because they will teach you the theory of developing with Oracle Forms. One of the better books is Developing Oracle Forms Applications by Albert Lulushi.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • Can I use Report Manager to distribute customized oracle reports?

    Hi, Can I use Report Manager to distribute customized oracle reports, other than FSG reports? If no, is there any function that can be used for distributing reports submitted from concurrent manager in r12.1.2? Thanks for any advice! HY

  • Questions on stores in iProcurement

    All, I have a couple of questions on setting up stores in iProcurement - 1. Oracle comes seeded with 2 stores of "Main Store" and "Exchange.Oracle.com". We do not have use for these stores. I do not see an option to disable them. Is it advisable to d

  • Recording audio from an external dj set up

    I have an old G4 desktop which has a 24 bit soundcard installed so I was able to plug in RCA jacks straight from the PCI soundcard to an external dj set up and record to my hard drive. I now have A G4 Powerbook -15" and I need to know how I can recor

  • Payment Method customer

    Hello together, how I can fix a Payment Method to a customer no.? We have some different Payment Method and we would fixed this, on the sales are data. Thanks for your help. Best regards Petra Schober

  • Trying to create detail in SOAPFaultException

    Hi I'm trying to generate the detail section for a SOAPFaultException (code snippet below) This compiles fine but when it runs I get the following exception try to access class javax.xml.soap.FactoryFinder from class javax.xml.soap.SOAPFactory // cod