Selecting certain records using checkbox

Hi,
I have created 2 interactive reports, with the underlying tables linked by an ID number.
Using the APEX advanced tutorials, I have created a checkbox for each row in Report 1 and I want the checked rows to be displayed in Report 2, once I press the 'View Selected Records' button in Report 1.
This is the code given in the tutorial for the process:
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
DELETE FROM oehr_product_information
WHERE product_id = APEX_APPLICATION.G_F01(i);
END LOOP;
How would I edit this to suit my requirement?
Thanks.

Hi
You mean like this ?
http://apex.oracle.com/pls/otn/f?p=40323:46
First report is just
SELECT APEX_ITEM.CHECKBOX(1,empno) chk,
a.*
FROM emp aIn that page 46 I have after submit process
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'P46COL');
FOR i IN 1 .. APEX_APPLICATION.G_F01.Count
LOOP
  APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'P46COL',
    p_c001          => APEX_APPLICATION.G_F01(i)
END LOOP;And branch that go to page 47 where is another report that show selected values.
Page 47 report query is
SELECT *
FROM emp
WHERE EXISTS(
SELECT 1
FROM apex_collections
WHERE collection_name = 'P46COL'
AND c001 = empno)Br,Jari

Similar Messages

  • How to read data after select multiple record by checkbox,

    hi experts
    i  m using simple report with check box , and itab whcih contain records
    how to read data after select multiple record by checkbox,
    thanks

    Hi Prashant,
       Try using this logic.This Code displays the list with check boxes. When you check a checkbox and press a button say 'Select All' or 'De Select all' or 'Display'. It will read the data of those records.
    DATA :
      fs_flight TYPE type_s_flight,
      fs_flight1 TYPE type_s_flight1.
    * Internal tables to hold Flight  Details                             *
    DATA :
      t_flight LIKE
      STANDARD TABLE
            OF fs_flight,
      t_flight1 LIKE
       STANDARD TABLE
             OF fs_flight1.
    SET PF-STATUS 'SELECT' .
    PERFORM selection.
    PERFORM displaybasic .
    *                      AT USER COMMAND EVENT                          *
    AT USER-COMMAND.
      PERFORM selectall .
    *&      Form  SELECTION
    *      Select query to reteive data from SPFLI table
    *  There are no interface parameters to be passed to this subroutine.
    FORM selection .
      SELECT  carrid                       " Airline Code
              connid                       " Flight Connection Number                  
        FROM  spfli
        INTO TABLE t_flight.
      DESCRIBE TABLE t_flight LINES w_lines .
    ENDFORM.                               " SELECTION
    *&      Form  DISPLAYBASIC
    *      Display the basic list with SPFLI data
    *  There are no interface parameters to be passed to this subroutine.
    FORM displaybasic .
      LOOP AT t_flight INTO fs_flight.
        WRITE :
             w_check AS CHECKBOX,
             w_mark,
             fs_flight-carrid UNDER text-001,
             fs_flight-connid UNDER text-002.
      ENDLOOP.                             " LOOP AT T_FLIGHT..
      CLEAR fs_flight-carrid .
      CLEAR fs_flight-connid.
    ENDFORM.                               " DISPLAYBASIC
    *&      Form  SELECTALL
    *      To check all the checkboxes with a 'selectall' push button
    *  There are no interface parameters to be passed to this subroutine.
    FORM selectall .
      CASE sy-ucomm.
        WHEN 'SELECT_ALL'.
          w_check = 'X'.
          w_line = 4 .
          DO w_lines TIMES.
            READ LINE w_line .
            MODIFY LINE w_line FIELD VALUE w_check .
            ADD 1 TO w_line .
          ENDDO.                           " DO W_LINES TIMES
          CLEAR w_line.
        WHEN 'DESELECTAL'.
          w_check = space.
          w_line = 4 .
          DO w_lines TIMES.
            READ LINE w_line FIELD VALUE w_mark .
            IF w_mark = space .
              MODIFY LINE w_line FIELD VALUE w_check .
            ENDIF.                         " IF W_MARK = SPACE
            ADD 1 TO w_line .
          ENDDO.                           " DO W_LINES TIMES
        WHEN 'DISPLAY'.
    IF sy-lilli BETWEEN 4 AND w_lines .
        DO w_lines TIMES.
          READ LINE w_num FIELD VALUE w_check INTO w_check
                                     fs_flight-carrid INTO fs_flight-carrid
                                     fs_flight-connid INTO fs_flight-connid.
          IF sy-subrc = 0.
            IF w_check = 'X'
              SELECT  carrid
                      connid
                      fldate               " Flight date
                      seatsmax             " Maximum capacity in economy
                      seatsocc             " Occupied seats in economy class
                FROM  sflight
                INTO  TABLE t_flight1
               WHERE  carrid = fs_flight-carrid
                 AND  connid = fs_flight-connid.
              LOOP AT t_flight1 INTO fs_flight1.
                WRITE :
                  / fs_flight-carrid UNDER text-001,
                    fs_flight-connid UNDER text-002,
                    fs_flight1-fldate UNDER text-007,
                    fs_flight1-seatsmax UNDER text-008,
                    fs_flight1-seatsocc UNDER text-009.
              ENDLOOP.
            ENDIF.                         " IF SY-SUBRC = 0
          ENDIF.                           " IF W_CHECK = 'X'.
          ADD 1 TO w_num.
        ENDDO.                             " DO W_LINES TIMES
        CLEAR w_check.
        w_num = 0.
      ELSE .
        MESSAGE 'INVALID CURSOR POSITION ' TYPE 'E' .
      ENDIF.                               " IF SY-LILLI BETWEEN..
    ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " SELECTALL
    Much Regards,
    Amuktha.

  • Update multiple records using checkbox

    Hi All,
    I have one requirement related to multiple record update using checkbox.
    HTML form has 6 columns and many rows.
    Now i want to update all 6 columns in the table for selected checkbox.
    Can any body give me some idea/code about this.
    Thanks in advance.
    Ravi

    I did not understand your idea.
    multiple columns can be updated as follows...
    update table set col1=value,col2=value,col3=value where conditions;
    We are using adodb driver in our environment. So I will explain concern to it. Store all the form new values in $var array and you can pass this $var to query execution.
    A vague idea
    $rs = $conn->Execute($update_sql,$var);     
    if ($rs===false) die('DB Error: '. $conn->ErrorMsg() );

  • Switched from Samsung Note 2 to iphone 6. Faced Difficulties while sending message. [1]Multiple Selection of receipients is not available. Eg. If I click plus, it shows me all the contacts but i cannot select multiple contacts using checkbox

    Phone : IPhone 6
    OS : 8.1
    Problem Statement : Multiple Selection of Recipients while drafting New Message in SMS.
    Expected Solution : Checkbox should have been provided to select multiple contacts using one screen

    Thanks for the reply.. I also tried that way.. I face couple of issues
    1) I could not find an option of saving a Draft Message
    2) After multiple recipients(I have selected 12 recipients) in "TO" section, if I type a word in "TO" such as "Pre", it shows me all the contacts containing "Pre"  but I cannot select the last contact incase there are more than 20 contacts coz I am unable to scroll down till the end.. If I do so.. I cannot select coz screen scrolls up automatically..
    Pls try ... If required I will insert video

  • How do I select more records using data blocks, set_block_property

    Hi, I am new in oracle forms builder. I want to fetch more then one records using set_block_property and data block. please help me. How do I select more then one data? I don't have any Idea about Oracle
    Please Help its urgent

    What is your Forms version?  Is your form in "Form" (single record) or "Tabular" (multi-record) layout?  You can't use the SET_BLOCK_PROPERTY() built-in to change the number of records that are displayed - this must be done during design through the Forms Builder.
    What exactly are you needing to do?
    Craig...

  • Select duplicated records using SE16 ?

    Is it possible to discover the duplicated records using SE16?
    Thanks!

    Yes it is!
    You display the whole table (all lines and all fields), than you compare it line by line. Some sorting might be useful
    On the other hand if there is at least one key field in the table (which is always the case), there should not be much duplicate entries...

  • How to Filter Report by selecting displayable columns using checkboxes

    Hello, I have a page where the first region 'filter' is to check which columns you want to have displayed in a report. the second region 'report' is the report itself where i want to display only the columns checked from regions 1 'filter'.
    We can make the assumption that there are two checkboxes for simplicity: Part and Part Description. I have created a single item on region 1: filter that is of a checkbox item. the lov is select 'Part' d, 1 from dual union all select 'Part Description' d, 2 from dual
    i have also created a page process to run that creates and adds members to a collection.
    My report then queries the collection table for the columns but nothing is being displayed.
    This is the collection process: (conditional on a submit button)
    begin
    apex_collection.create_or_truncate_collection
    (p_collection_name => 'CHECKBOXES');
    for i in 1..apex_application.g_f01.count
    loop
    apex_collection.add_member(
    p_collection_name => 'CHECKBOXES',
    p_c001 => apex_application.g_f01(i),
    p_c002 => apex_application.g_f02(i));
    end loop;
    END;
    The report is the following:
    SELECT c001, c002, seq_id FROM apex_collections
    WHERE collection_name = 'CHECKBOXES' ORDER BY seq_id
    I have a submit button that then redirects to the same page.
    when the submit is submitted, the report comes back with 'no data found'. Any help is greatly appreciated.

    I should also add...I am using the sql in the report just to display the collection to make sure it is working properly. Once validated, then my sql report will be rewritten to dynamically build the report off of other tables, but it uses the collection to determine which columns to display.
    Thanks Jim

  • Multiple Row selection in JSP using checkbox - Oracle BPM 10gR3

    Dear BPM Experts,
    Has anyone invoked JSP from Oracle BPM 10gR3 screen flow that has the following UI requirement.
    1. When UI is loaded user is presented with multiple rows of pre-populated data(each column of the row represents attributes of a BPM object) with checkbox against each of the rows for user to select one, many and all rows.
    2. User has option to select one, many and all rows and submit the form.
    3. Upon submission, the all data related to selected rows only should made available to a BPM process(either using Global Creation or Global Interactive activity)
    I was able to have the JSP created with FTL tags but unable to transmit the data back to BPM process. Same has been accomplished using BPM Presentation. Can any one please help me with the JSP implementation? It is little urgent, so your early intervention is much solicited and coveted.
    I will send you guys the code I have in case you need to review.
    Regards,
    Subho

    Hi friends
    I need to do the same feature, select elements, but in a tree object. I've followed the same approach - using a selectBooleanCheckBox in each node of the Tree. But, when I submit the page, the boolean property of my TreeNode object isnt changed.
    An Idea?
    thanks a lot!

  • Partial Selection in Jtree using checkbox for every node

    I have a application which uses a JTree. For each node in the tree, there is a checkbox attached to the node using a customized TreeCellRenderer. When some items of a node are selected i.e not all children of a node are selected using the chechboxes, how do i indicate using the checkbox of the parent node that only a partial list of nodes is selected. For this, i need to draw a little square in the checkbox indicating that it is partially selected. Any advice on this matter would be very helpful.

    It's a bit complicated. The default cell renderer doesn't actually put the tree nodes on your screen, it just paints the looks of them. That is, you see them on screen, but they are just painted, all mouse clicks etc. are sent directly to the JTree.
    In order to have a button in a tree node, and have that button respond to clicks, I believe you'd have to put the button in a TreeCellEditor. This means users will have to triple click the node to get the Editor in the renderer's place (db click only expands/implodes nodes).
    I have sucessfully used http://propertytree.dev.java.net/ to customize the behaviour of tree nodes, but I never have put a button in there... Have a look, you'll see what methods you need to overwrite.

  • How to Delete Multiple Records using selectbox in jsf

    Hi!
    My Senario is I want to delete multiple records using checkbox. After selecting multiple records when i click the delete button the selected
    rows shuld be deleted.if am doing like this but the edit ,delete for each row functionality is not working.
    <h:selectBooleanCheckbox id ="bcb" value="#{item.empno}">
    </h:selectBooleanCheckbox>
    But other functionality is not wokring.
    Can any one plz tell how to select the multiple records and how to send the id to the serverside.
    I want code code for jsp and as well as backingBean how to accaess .
    Any Reply shuld be apreciated

    You may find this article useful as well: http://balusc.blogspot.com/2006/06/using-datatables.html
    Check the chapter "Select multiple rows" for two generic ways to select multiple rows in a datatable.

  • Reading the record and displaying when u select it using checkbox

    hi,
           how to read the particilar record and display it in a popup screen when u select it using checkbox and then press 'DISP' button in alv(normal alv not with oops concepts).
    like i select a row which is checked (checkbox) it and i have to read that particular record and display (value of keyfield say vbeln) details in a popup screen.

    hi,
    go through the faloowing code.
    this for normal popup.
    *& Report  ZGS_ALV_POPUP_2_SELECT
    REPORT  ZGS_ALV_POPUP_2_SELECT.
    TYPE-POOLS: slis.
    PARAMETERS: p_title TYPE sy-title default 'Sales Document:item data'.
    DATA: itab TYPE vbap OCCURS 0 WITH HEADER LINE,
          selfield TYPE slis_selfield.
    START-OF-SELECTION.
      SELECT *
        FROM vbap
        INTO TABLE itab
        UP TO 20 ROWS.
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
           EXPORTING
                i_title                 = p_title
    *           I_SELECTION             = 'X'
               I_ZEBRA                 = 'X '
    *           I_SCREEN_START_COLUMN   = 0
    *           I_SCREEN_START_LINE     = 0
    *           I_SCREEN_END_COLUMN     = 0
    *           I_SCREEN_END_LINE       = 0
    *           I_CHECKBOX_FIELDNAME    =
    *           I_LINEMARK_FIELDNAME    =
    *           I_SCROLL_TO_SEL_LINE    = 'X'
                i_tabname               = 'ITAB'
                i_structure_name        = 'VBAP'
    *           IT_FIELDCAT             =
    *           IT_EXCLUDING            =
    *           I_CALLBACK_PROGRAM      =
    *           I_CALLBACK_USER_COMMAND =
    *            is_private              =
         IMPORTING
                es_selfield             = selfield
    *            e_exit                  =
           TABLES
                t_outtab                = itab
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE i000(8I) WITH sy-subrc.
      ENDIF.
      WRITE:
             /  'Table Index : ', 20 selfield-tabindex,
            /  'Table Name  : ', 15 selfield-tabname,
            /  'Field Name  : ', 15 selfield-fieldname,
            /  'Table-Field : ', 15 selfield-sel_tab_field,
            /  'Field Value : ', 15 selfield-value.
    the falowing code is for how to put checkbox and how to display the selected recods.you combine both codes.
    *& Report  ZRP_SALES
    REPORT  ZRP_SALES NO STANDARD PAGE HEADING.
    DATA: TEMP_DATE_STR TYPE STRING.
    *DATA: TEMP_NETP LIKE VBAK-NETWR.
    DATA: TEMP_NETWR(10).
    *DATA: TEMP_VBELN LIKE VBAK-VBELN.
    DATA: CHECK TYPE C VALUE ' '.
    *DATA: WA_VBELN LIKE VBAK-VBELN.
    DATA: TEMP_DATE LIKE VBAK-ERDAT.
    *DATA: TEMP_NETP_STR TYPE STRING.
    DATA:FNAM(20), FVAL(20).
    TYPES: BEGIN OF MY_VBAK,
           VTWEG TYPE VTWEG,
           VKORG TYPE VKORG,
           SPART TYPE SPART,
           NETWR TYPE NETWR_AK,
           VBELN TYPE VBELN_VA,
           ERDAT TYPE ERDAT,
           END OF MY_VBAK.
    DATA: IT_VBAK TYPE MY_VBAK OCCURS 0 WITH HEADER LINE.
    DATA: WA_VBAK TYPE MY_VBAK.
    DATA: V_VBELN TYPE VBELN,
          V_ERDAT TYPE ERDAT.
    SELECT-OPTIONS:S_VBELN FOR V_VBELN,
                   S_ERDAT FOR V_ERDAT.
    AT SELECTION-SCREEN.
    *Check for Sales Order number to be non-initial.
      IF  S_VBELN IS INITIAL.
    *Checking for Date to be non-nitial.
        IF  S_ERDAT IS INITIAL.
          MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
        ELSE.
    *Validating the right low values for Date select option
          SELECT SINGLE ERDAT
                 FROM VBAK INTO TEMP_DATE
                 WHERE VBELN EQ S_VBELN-LOW OR ERDAT EQ S_ERDAT-LOW.
          IF SY-SUBRC NE 0.
            MESSAGE E004(ZRP_MSG).
          ENDIF.
    *Validating the right high values for Date select option
          SELECT SINGLE ERDAT
                  FROM VBAK INTO TEMP_DATE
                  WHERE ERDAT EQ S_ERDAT-HIGH OR VBELN EQ S_VBELN-HIGH.
          IF SY-SUBRC NE 0.
            MESSAGE E005(ZRP_MSG).
          ENDIF.
        ENDIF.
      ELSE.
    *Checking for Date to be non-nitial.
        IF  S_ERDAT IS NOT INITIAL.
          MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
        ENDIF.
    *Validating the right low values
        SELECT SINGLE VBELN
               FROM VBAK INTO S_VBELN
               WHERE VBELN EQ S_VBELN-LOW.
        IF SY-SUBRC NE 0.
          MESSAGE E001(ZRP_MSG).
        ENDIF.
    *Validating the right high values
        IF S_VBELN-HIGH IS NOT INITIAL.
          SELECT SINGLE VBELN
                  FROM VBAK INTO S_VBELN
                  WHERE VBELN EQ S_VBELN-HIGH.
          IF SY-SUBRC NE 0.
            MESSAGE E002(ZRP_MSG).
          ENDIF.
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
    *First Screen.
      SET PF-STATUS 'DISP'.
      IF S_VBELN IS NOT INITIAL.
        SELECT   VTWEG VKORG SPART NETWR VBELN ERDAT
               FROM VBAK
               INTO TABLE IT_VBAK
               WHERE VBELN IN S_VBELN.
      ENDIF.
      IF S_ERDAT IS NOT INITIAL.
        SELECT  VTWEG VKORG SPART NETWR VBELN ERDAT
               FROM VBAK
               INTO TABLE IT_VBAK
               WHERE ERDAT IN S_ERDAT.
      ENDIF.
      SORT IT_VBAK BY VKORG VTWEG SPART.
    END-OF-SELECTION.
      LOOP AT IT_VBAK.
        MOVE IT_VBAK-NETWR TO TEMP_NETWR.
        MOVE IT_VBAK-ERDAT TO TEMP_DATE.
        WRITE:/6 CHECK AS CHECKBOX.
        FORMAT COLOR 1.
        WRITE: IT_VBAK-VBELN UNDER 'SALES ORDER NO.' .
        WRITE: IT_VBAK-ERDAT UNDER 'DATE'.
        FORMAT COLOR OFF.
        FORMAT COLOR 2.
        WRITE: TEMP_NETWR UNDER 'NET PRICE'.
        FORMAT COLOR OFF."TEMP_NETWR,
        FORMAT COLOR 3.
        WRITE:IT_VBAK-VKORG UNDER 'SALES ORG',
              IT_VBAK-VTWEG UNDER 'DIST CHANNEL',
              IT_VBAK-SPART UNDER 'DIVISION'.
        FORMAT COLOR OFF.
        SKIP 1.
    *FOR SUBTOTALS
        AT END OF SPART.
          SUM.
          FORMAT COLOR 5.
          WRITE:/6 'SUB TOTOAL OF NET PRICE IS :  '.
          WRITE: 32 IT_VBAK-NETWR CURRENCY 'INR'.
          FORMAT COLOR OFF.
          SKIP 2.
        ENDAT.
    *FOR GRAND TOTALS
        AT LAST.
          SUM.
          FORMAT COLOR 6.
          WRITE:/6 'GRAND TOTOAL OF NET PRICE IS :  ',
          32 IT_VBAK-NETWR CURRENCY 'INR'.
          FORMAT COLOR 6.
        ENDAT.
      ENDLOOP.
    TOP-OF-PAGE.
      FORMAT COLOR  6.
      WRITE:/8    'SALES ORDER NO.',
           27   'DATE',
           42   'NET PRICE',
           57   'SALES ORG',
           70   'DIST CHANNEL',
           87   'DIVISION'.
      FORMAT COLOR OFF.
      SKIP 1.
    *WHEN SALES ORDER IS SELECTED
    AT LINE-SELECTION.
      CASE :SY-LSIND.
        WHEN '2'.
          GET CURSOR FIELD FNAM VALUE FVAL.
          IF FNAM <> 'WA_VBAK-VBELN'.
            MESSAGE E006(ZRP_MSG).
          ELSE.
            SET PARAMETER ID 'MAT' FIELD FVAL.
            CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
      ENDIF.
        ENDCASE.
    *WHEN CLICKED ON PUSH BUTTON IN THE APPLICATION BAR
    AT USER-COMMAND.
      CASE:SY-UCOMM.
        WHEN 'DISP'.
          DO.
            CLEAR CHECK.
            CLEAR: WA_VBAK,TEMP_DATE_STR.
            READ LINE SY-INDEX FIELD VALUE CHECK
               IT_VBAK-VTWEG INTO WA_VBAK-VTWEG
    *           IT_VBAK-NETWR INTO TEMP_NETP_STR
               IT_VBAK-VBELN INTO WA_VBAK-VBELN
               IT_VBAK-ERDAT INTO TEMP_DATE_STR
               IT_VBAK-VKORG INTO WA_VBAK-VKORG
               IT_VBAK-SPART INTO WA_VBAK-SPART.
            IF SY-SUBRC <> 0.
              EXIT.
            ELSEIF CHECK = 'X'.
              FORMAT COLOR 1.
              WRITE: 8 WA_VBAK-VBELN HOTSPOT. "UNDER 'SALES ORDER NO'
              WRITE: 25 TEMP_DATE_STR." UNDER 'DATE'.
              FORMAT COLOR OFF.
    *       FORMAT COLOR 2.
    *                   WRITE: 44 TEMP_NETP_STR." UNDER 'NET PRICE'.
    *       FORMAT COLOR OFF.
              FORMAT COLOR 3.
              WRITE:44 WA_VBAK-VKORG," UNDER 'SALES ORG',
             59 WA_VBAK-VTWEG," UNDER 'DIST CHANNEL',
             72  WA_VBAK-SPART." UNDER 'DIVISION'.
              FORMAT COLOR OFF.
              SKIP 1.
            ENDIF.
          ENDDO.
      ENDCASE.
    TOP-OF-PAGE DURING LINE-SELECTION.
      CASE:SY-LSIND.
        WHEN 1.
          FORMAT COLOR  6.
          WRITE:/8    'SALES ORDER NO.',
                 25   'DATE',
    *       44   'NET PRICE',
                 44   'SALES ORG',
                 58   'DIST CHANNEL',
                 72   'DIVISION'.
          SKIP 1.
          FORMAT COLOR  OFF.
    <b>if helpful reward some points.</b>
    Message was edited by:
            suredarreddy pulimamidi

  • Please Help! Deleting multiple record by using checkbox selected

    Hello everybody,
    I am a new to JSP. I really don't know how to delete multiple record by using checkbox selected and pressing submit button.
    For example, deleting webmailbox letters using checkbox selected and delete button. The mail we checked will delete from the inbox.
    I like to use my user account deleting system of my project like above example.
    How can I do in JSP? I will very please you if you share you knowledge and code for me.
    If you have URL address, could you share me for reference?
    Please help me...
    With Thanks and Regards,
    wtdahl

    Take a look at this thread, I thing it answers your question quite good:
    http://forum.java.sun.com/thread.jsp?thread=516658&forum=45&message=2463505

  • How to update multiple records in custom table using checkbox in APEX 4.1?

    Hi,
    I have a SQL report which brings up all the data records using the following query.
    select
    "REC_NO" AS hidden_rec_no,
    "REC_NO",
    APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
    "MEETING_TYPE",
    "PAGE_NO",
    "CHECKBOX"
    from "XX_TEST" m
    WHERE page_no = :p_page_no
    Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
    DECLARE.
    l_row NUMBER := 1;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
    LOOP
    FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
    LOOP
    IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
    UPDATE xx_test
    SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
    WHERE rec_no = APEX_APPLICATION.G_F03(i);
    l_row := j + 1;
    EXIT;
    END IF;
    END LOOP;
    END LOOP;
    COMMIT;
    END;
    However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
    Regards.

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

  • ADF multiple row selection using checkbox

    One of the basic feature missing in ADF 11g is multiple row selection using checkbox (ADF supports multiple row selection by CTRL+CLICK) and business users doesn't like the idea of CTRL+CLICK especially when the volume of click is more. Our requirement is to show the records as selected, on click of checkbox. We implemented multiple row selection by giving a checkbox and on submission, iterate all the rows and filter only selected rows for further processing. The approach works fine,but it is very slow when the volume of data is more, say 10 thousand rows. For 4 thousand records, iterating everything takes more than 200 secs !
    Had the multiple row selection been the ADF standard way using CTRL+CLICK, and retrieving the selected rows using method theTable.getSelectedRowKeys() works much faster (completes in millisecs for 4 thousand records). Somehow ADF fetches the selected records much faster this way. Our requirement is on click of the checkbox, the ADF should select the records ( the same way it is doing CTRL+CLICK) and all such selected rows should be retrievable using the ADF method theTable.getSelectedRowKeys()
    Is there any way it can be done?
    Regards,
    Antony.

    Hi All,
    We have implemented the select and select all using check-box and it is working fine. Issue here is the performance is too slow
    Assume SelectValue is the VO coulmn for the checkbox to select the values. To filter out the selected rows, we use the following line
    Row[] pidRows = pidView.getFilteredRows("SelectValue", Boolean.TRUE);
    it is very taking more than 2 minutes if the total number of rows are *4 thousands* and only if 2 rows are selected.
    Whereas with the CTRL+CLICK standard approach, ADF has a built in API theTable.getSelectedRowKeys(); to get only the selected rows, and the built in API takes only few milliseconds to get the selected rows. Users are not agreeing to the CTRL+CLICK approach as it is not user friendly. Suggest if there is a way to make the select box to make it work the same way as CTRL+CLICK.
    code snippet to do the standard way :
    RowKeySet sk = theTable.getSelectedRowKeys();
    _logger.info("row count of select "+sk.getSize());;+
    Iterator selection =sk.iterator();
    EmpVORowImpl empRow = null;
    +while (selection.hasNext()) {+
    Object rowKey = selection.next();
    theTable.setRowKey(rowKey);
    rowdata = (JUCtrlHierNodeBinding)theTable.getRowData();
    empRow  = (EmpVORowImpl)rowdata.getRow();
    _logger.info("Emp # "+empRow.getEmpno() +" Emp Name : "+empRow.getEname() +" Is selected ? "+empRow.getisChecked());+
    +}+

Maybe you are looking for