Report with checkboxes

Hi all,
I have a report with checkboxes getting the empno in return
I have
select apex_item.checkbox(1, empno) cbox,a.empno, a.ename,a.mgr,a.deptno from emp a
in the report....
I do have a dummy hidden field(P2_EMPNOS) which stores the empno's into it with comma concatenated(for which i wrote a page process)
DECLARE
vRow BINARY_INTEGER;
BEGIN
:P2_EMPNOS := NULL;
:P2_EMPNOS :=apex_application.g_f01(1);
FOR i IN 2 .. apex_application.g_f01.COUNT
LOOP
:P2_EMPNUMS :=
:P2_EMPNOS
|| ','
|| apex_application.g_f01(i);
END LOOP;
END;
in my next page I want the records that I have selected like this
select a.empno, a.ename,a.mgr,a.deptno
from emp a
where empno in :P2_EMPNOS
I did tried (:P2_EMPNOS),':P2_EMPNOS'
The problem is if I select one checkbox, then in the next page I'm getting that one record....
but If I select multiple, then starts trouble...it says "no data found"...but still the values can be viewed in the next page with comma separated
Can some body help me in this please.
Thanks in advance.
Gora

Hello Varad,
Thankyou for the quick response.
The problem here is....my item is getting the selected values as a string(i guess ;) )
i think we have to figure out how we could break it and send those as single values.
Any more guesses please...
Regards,
Gora

Similar Messages

  • Report with Checkbox

    I am trying to follow the example shown at the below link but it is not working. I am modifying some of the code since I am using version 1.6. Any ideas as to what I may be doing wrong. The checkbox appears and I can select and deselect items but I cannot get P6_HOLDER to hold any of the values of the selected items. Thanks!
    http://apex-smb.blogspot.com/2009/01/apex-report-with-checkboxes-advanced.html
    First I created a page item called P6_HOLDER.
    Next I created a report region (sequence 40) with the below code.
    select htmldb_item.checkbox (1, dev_obj_id, 'onchange="spCheckChange(this);"',
    :P6_HOLDER, ':') checkbox, dev_id, dev_obj_desc from edm_dev_obj where
    dev_id = :P6_TEMP_DEV_ID
    **I then created a html region (sequence 1) with the below code**
    <SCRIPT src="http://www.google.com/jsapi"></SCRIPT>
    <SCRIPT>
    // Load jQuery
    google.load("jquery", "1.2.6", {uncompressed:true});
    function spCheckChange(pThis){
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CHECKBOX_CHANGE',$v('pFlowStepId'));
    get.addParam('f01',pThis.value); //Value that was checked
    get.addParam('f02',pThis.checked ? 'Y':'N'); // Checked Flag
    gReturn = get.get();
    $f('checkListDisp').innerHTML=gReturn;
    </SCRIPT>
    CHECKBOX List:
    <DIV id=checkListDisp>&P6_HOLDER.</DIV>
    I then created an application process on Demand called CHECKBOX_CHANGE with the below code
    DECLARE
    v_item_val NUMBER := htmldb_application.g_f01;
    v_checked_flag VARCHAR2 (1) := htmldb_application.g_f02;
    BEGIN
    IF v_checked_flag = 'Y' THEN
    -- Add to the list
    IF :P6_HOLDER IS NULL THEN
    :P6_HOLDER := ':' || v_item_val || ':';
    ELSE
    :P6_HOLDER := :P6_HOLDER || v_item_val || ':';
    END IF;
    ELSE
    -- Remove from the list
    :P6_HOLDER := REPLACE (:P6_HOLDER, ':' || v_item_val || ':', ':');
    END IF;
    -- Just for testing
    HTP.p (:P6_HOLDER);
    END;

    Hi
    Create a page level validation (fucntion returning boolean) and write code similar to following
    DECLARE
    v_count NUMBER := 0;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
    v_count := v_count + 1;
    END IF;
    END LOOP;
    IF v_count = 0 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END;I take it your report query is similar to following
    select apex_item.checkbox(1,"PK_CLMN") Tick, col2, col3 FROM tbl_nameCheers,
    Hari

  • Issues with report with checkbox

    Hi friends,
    i have created a report with checkbox.
    the query is
    > select apex_item.checkbox(1,person_id,'unchecked') "select",
    person_id,
    AVAIL_SAL_CERTIFICATE,
    OCCURANCE,
    LAST_AVAILED_DATE,
    REASON,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE
    from YY_SALARY_CERTIFICATEnow am having one button in my report region. suppose if i checked the particular row in report and clicked that button it should redirect to next page which is a form page it contains all the fields what report page had and it should display the value of corresponding report row which i checked.
    how i can achevie this?
    pls someone help me...

    <li>On Submit PLSQL
    DECLARE
      lc_colln_name VARCHAr2(100) := 'MY_COLLN';
    BEGIN
      APEX_COLLECTION.CREATE_COLLECTION(lc_colln_name);
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT --use the checkboxes array index used in query
    LOOP
       --Add each checked record id to collection
       APEX_COLLECTION.ADD_MEMBER
                p_collection_name => lc_colln_name
               ,p_c001 => APEX_APPLICATION.G_F01(i)  --Now c001 column of collection has this id
    END LOOP;
    END;<li>SQL Query of report in Page 2
    select person_id,
    AVAIL_SAL_CERTIFICATE,
    OCCURANCE,
    LAST_AVAILED_DATE,
    REASON,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE
    from YY_SALARY_CERTIFICATE
             ,apex_collections AC
    where AC.collection_name = 'MY_COLLN' --use the name of the collection created previously
    AND    person_id = AC.c001

  • Creating TREE REPORT with CHECKBOX against each row

    Hi Friends,
    I need to create a <b>TREE REPORT with  CHECK BOX</b> against each row. when the user selects a row and clicks on a custom button then those should get populated into an internal table. <b>This is HIGH priority</b> one and I have tried my best but couldnt find any solution. Please advise me some sol.
    thanks in advance for your valuable time and help.
    Regards
    srithan
    Message edited by me for easyness
            Reddy

    Hi
    Following code is to add checkboxes in ALV tree:
    FORM add_root_request USING pls_data_ TYPE csg_gs_outtab_p_key__l_is_sub_node_ TYPE c
    CHANGING pl_carrid_key._node = nodes->add_node( related_node = p_key
    relationship = cl_gui_column_tree=>relat_last_child ).
    ... §0.2 if information should be displayed at
    the hierarchy column set the carrid as text for this node
    text = p_ls_data-object.
    node->set_text( text ).
    ... §0.3 set the data for the nes node
    node->set_data_row( p_ls_data ).
    item = node->get_hierarchy_item( ).
    item = node->get_item( 'FCHECKBOX' ). "FCHECKBOX is my radio button field in internal table which I am using to populate the ALV
    item->set_type( if_salv_c_item_type=>checkbox ).
    pl_carrid_key = node->get_key( )._
    CATCH cx_salv_msg.
    ENDFORM_._Following code is for handling checbox_change event
    PERFORM application_action_events.
    FORM application_action_events .
    data: lr_events type ref to cl_salv_events_tree.
    *data gr_events type ref to lcl_handle_events.
    lr_events = gr_tree->get_event( ).
    create object gr_events.
    set handler gr_events->check for lr_events.
    set handler gr_events->on_link_click for lr_events.
    set handler gr_events->on_before_user_command for lr_events.
    set handler gr_events->on_after_user_command for lr_events.
    set handler gr_events->on_keypress for lr_events.
    endform. " application_action_events----
    CLASS lcl_handle_events DEFINITION.
    PUBLIC SECTION.
    METHODS:
    check FOR EVENT checkbox_change OF cl_salv_events_tree IMPORTING node_key columnname checked. "Here node_key is the row number
    ENDCLASS. "lcl_handle_events DEFINITION
    CLASS lcl_handle_events IMPLEMENTATION
    §4.2 implement the events for handling the events of cl_salv_table
    CLASS lcl_handle_events IMPLEMENTATION_._
    METHOD check_._
    WRITE 'hello'_._
    DATA lwa_modify_check_ TYPE REF TO csg_gs_outtab.
    node_key = node_key - 1_._
    READ TABLE csg_gt_list INDEX node_key REFERENCE INTO lwa_modify_check._
    if columnname = 'FCHECKBOX'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->fcheckbox =_ ' '_._
    ELSE_._
    lwa_modify_check->fcheckbox =_ 'X'_._
    ENDIF_._
    ENDIF_._
    if columnname = 'CHECKBOX_READ'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->checkbox_read =_ ' '_._
    ELSE_._
    lwa_modify_check->checkbox_read =_ 'X'_._
    ENDIF_._
    ENDIF_._
    *MODIFY TABLE csg_gt_list from l_wa_modify_check.
    flag_test = flag_test + 1_._
    ENDMETHOD_._ "check
    ENDCLASS_._ "lcl_handle_events IMPLEMENTATION
    Please give me reward points

  • Filter report with checkbox

    I have a report (select A, B, C from TABLE1) on PAGE1
    I also added a little form on PAGE1. this form contains a list of checkbox generated dynamically with another query.
    I would like to filter my report with the values of the checked items in the form (so we get something like that : select A, B, C from TABLE1 where A in (checkbox1, checkbox4))
    Im using Apex 4
    Any idea how to achieve this ?
    thanks

    Hello quiqui42,
    You haven't given enough specific information about your situation, so I'll have to make some assumptions.
    I'm assuming that by "this form contains a list of checkbox generated dynamically with another query", you mean that you have a checkbox item that is based on a dynamic LOV. If this is the case, let's pretend that if checkbox 1 and checkbox 4 are checked, the value of the checkbox item (let's call it P1_FILTER) is "1:4".
    Now, there's probably lots of ways to do what you need to do, but I'll give you two. One is very easy, but could come at the cost of performance; the other is a little more involved but will execute much better on a large table, as long as what you're filtering on is indexed.
    Easy but potentially slow one:
    SELECT   a, b, c
      FROM   table1
    WHERE   INSTR(':' || :P1_FILTER || ':', ':' || a || ':') > 0;This could be a performance dog because it will not matter if column "a" is indexed - since you're running it thru a function the database will not use the index. Depending on the size of this table, this may or may not be a concern.
    Here is the more involved but better-performing one:
    1) Create a type:
    CREATE TYPE filter_vals AS TABLE OF VARCHAR2(10);      // replace varchar2(10) based on the size/type of your filter values2) Create a function:
    CREATE FUNCTION get_filter_vals(vals IN VARCHAR2)
       RETURN filter_vals
       PIPELINED
    IS
       arr  apex_application_global.vc_arr2 := apex_util.string_to_table(vals);
    BEGIN
       FOR i IN 1 .. arr.COUNT LOOP
          PIPE ROW (arr(i));
       END LOOP;
       RETURN;
    END get_filter_vals;3) Put this in the SQL for your report:
    SELECT   a, b, c
      FROM   table1
    WHERE   a IN (SELECT   COLUMN_VALUE FROM table(get_filter_vals(:P1_FILTER)));Step 1 creates a table type that is used by the function created in step 2. Step 2 is a pipelined function that turns a colon-delimited string (such as what is typically held in a list of checkboxes based on an LOV) into something that can be select-ed on just like a table. Finally, step 3 shows the query that uses the function in a way that allows a where-in clause, which will take advantage of an index on column "a" in a large table.
    Hope this helps,
    John

  • Reports with checkbox

    Hello Friends,
    I have one interactive report in which it displays 20 records with checkboxes for each.
    From 20 i have randomly selected 6 checkboxes.
    Now i want to display those 6 records in my first seconday screen.
    How to display it? Please give some example.
    Thanks in advance.
    Regards,
    n.i.m.z.

    hi
       the requirement can be done using the READ LINE command...just set the pf-status GUI in the program with a button CLIC
    report zsathish.
    DATA: BEGIN OF ITAB OCCURS 0,
         FLAG(1),
          MATNR LIKE MARA-MATNR,
          END OF ITAB.
    DATA: MLINE TYPE I, MPAGE LIKE SY-PAGNO.
    START-OF-SELECTION.
      SET PF-STATUS 'GUI'.
      SELECT MATNR FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 20 ROWS.
      LOOP AT ITAB.
        WRITE : / ITAB-FLAG AS CHECKBOX, ITAB-MATNR.
       Hide : itab-matnr.
      ENDLOOP.
    MPAGE = SY-PAGNO.
    MLINE = MPAGE * 72.
    AT user-command.
    case sy-ucomm.
      when 'CLIC'.
      DO MLINE TIMES.
        READ LINE SY-INDEX FIELD VALUE ITAB-FLAG.
        IF ITAB-FLAG NE SPACE.
          WRITE : / ITAB-MATNR.
        ENDIF.
      ENDDO.
    if helpful, reward
    Sathish. R

  • Interactive report with checkbox and editable field

    Hi,
    For a project I'm working on I need to create a interactive report in Apex 3.2 with the ability to select lines and to modify one of the columns in the report.
    To do this, I started off by adding these two fields to the selection query of my IR:
    apex_item.checkbox(1, product_number) cb
    and
    apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER
    cb is the checkbox files, and QTY_TO_ORDER is the editable field.
    That worked like a charm and I got my two fields in the report.
    To process the values, I added this page process, wich for now should only store the "product number" and "QTY_TO_ORDER" fields in a table.
    BEGIN
    FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
    insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i));
    END LOOP;
    commit;
    end;
    However, this doesn’t work the way I want it to work. When I check the checkboxes of two rows, it will store two rows with the right product numbers, but it will take the top two QTY_TO_ORDER field of the table regardless of which ones are checked. I was able to solve this problem, by adding a rownum to the query and using the rownum as the value for the checkbox. Since I still need the product_number and qty_to order fields I made them both text fields.
    I changed my page process to:
    BEGIN
    FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
    insert into mytmptable values (APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i)),
    APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i)));
    END LOOP;
    commit;
    end;
    This seemed to solve the problem, and I now got the right values in the table, unless I used sorting in the report... As soon as I sorted the report in a way different than by rownum, I got the wrong values in the table. The reason for this is of course that my insert just selects the nTh row from the table, and my rownums aren't dynamic.
    I've found a lot of examples on the internet using '#ROWNUM#' in the selection, which should dynamically generate a rownum in the report. This seems to work in normal report, but in a interactive reports, the literal values '#ROWNUM#' shows up.
    Is there any way to solve this issue?

    Hi,
    Try with 3 fields:
    apex_item.checkbox(1, product_number) cb,
    apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER,
    apex_item.hidden(3, product_number) prod_no
    The hidden field should be display as a hidden column.
    Then your process can be:
    BEGIN
    FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
    FOR j in 1..APEX_APPLICATION.G_F03.count LOOP
    IF APEX_APPLICATION.G_F01(i) = APEX_APPLICATION.G_F03(j)) THEN
    insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(j));
    exit;
    END IF;
    END LOOP;
    END LOOP;

  • Report with checkbox and collection

    Hi all
    I need to manage an interactive report to filtering and selecting rows by checkboxes and then use a collection to manage the selected records.
    I used a first collection to create the source record set by a On-Load Before-Header Process:
    DECLARE
    v_id NUMBER;
    var1 Varchar2(8);
    var2 Varchar2(10);
    var3 VARCHAR2(50);
    var4 VARCHAR2(10);
    var5 VARCHAR2(100);
    var6 VARCHAR2(5);
    cursor c_Populate is
    SELECT
    dep.chassis_code AS chassis_code,
    dep.model_code AS model_code,
    m.model_description AS model_description,
    dep.acc_doc_number AS acc_doc_number,
    dest.description AS destination_descr,
    (trunc(sysdate) - dep.entry_date) Anzianita
    FROM deposit_chassis dep, warehouses w, warehouse_map map, models m, site s,
    destinations dest, T_SUB_DESTIN_DEALERS sdd
    WHERE
    dep.status = 5 AND
    w.ware_code = map.ware_code AND
    dep.DEALER_CODE = sdd.DELIVERY_POINT AND
    dep.DESTINATION_CODE = sdd.DESTINATION_CODE AND
    map.map_code = dep.map_code AND
    m.model_code = dep.model_code AND
    DEP.UNLOADING_SITE = S.SITE_CODE AND
    DEP.destination_code = dest.destination_code And
    dep.unloading_site = 'S0000074' and w.site_code = 'S0000074';
    i NUMBER;
    BEGIN
    APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'MY_COLLECTION');
    OPEN c_Populate;
    LOOP
    FETCH c_Populate into var1, var2, var3, var4, var5, var6;
    EXIT WHEN c_Populate%NOTFOUND;
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'MY_COLLECTION',
    p_c001 => var1,
    p_c002 => var2,
    p_c003 => var3,
    p_c004 => var4,
    p_c005 => var5,
    p_c006 => var6);
    END LOOP;
    CLOSE c_Populate;
    END;
    Then I created a region for a SQL report:
    SELECT
    APEX_ITEM.CHECKBOX(1,c001) Chk,
    apex_item.text(2, c001) Telaio,
    apex_item.text(3, c002) ModelCode,
    apex_item.text(4, c003) Model,
    apex_item.text(5, c004) Doc_Number,
    apex_item.text(6, c005) Destination,
    apex_item.text(7, c006) Age
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION';
    Then, with a submit button and the relative process (below), I need to load a new collection for further elaboration.
    How can I obtain the single values for each field of my selected row (see MY_COLLECTION) ?
    APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'COL_AVAILABLE_CHASSIS');
    FOR i IN 1..APEX_APPLICATION.G_F01.Count
    LOOP
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'COL_AVAILABLE_CHASSIS',
    p_c001 => I need the Telaio
    p_c002 => I need the ModelCode
    p_c003 => I need the Model
    p_c004 => I need the Doc_Number
    p_c005 => I need the Destination
    p_c006 => I need the Age
    END LOOP;
    Thanks in advance,
    Massimo

    Dear Jari
    I've looked at your sample.
    Yes it seems ok for my apps
    So, i've done the following update to my code:
    Souce Report
    SELECT
         APEX_ITEM.CHECKBOX(3,c001) Chk,
         APEX_ITEM.TEXT(4,c001) Telaio,
         APEX_ITEM.TEXT(5,c002) ModelCode,
         APEX_ITEM.TEXT(6,c003) Model,
         APEX_ITEM.TEXT(7,c004) Doc_Number,
         APEX_ITEM.TEXT(8,c005) Destination,
         APEX_ITEM.TEXT(9,c006) Anzianita
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'
    The Submit Process
    DECLARE
      l_row NUMBER := 1;
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
      LOOP
        FOR j IN l_row..APEX_APPLICATION.G_F04.COUNT
        LOOP
          IF APEX_APPLICATION.G_F04(j) = APEX_APPLICATION.G_F03(i) THEN
              -- ONLY FOR TEST PURPOSE --
            htp.p('Telaio: '||APEX_APPLICATION.G_F03(i));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F04(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F05(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F06(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F07(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F08(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F09(j));
            l_row := j + 1;
            EXIT;
          END IF;
        END LOOP;
      END LOOP;
      COMMIT;
    END;
    Is it correct to manage G_F0x like my code ?
    Thanks,
    Massimo

  • Report with checkbox to PDF-File with BI Publisher

    Hello,
    I am able to create reports in APEX to create PDF-Files. We are using the BI Publisher.
    Now we have to design a rft-Template with a checkbox. In BI Publisher it works with the checkbox greate, but if I create in APEX report and a layout the checkbox is not display in the PDF-File.
    Does anyone has a solution for that?
    Regards,
    Mark

    I have a same issue ...
    How you are calling a bi report from apex....?
    Please help me...
    ty

  • Interactive Report with Checkbox column

    Hello everyone,
    our users love the Interactive Report filtering, so they want all forms in apps. to behave like Interactive Reports.
    I need a form where each row consists of 2 columns and a checkbox, that handles some flag. I can create checkboxes using APEX_ITEM, however, the filtering on such column look ridicolous. I would like to have a tabular form (with one editable checkbox column), but with all those Interactive Report filtering features.
    Is there any example (or inspiration) how to achieve such functionality?
    Thanks a lot!
    Adam

    Hello Adam,
    Why don't you just switch off the Filtering option for that column?
    (Go to the Interactive Report, click on your column, then in Column Definition you can (un)check the features for that column).
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Detaliate report with checkbox

    So I made a report of a table on a page, but i have selected only a few columns 3/7. Now, i want that using checkboxes (or radio?) i want to select a specific line and then take me to another page to see the whole report only of that selected line 7/7. Can I do such thing?

    Hi
    OK - My reports are on two pages - 109 (partial report) and 110 (full report).
    The SQL query for the report on 109 is:
    SELECT APEX_ITEM.CHECKBOX(1, EMPNO) SHOW_DETAILS,
    EMPNO,
    ENAME,
    JOB
    FROM EMPThe SHOW_DETAILS column creates the checkboxes with the EMPNO as their values. Because I'm using the APEX_ITEM.CHECKBOX() function to create these, when the page is submitted I then have access to the APEX_APPLICATION.G_F01 collection (in a similar way to using a tabular form). I get the EMPNO values selected using a PL/SQL process on the page:
    DECLARE
    vFILTER VARCHAR2(1000);
    BEGIN
    vFILTER := APEX_UTIL.TABLE_TO_STRING(APEX_APPLICATION.G_F01);
    APEX_UTIL.SET_SESSION_STATE('P110_FILTER', vFILTER);
    END;This just converts the collection into a single string and sets an item on page 110 to this. This string will be in the format 1:2:3
    There is a button that triggers the process and then a branch to page 110
    On page 110, the report's SQL is:
    SELECT EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,
    DEPTNO
    FROM EMP
    WHERE ':' || :P110_FILTER || ':' LIKE '%:' || EMPNO || ':%'The report region also contains the "Hidden and Protected" item called P110_FILTER - this is populated using the process on page 109 and used as a filter on the report on page 110
    There is a back button to go back to page 109 - this also clears the cache for page 110
    Andy

  • Report with checkbox problem

    I have a process that approves activities by clicking on the checkbox of my report. This is my first column called htmldb_application.g_f01. When I try to approve activities and I try to return the value of htmldb_application.g_f11(i), it always stays on the first value. Here is my code :
    Declare
    --Niveau_Approb number;
    Retard number;
    Date_Prevue_Active date;
    Approbation1 number;
    Delegue2 number;
    Approbateur2 number;
    Approb2 number;
    l_count number;
    Usager_Approb2 number;
    Niveau number;
    Begin
    for i in 1..htmldb_application.g_f01.count
    loop
    select count(*)
    into Usager_Approb2
    from Approbateur, tache, activite
    where activite.code_activite        = htmldb_application.g_f01(i)
    And   activite.code_tache           = tache.code_tache
    And   tache.code_tache              = approbateur.code_tache
    and   approbateur.niveau_approbation = 2
    and   approbateur.pein               = :USAGER_ACTIF
    and   code_activite not in
             select code_activite
             from Delegation, tache, activite
             where activite.code_activite        = htmldb_application.g_f01(i)
             And   activite.code_tache           = tache.code_tache
             And   tache.code_tache              = delegation.code_tache
             and   to_date(activite.date_prevue, 'YYYY-MM-DD')
             between to_date(delegation.date_debut, 'YYY-MM-DD') and to_date(delegation.date_fin, 'YYYY-MM-DD')
             and   delegation.niveau_approbation = 2
             and   delegation.pein = :USAGER_ACTIF);
    select count(*)
    into Approbation1
    from approbation
    where code_activite      = htmldb_application.g_f01(i)
    and   niveau_approbation = 1;
    into Delegue2
    from Delegation, tache, activite
    where activite.code_activite        = htmldb_application.g_f01(i)
    And   activite.code_tache           = tache.code_tache
    And   tache.code_tache              = delegation.code_tache
    and   delegation.niveau_approbation = 2;
    select count(*)
    into Approbateur2
    from Approbateur, tache, activite
    where activite.code_activite         = htmldb_application.g_f01(i)
    And   activite.code_tache            = tache.code_tache
    And   tache.code_tache               = approbateur.code_tache
    and   approbateur.niveau_approbation = 2;
    Niveau :=htmldb_application.g_f11(i);
        RAISE_application_error(-20000,Niveau,TRUE);
    IF (htmldb_application.g_f11(i)=2) And (Approbation1 <= 0)
    THEN
        RAISE_application_error(-20000,'  An approbation from level 1 needs to be done before you approve level 2./ Une approbation de niveau 1 doit avoir été effectuée pour que vous puissiez approuver avec un niveau 2.',TRUE);
    elsif (htmldb_application.g_f11(i)=1) and (usager_approb2 >= 1)
    then
         RAISE_application_error(-20000,'You already have to approve level 2 so you can not approve level 1/ Vous devez déjà approuver un niveau 2 alors vous ne pouvez approuver un niveau 1.',TRUE);
    ELSE
       Insert into Approbation (PEIN, CODE_ACTIVITE, DATE_APPROBATION, DATE_CREATION, PEIN_CREATION,
       NIVEAU_APPROBATION, PEIN_REVISION, DATE_REVISION)
       Values (:USAGER_ACTIF, htmldb_application.g_f01(i),sysdate, sysdate,
       :USAGER_ACTIF,htmldb_application.g_f11(i), :USAGER_ACTIF, sysdate);
       commit;
       Select NBJRS_RETARD into Retard from tache, activite where activite.code_activite =   
       htmldb_application.g_f01(i) and activite.code_tache = tache.code_tache;
       Select date_prevue into Date_Prevue_Active from activite where activite.code_activite =  
       htmldb_application.g_f01(i);
       if (trunc(sysdate) > trunc(Date_Prevue_Active)+Retard)
       then
          if (htmldb_application.g_f11(i)= 1 ) And (Delegue2 <=0) And (
              Approbateur2 <= 0)
          then
             Update activite set succes = 'T', STATUT_QUALITE = 'En Retard',DATE_REVISION = sysdate,
             pein_revision = :USAGER_ACTIF
             where code_activite = htmldb_application.g_f01(i);
          elsif (htmldb_application.g_f11(i) = 1) And ((Delegue2 > 0) OR (
                 Approbateur2 > 0))
          then
              Update activite set succes = 'C', STATUT_QUALITE = '2',
              DATE_REVISION = sysdate,
              pein_revision = :USAGER_ACTIF
              where code_activite = htmldb_application.g_f01(i);
           elsif (htmldb_application.g_f11(i) = 2) and (Approbation1 > 0)
           then
                Update activite set succes = 'T', STATUT_QUALITE = 'En Retard',
                DATE_REVISION = sysdate,
                pein_revision = :USAGER_ACTIF
                where code_activite = htmldb_application.g_f01(i);
           end if;
       else
         if (htmldb_application.g_f11(i)= 1 ) And (Delegue2 <=0) And ( Approbateur2 <= 0)
         then
                 Update activite set succes = 'T', STATUT_QUALITE = 'À Temps',
                 DATE_REVISION = sysdate,
                 pein_revision = :USAGER_ACTIF
                 where code_activite = htmldb_application.g_f01(i);
         elsif (htmldb_application.g_f11(i) = 1) And ((Delegue2 > 0) OR ( Approbateur2 > 0))
         then
                 Update activite set succes = 'C', STATUT_QUALITE = '2',DATE_REVISION = sysdate,
                 pein_revision = :USAGER_ACTIF
                 where code_activite = htmldb_application.g_f01(i);
         elsif (htmldb_application.g_f11(i)= 2) and (Approbation1 > 0)
         then
                 Update activite set succes = 'T', STATUT_QUALITE = 'À Temps',
                 DATE_REVISION = sysdate,
                 pein_revision = :USAGER_ACTIF
                 where code_activite = htmldb_application.g_f01(i) ;
         end if;
      end if;
    Anyone can help me ??
    Thanks
    Chantale
       commit;
    end if;
      --  RAISE_application_error(-20000,Niveau,TRUE);
    end loop;
    end;

    Hi all,
    I have the same problem with another report, here is part of my code :
    DECLARE
    q VARCHAR2 (30000);
    tbl VARCHAR2 (30000);
    w varchar2(500);
    n varchar2(3);
    BEGIN
    q := ' select APEX_ITEM.CHECKBOX(14,rownum) id,x.Nom,' ||
    'APEX_ITEM.SELECT_LIST_FROM_LOV(11,x.IdHoraire,''' ||
    'LISTE DES HORAIRES DE TRAVAIL' || ''',null,''' || 'NO' || ''') as Horaire,' ||
    'APEX_ITEM.CHECKBOX(12,x.TechAccredite,' ||
    'decode(x.TechAccredite,null,null,' || '''CHECKED''' || ')) Accredite, ' ||
    'APEX_ITEM.TEXT(13,x.Numero,10,10,' ||
    '''onblur="javascript:if(!valider_telephone(1,this.value)){alert(''' ||
    '''Numero non valide''' || '''); this.focus();};"''' || ') Tel, ' ||
    'APEX_ITEM.HIDDEN(10,x.IdCT) as ICT';
    q := q || ' from (';
    tbl := ' a valide select statement';
    q := q || tbl || ' ) x ';
    w := ' where ';
    w := w || ' x.IdDepot = decode(:P97_IDDEPOT,-1,x.IdDepot,:P97_IDDEPOT) ';
    w := w || ' or x.IdDepot is null ';
    w:= w || ' order by 2';
    q := q || w;
    RETURN q;
    END;
    and I created a process :
    declare
    res varchar2(100);
    id number;
    Begin
    res := 'res';
    for i in 1..APEX_APPLICATION.G_F14.count loop
    id := to_number(APEX_APPLICATION.G_F14(i));
    res := res || ' i=' || i || ' rownum ' || id || ' th ' ||
    APEX_APPLICATION.G_F11(APEX_APPLICATION.G_F14(i));
    end loop;
    :P97_POUB := res;
    End;
    My process just print the 'res' in an item named P97_POUB, so I can see if evry thing works.
    But I still have a no data found error.
    Benn

  • Updateable  report  with CHECKBOX - Error in MRU: row= 1, ORA-01403:

    Hi All,
    Lets say I have a table tab_1 with column return_flg
    I have an updateable report - tabular form.
    For the return_flg column I have:
    I have Tabular Form Element attribs:
    Display As Standard Report Column
    Default Type No Default
    Default
    Reference Table Owner - no reference selected
    Reference Table Name TAB_1
    Reference Column Name RETURN_FLG
    But there is no CHECKBOX display type..so I used HTMLDB_ITEM.CHECKBOX in the SQL...
    Select ID, .....
    HTMLDB_ITEM.CHECKBOX(1,RETURN_FLG) "RETURNED"
    from tab_1 where order_id = '1'
    How do I get it to update with the MRU?
    I get Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01403: no data found, update TEMP_USER.TAB_1 set "ID" = :b1
    Thanks for the help, BillC
    Message was edited by:
    bcarlis_2000

    No, I had an updateable report that works great..
    Lets say
    Select ID, item_name
    from TAB_1 where ID = '1'
    Updates great!
    then added column to the table to track if item was returned.
    RETURNED_FLG
    changed select of same form to:
    Select ID, item_name
    from TAB_1 where ID = '1'
    HTMLDB_ITEM.CHECKBOX(1,RETURNED_FLG) "RETURNED"
    Now, it updates great IF the checkbox is not checked but gives the error if checked.

  • TREE REPORT with CHECKBOX

    Hi
    I want a report in which the report should have tree structure and along with check box
    Regards
    Sneha

    HI
    Check this standard report
    SAPCOLUMN_TREE_CONTROL_DEMO
    *& Report  ZTREE                                                       *
    REPORT  ZTREE                                   .
    DATA: BEGIN OF ITEMS OCCURS 100,
             ID(10),
             PARENT_ID(10),
             TEXT(20),
             SYMBOL,
          END OF ITEMS,
          TABIX_STACK LIKE SY-TABIX OCCURS 10 WITH HEADER LINE,
          ITEMS_SHOW LIKE ITEMS OCCURS 100 WITH HEADER LINE.
    INCLUDE <SYMBOL>.
    \* append sample items (mixed order)
    PERFORM APPEND_ITEM USING:
        '1'  ''        'Food',
        '2'  ''        'Drinks',
        '12' '9'       'Pavan Praveen',
        '17' '11'      'company',
        '3'  ''        'Tools',
        '4'  '1'       'Dairy milk',
        '16' '11'      'Music',
        '5'  '1'       'Chocolate',
        '6'  '2'       'Alcoholic',
        '8'  '4'       'Megastar',
        '10' '5'       'Milk',
        '11' '3'       'Boost',
        '13' '9'       'Sachin ',
        '7'  '4'       'Cricket',
        '14' '2'       'Non-alcholic',
        '35' '31'      'Pepsi',
        '9'  '6'       'Thumsup',
        '15' '14'      'Coca-cola',
        '18' '6'       'Win',
        '28' '18'      'Ganguly ',
        '33' '28'      'INDIA',
        '34' '28'      'Gujarat',
        '29' '18'      'State',
        '30' '29'      'congrats',
        '19' '33'      'chiranjeevi',
        '20' '33'      'kalyan',
        '22' '19'      'here comes',
        '23' '19'      'Chandra',
        '24' '20'      'chat',
        '32' '31'      'Marvelous',
        '25' '20'      'Memorable',
        '31' '34'      'guess'.
    \* show initial list (items with level 0 - parentless items)
    LOOP AT ITEMS WHERE PARENT_ID = ''.
      MOVE-CORRESPONDING ITEMS TO ITEMS_SHOW.
      ITEMS_SHOW-SYMBOL = '+'.
      APPEND ITEMS_SHOW.
    ENDLOOP.
    PERFORM PRINT_TREE TABLES ITEMS_SHOW.
    \* at line-selection - when the node is opened/closed or item double-clk
    AT LINE-SELECTION.
      READ TABLE ITEMS WITH KEY PARENT_ID = ITEMS_SHOW-ID. "see 'hide'
      IF SY-SUBRC = 0. "item has children - expand or collapse
        SY-LSIND = 0.
        PERFORM EXPAND_COLLAPSE USING ITEMS_SHOW-ID.
        PERFORM PRINT_TREE TABLES ITEMS_SHOW.
      ELSE.            "item has NO children - perform some action
        READ TABLE ITEMS WITH KEY ID = ITEMS_SHOW-ID.
        WRITE: 'Action performed on item "' NO-GAP, ITEMS-TEXT NO-GAP,
               '", id.', ITEMS-ID.
      ENDIF.
    \* form print_tree
    FORM PRINT_TREE TABLES ITEMS STRUCTURE ITEMS.
      DATA: V_TABIX LIKE SY-TABIX,
            START_TABIX LIKE SY-TABIX,
            V_LEVEL LIKE SY-TFILL,
            V_OFFSET TYPE I,
            V_ID LIKE ITEMS-ID,
            V_PARENT_ID LIKE ITEMS-PARENT_ID,
            V_PARENT_ID_FOR_VLINE LIKE ITEMS-PARENT_ID,
            V_PREV_LEVEL TYPE I,
            V_ITEMS_COUNT LIKE SY-TFILL,
            V_VLINES_STRING(200).
      CHECK NOT ITEMS[] IS INITIAL.
      SORT ITEMS BY PARENT_ID ID.
      READ TABLE ITEMS INDEX 1.
      V_PARENT_ID = ITEMS-PARENT_ID.
      START_TABIX = 1.
      REFRESH TABIX_STACK.
      DO.
        LOOP AT ITEMS FROM START_TABIX.
          V_TABIX = START_TABIX = SY-TABIX."remember current index
          V_ID = ITEMS-ID.
          V_PARENT_ID_FOR_VLINE = ITEMS-PARENT_ID.
    \*     decrease level and exit loop if parent not the same as previous
          IF ITEMS-PARENT_ID NE V_PARENT_ID.
            PERFORM READ_FROM_STACK CHANGING START_TABIX. "level = NoOfRecs
            READ TABLE ITEMS INDEX START_TABIX.
            V_PARENT_ID = ITEMS-PARENT_ID.
            ADD 1 TO START_TABIX.   "next loop starts from parent index + 1
    \*        clear vline
            IF V_LEVEL > 1.
              V_OFFSET = 2 + ( V_LEVEL - 2 ) * 3.
              IF V_LEVEL = 1. V_OFFSET = 1. ENDIF.
              V_VLINES_STRING+V_OFFSET = ' '.
            ENDIF.
            EXIT.
          ENDIF.
          V_PARENT_ID = ITEMS-PARENT_ID.
    \*     write item
          FORMAT COLOR OFF.
    DESCRIBE TABLE TABIX_STACK LINES V_LEVEL."level is no of StackRecs
          WRITE: / V_VLINES_STRING.
          V_OFFSET = V_LEVEL * 3.
          IF V_LEVEL NE 0.
            IF V_PREV_LEVEL < V_LEVEL.
              WRITE: AT V_OFFSET '|', / ''.
              WRITE: / V_VLINES_STRING.
            ENDIF.
            V_OFFSET = V_LEVEL * 3.
            WRITE AT V_OFFSET '|--'.
          ENDIF.
          V_OFFSET = V_OFFSET + 3.
          CASE ITEMS-SYMBOL.
            WHEN '+'.
              WRITE AT V_OFFSET SYM_PLUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
            WHEN '-'.
              WRITE AT V_OFFSET SYM_MINUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
            WHEN OTHERS. FORMAT COLOR 5.
          ENDCASE.
          WRITE: ITEMS-TEXT.
          V_PREV_LEVEL = V_LEVEL.
          HIDE: ITEMS-ID.
          ADD 1 TO V_ITEMS_COUNT.
          READ TABLE ITEMS WITH KEY PARENT_ID = ITEMS-ID.
    \*     increase level and exit loop if item has children
          IF SY-SUBRC = 0.
            START_TABIX = SY-TABIX.
            APPEND V_TABIX TO TABIX_STACK. "level is no of recs in stack
            V_PARENT_ID = ITEMS-PARENT_ID.
    \*        set vline
            V_TABIX = V_TABIX + 1.
            READ TABLE ITEMS INDEX V_TABIX.
            V_OFFSET = 2 + ( V_LEVEL - 1 ) * 3.
            IF V_LEVEL > 0.
              IF ITEMS-PARENT_ID = V_PARENT_ID_FOR_VLINE AND SY-SUBRC = 0.
                V_VLINES_STRING+V_OFFSET = '|'.
              ELSE.
                V_VLINES_STRING+V_OFFSET = ' '.
              ENDIF.
            ENDIF.
            EXIT.
          ENDIF.
    \*     at last - decrease level
          AT LAST.
    \*        clear vline
            IF V_LEVEL > 1.
              V_OFFSET = 2 + ( V_LEVEL - 2 ) * 3.
              IF V_LEVEL = 1. V_OFFSET = 1. ENDIF.
              V_VLINES_STRING+V_OFFSET = ' '.
            ENDIF.
            " next loop starts from parent index, not parent index + 1
            " because of different parents level will decrease anyway
            PERFORM READ_FROM_STACK CHANGING START_TABIX.
            APPEND START_TABIX TO TABIX_STACK. "must return index to stack
          ENDAT.
        ENDLOOP.
        DESCRIBE TABLE ITEMS.
        IF START_TABIX > SY-TFILL OR V_ITEMS_COUNT >= SY-TFILL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    \* form expand_collapse
    FORM EXPAND_COLLAPSE USING VALUE(V_ID).
      DATA: V_NO_MORE_ORPHANS,
            ITEMS_TEMP LIKE ITEMS OCCURS 100 WITH HEADER LINE.
      DELETE ITEMS_SHOW WHERE PARENT_ID = V_ID. "try to collapse
      IF SY-SUBRC = 0.                     "succesfull first collapse
        DO.            "cascade collapse - delete 'orphans' that are left
          REFRESH ITEMS_TEMP.
          MOVE ITEMS_SHOW\[] TO ITEMS_TEMP[].
          SORT ITEMS_TEMP BY ID.
          V_NO_MORE_ORPHANS = 'X'.
          LOOP AT ITEMS_SHOW WHERE PARENT_ID NE ''.
            READ TABLE ITEMS_TEMP WITH KEY ID = ITEMS_SHOW-PARENT_ID
                                   BINARY SEARCH TRANSPORTING NO FIELDS.
            IF SY-SUBRC NE 0.              "no parent - it's an orphan
              CLEAR V_NO_MORE_ORPHANS.
              DELETE ITEMS_SHOW.
            ENDIF.
          ENDLOOP.
          IF V_NO_MORE_ORPHANS = 'X'. EXIT. ENDIF.
        ENDDO.
        ITEMS_SHOW-SYMBOL = '+'.
        MODIFY ITEMS_SHOW TRANSPORTING SYMBOL WHERE ID = V_ID.
      ELSE.                                "unsuccessfull collapse - expand
        ITEMS_SHOW-SYMBOL = '-'.
        MODIFY ITEMS_SHOW TRANSPORTING SYMBOL WHERE ID = V_ID.
        LOOP AT ITEMS WHERE PARENT_ID = V_ID.      "show children
          APPEND ITEMS TO ITEMS_SHOW.
        ENDLOOP.
        LOOP AT ITEMS_SHOW WHERE PARENT_ID = V_ID. "check grandchildren
          READ TABLE ITEMS WITH KEY PARENT_ID = ITEMS_SHOW-ID.
          IF SY-SUBRC = 0.
            ITEMS_SHOW-SYMBOL = '+'.
          ELSE.
            ITEMS_SHOW-SYMBOL = ''.
          ENDIF.
          MODIFY ITEMS_SHOW.
        ENDLOOP.
      ENDIF.
    ENDFORM.
    \* form append_item
    FORM APPEND_ITEM USING VALUE(ID) VALUE(PARENT_ID) VALUE(TEXT).
      ITEMS-ID = ID.
      ITEMS-PARENT_ID = PARENT_ID.
      ITEMS-TEXT = TEXT.
      APPEND ITEMS.
    ENDFORM.
    \* form read_from_stack
    FORM READ_FROM_STACK CHANGING TABIX LIKE SY-TABIX.
      DESCRIBE TABLE TABIX_STACK.
      CHECK SY-TFILL NE 0.
      READ TABLE TABIX_STACK INDEX SY-TFILL.
      TABIX = TABIX_STACK.
      DELETE TABIX_STACK INDEX SY-TFILL.
    ENDFORM.
    Or use this FM RS_TREE_SET_CURRENT_LAYOUT
    *& Report  ZTREESTRUC                                                  *
    REPORT  ZTREESTRUC                              .
    Type-pools : fibs,stree.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line.
    clear : node_tab, node_tab[].
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Germany'.
    node_tab-tlevel = '03'.
    node_tab-nlength = '7'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Berlin'.
    node_tab-tlevel = '04'.
    node_tab-nlength = '6'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Asia'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '4'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'India'.
    node_tab-tlevel = '03-'.
    node_tab-nlength = '5'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Bombay'.
    node_tab-tlevel = '04-'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    \* EXPORTING
      INSERT_ID                = '000000'
      RELATIONSHIP             = ' '
      LOG                      =
      TABLES
        NODETAB                  = node_tab
    \* EXCEPTIONS
      TREE_FAILURE             = 1
      ID_NOT_FOUND             = 2
      WRONG_RELATIONSHIP       = 3
      OTHERS                   = 4
    IF SY-SUBRC  0.
    \* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@BL@'.
        APPEND wa_type TO type_mapping.
    *CALL FUNCTION 'RS_TREE_CONTROL_PREPARE'
    \* EXPORTING
      CONTROL_PATTERN             = STREE_CTL_GENERIC
       CONTROL_PATTERN             = 'PH'
    \**   HIERARCHY_HEADER            =
      INITIAL_HEADER_WIDTH        =
      LIST_ITEM_HEADER            =
      MULTIPLE_SELECTION          = 'X'
      ITEM_SELECTION              = STREE_FALSE
      SUPPRESS_NODE_ICON          = STREE_FALSE
      SUPPRESS_FOLDER_ICON        = STREE_FALSE
      CALLBACK_PROGRAM            =
      CALLBACK_ITEM_DISPLAY       =
      COLOR_MAPPING               =
        TYPE_MAPPING                = type_mapping
    IMPORTING
      SUBSCREEN_PROGRAM           =
      SUBSCREEN_DYNNR             =
    EXCEPTIONS
      NOT_AVAILABLE               = 1
      OTHERS                      = 2
    *IF SY-SUBRC  0.
    \** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *CALL FUNCTION 'RS_TREE_SET_CURRENT_LAYOUT'
    \** EXPORTING
      CURSOR_COLUMN             = 3
      CURSOR_LINE               = 2
      FIRST_NODE                = 1
      FIRST_NODE_TYPE           = ' '
      LIST_COLUMN               = 1
      LIST_LINE                 = 1
      LAYOUT_MODE               = STREE_LAYOUT_NORMAL
    IMPORTING
      INCONSISTENT_LAYOUT       =
    TABLES
      LAYOUT                    =
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    \*   CALLBACK_PROGRAM                =
      CALLBACK_USER_COMMAND           =
      CALLBACK_TEXT_DISPLAY           =
      CALLBACK_MOREINFO_DISPLAY       =
      CALLBACK_COLOR_DISPLAY          =
      CALLBACK_TOP_OF_PAGE            =
      CALLBACK_GUI_STATUS             =
      CALLBACK_CONTEXT_MENU           =
      STATUS                          = 'IMPLICIT'
      CHECK_DUPLICATE_NAME            = '1'
      COLOR_OF_NODE                   = '4'
      COLOR_OF_MARK                   = '3'
      COLOR_OF_LINK                   = '1'
      COLOR_OF_MATCH                  = '5'
      LOWER_CASE_SENSITIVE            = ' '
      MODIFICATION_LOG                = ' '
      NODE_LENGTH                     = 30
      TEXT_LENGTH                     = 75
      TEXT_LENGTH1                    = 0
      TEXT_LENGTH2                    = 0
      RETURN_MARKED_SUBTREE           = ' '
      SCREEN_START_COLUMN             = 0
      SCREEN_START_LINE               = 0
      SCREEN_END_COLUMN               = 0
      SCREEN_END_LINE                 = 0
      SUPPRESS_NODE_OUTPUT            = ' '
      LAYOUT_MODE                     = ' '
      USE_CONTROL                     = STREE_USE_LIST
       USE_CONTROL                     = 'L'.
    \* IMPORTING
      F15                             =
    **********end of program
    For Tree structure in alv
    Check this
    *& Report  ZALVTREE                                                    *
    REPORT  ZALVTREE                                .
    *Data Declaration
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          it_ekpo     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko     TYPE t_ekko,
          wa_ekpo     TYPE t_ekko.
    DATA: ok_code like sy-ucomm,           "OK-Code
          save_ok like sy-ucomm.
    *ALV data declarations
    DATA: fieldcatalog  TYPE lvc_t_fcat WITH HEADER LINE.
    DATA: gd_fieldcat   TYPE lvc_t_fcat,
          gd_tab_group  TYPE slis_t_sp_group_alv,
          gd_layout     TYPE slis_layout_alv.
    *ALVtree data declarations
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA: gd_tree             TYPE REF TO cl_gui_alv_tree,
          gd_hierarchy_header TYPE treev_hhdr,
          gd_report_title     TYPE slis_t_listheader,
          gd_logo             TYPE sdydo_value,
          gd_variant          TYPE disvariant.
    *Create container for alv-tree
    DATA: l_tree_container_name(30) TYPE c,
          l_custom_container        TYPE REF TO cl_gui_custom_container.
    *Includes
    *INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
    *INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
    *INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
    *Start-of-selection.
    START-OF-SELECTION.
    \* ALVtree setup data
        PERFORM data_retrieval.
        PERFORM build_fieldcatalog.
        PERFORM build_layout.
        PERFORM build_hierarchy_header CHANGING gd_hierarchy_header.
        PERFORM build_report_title USING gd_report_title gd_logo.
        PERFORM build_variant.
    \* Display ALVtree report
      call screen 100.
    *&      Form  DATA_RETRIEVAL
    \*       Retrieve data into Internal tables
    FORM data_retrieval.
      SELECT ebeln
       UP TO 10 ROWS
        FROM ekko
        INTO corresponding fields of TABLE it_ekko.
      loop at it_ekko into wa_ekko.
        SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
          FROM ekpo
          appending TABLE it_ekpo
         where ebeln eq wa_ekko-ebeln.
      endloop.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_FIELDCATALOG
    \*       Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    \* Please not there are a number of differences between the structure of
    ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
    For example the field seltext_m is replace by scrtext_m in ALVtree.
      fieldcatalog-fieldname   = 'EBELN'.           "Field name in itab
      fieldcatalog-scrtext_m   = 'Purchase Order'.  "Column text
      fieldcatalog-col_pos     = 0.                 "Column position
      fieldcatalog-outputlen   = 15.                "Column width
      fieldcatalog-emphasize   = 'X'.               "Emphasize  (X or SPACE)
      fieldcatalog-key         = 'X'.               "Key Field? (X or SPACE)
    \*  fieldcatalog-do_sum      = 'X'.              "Sum Column?
    fieldcatalog-no_zero     = 'X'.              "Don't display if zero
      APPEND fieldcatalog TO gd_fieldcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-scrtext_m   = 'PO Iten'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-scrtext_m   = 'Status'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-scrtext_m   = 'Item change date'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-scrtext_m   = 'Material Number'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-scrtext_m   = 'PO quantity'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-scrtext_m   = 'Order Unit'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-scrtext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-scrtext_m   = 'Price Unit'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    \*       Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    \*  gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  build_hierarchy_header
    \*       build hierarchy-header-information
    \*      -->P_L_HIERARCHY_HEADER  structure for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'(013).
      p_hierarchy_header-tooltip = 'This is the Hierarchy Header !'(014).
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  BUILD_REPORT_TITLE
    \*       Build table for ALVtree header
    \*  <->  p1        Header details
    <->  p2        Logo value
    FORM build_report_title CHANGING
          pt_report_title  TYPE slis_t_listheader
          pa_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader,
            ld_date(10) TYPE c.
    \* List Heading Line(TYPE H)
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    \* ls_line-key     "Not Used For This Type(H)
      ls_line-info = 'PO ALVTree Display'.
      APPEND ls_line TO pt_report_title.
    \* Status Line(TYPE S)
      ld_date(2) = sy-datum+6(2).
      ld_date+2(1) = '/'.
      ld_date3(2) = sy-datum4(2).
      ld_date+5(1) = '/'.
      ld_date+6(4) = sy-datum(4).
      ls_line-typ  = 'S'.
      ls_line-key  = 'Date'.
      ls_line-info = ld_date.
      APPEND ls_line TO pt_report_title.
    \* Action Line(TYPE A)
      CLEAR ls_line.
      ls_line-typ  = 'A'.
      CONCATENATE 'Report: ' sy-repid INTO ls_line-info  SEPARATED BY space.
      APPEND ls_line TO pt_report_title.
    ENDFORM.
    *&      Form  BUILD_VARIANT
    \*       Build variant
    form build_variant.
    \* Set repid for storing variants
      gd_variant-report = sy-repid.
    endform.                    " BUILD_VARIANT 
    Regards
    Pavan

  • Working with checkbox

    Good day everyone, im new to Apex and was doing just fine until i got stuck in this situation:
    - I have tables A, B and C, where B is the relationship between A and C;
    - I've created page 1 with a report of A, where the user selects 1 entry;
    - Page 2 shows a report with checkboxes for each row of C;
    I need to set checked the entries where A is related to C (B)
    Any ideas on how that could be achieved?
    Edson

    Enough with this ..... link
    http://www.oracle.com/technology/products/database/htmldb/howtos/checkbox.html
    How many times do we have to see it in the forum....Enough.....
    Its so frustrating giving the same link time and time again...And the funny
    part is that most people's questions has nothing to do with that. But
    still some geniuses give the same link....I just feel so sorry for people
    who are struggling to get a answer and some idiots give the same link

Maybe you are looking for

  • [BIP Report] Could I use 'like' syntax inside if-then-else statement?

    I have the following contents in my xml, I would like to show the amount of the ChargeAmount, only if the "Code" is starting from "WAF"in my table. <Transaction>      <Account>A</Account>      <ChargeAmount>200</ChargeAmount>      <Code>WAF020</Code>

  • EPM 11.1.1 product interaction

    Hi all, I'm pretty new to hyperion Please explain me about interaction within EPM 11.1.1 products. 1. What are the differences between EPM application types (consolidation, planning, essbase, profitability)? Just dimension set? 2. Essbase application

  • Portal url redirection....

    Hi All, our portal is going for migration. so we want our users not to enter into our portal. for that we want to show some message when user enters the url. some message like a"portal is under maintenance please login after some time" this should co

  • Solaris 7 ldap client setup

    Hi, Please any one can help me in setting ldap client for solaris 7 guidelines or any website or docs help. Thanking you, Naren

  • Save rather than print with Reader 10.1.3

    Using Windows 7 x64 and Reader 10.1.3; when trying to print I am offered the print set-up page but when I press 'print' it saves a file in a folder. Other applications print ok. Any ideas .... it is as if it always prints to file?