Implemening Context Menus in ALV table View

Hi experts,
I'm trying to implement a context menu in an ALV Grid table view in web dynpro. It should be able to list a number of possible actions depending on the selected line (like "Move this item to an other folder").
How can I hook such events to that ALV view?
Thank you!
Kai

Gaurav Srivastava, you sent a link for classic dynpro.  This functionality will not work at all with Web Dynpro.
I'm not sure that you can hook a context menu into the ALV because the ALV is a separate component usage and you can't register a context menu in your views for the inner ALV Component.  If any such functionality existed it would be exposed via the CL_SALV_WD_CONFIG_TABLE API.  I scanned it and didn't see anything off hand that would provide such functionality, but you might want to give it a look anyway.

Similar Messages

  • ALV pop-up via ALV table view

    Hello Folks,
    I have an ALV table view, after selecting any line item in the view i have button "DETAIL" which would pop up another view with the details in ALV view again.
    I have done the below steps but iam unable to get the alv pop-up with details. I would really appreciate if anyone can help me with this.
    My main view <i>V_OVERVIEW</i> is the initial Table view and i have created another View <i>V_POPUP</i> which just has a Viewcontainer. <i>V_OVERVIEW</i> is embeded in window <i>W_MAIN</i> and <i>V_POPUP</i> is embeded in <i>W_POPUP</i>.
    The view V_POPUP has the following code in its MODIFYVIEW method.
    DATA:node_wage TYPE REF TO if_wd_context_node,
           node_detail type ref to if_wd_context_node,
           lt_sltd_elmnts TYPE wdr_context_element_set,
           lr_element TYPE REF TO if_wd_context_element,
           wa_detail TYPE if_v_pop_up=>element_wage_benefit,
           it_detail TYPE if_v_pop_up=>elements_wage_benefit.
      data : lt_ssn type table of ZUT_XFERRED_SSN,
             lt_return type table of bapiret2.
      node_wage = wd_context->get_child_node( 'WAGE_BENEFIT' ).
      lt_sltd_elmnts = node_wage->get_selected_elements( abap_true ).
      lr_element->get_static_attributes(
        IMPORTING static_attributes = wa_detail ).
      CALL FUNCTION 'ZZ_GET_DETAIL'
        EXPORTING
          i_ob_key = objectkey
          i_quarter  = -quarter
        TABLES
          T_DTL  = lt_dtl
          T_RETURN   = lt_return.
      navigate from <CONTEXT> to <TP_RATES> via lead selection
      node_detail = wd_context->get_child_node( name =
                       ig_componentcontroller=>wdctx_ssn_details ).
      node_detail->bind_elements( new_items = lt_dtl ).
    The main View V_OVERVIEW has the button "DETAIL" which calls the window W_POPUP to show view V_POPUP embeded in it as a popup, here is the code in the Button handler
    DATA:
        l_api_main TYPE REF TO if_wd_view_controller,
        l_window_manager TYPE REF TO if_wd_window_manager,
        l_popup TYPE REF TO if_wd_window,
        l_cmp_api TYPE REF TO if_wd_component.
    * Pop to confirm
      CLEAR : l_api_main, l_cmp_api,
              l_window_manager, l_popup.
      l_api_main = wd_this->wd_get_api( ).
      l_cmp_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
      l_popup = l_window_manager->CREATE_WINDOW(
      WINDOW_NAME = 'W_POP_UP'
      TITLE = 'Details' ).
      l_popup->open( ).

    hey folks nevermind i got it.
    Thanks

  • Define F-Code for ALV Button & context menu for ALV table

    Hi,
    I have some Buttons in ALV Toolbar like for example 'copy row'. Is it in browser environment possible to assign f-code to the button? Like by pushing e.g. F4 the method for 'copy row' action is fired?
    Or additionaly, is it possible to define a custom context menu in alv table?
    Thanks in advance,
    Tan

    Hi Tan,
    This Functionality is working on..Pelase check this...
    Re: How to improve Web accessibility with Function keys
    Re: Hot key(Ctrl+F1) for More field help not working
    Re: GUI Status?
    For help..
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b951297a6d2d65e10000000a42189c/content.htm
    Cheers,
    Kris.
    Edited by: kissnas on Jun 21, 2011 11:46 AM

  • How to create a context menu in ALV table cell editor(Webdynpro abap )

    Hello Experts,
    I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
    The code snippet below:
      "Create menu for each coloumn
      create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
          id = 'MITM_ACTIONS'.
      lo_menu_actions->set_visible( value = abap_true ). 
      lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
      "ADd menu items
      CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
      exporting
        id = 'MITM_CREATE_EXPRESSION'.
      lo_menu_item_create->set_visible( value = abap_true ).
      lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
      "Add item 1
      lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ). 
      "  Set the cell editor for each column cell(link to an action)
      LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
        lv_column_name = ls_node_dec_tab_cols-object_name.
        lr_column = lr_column_settings->get_column( lv_column_name ).
       "Create 'lta' Ui item
        CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
        lo_lta->set_menu( value = lo_menu_actions ).
        lo_lta->set_text_fieldname( lv_column_name ).
        lr_column->set_cell_editor( lo_lta ).
        IF ls_node_dec_tab_cols-is_result EQ abap_true.
          lr_column->set_cell_design( value =
                      cl_wd_table_column=>e_cell_design-key_medium ).
        ENDIF.
      ENDLOOP.

    Hi Prakash,
    I have not come across this requirement till now to have context menu in a cell editor of alv.
    Unfortunately  the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
    If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
    Regards,
    Rama

  • Replacing SAP Object Selector with Radio Button in ALV table in WD ABAP

    Hi All,
    I have a view in Webdynpro ABAP which displays data in an ALV table view (using SALV_WD_TABLE component).
    By default we have the SAP Object Selector for selecting a particular row of the table. This has to be replaced with radio buttons.
    I mean instead of using the SAP Object Selector, I need radio buttons at the start of each row.
    What I have thought of is to make the SAP Object Selector Invisible and create another attribute for the radio button in the node which contains ALV output data.
    Can you please let me know how to remove the SAP Object Selector from ALV output table and also how to include a column with radio button in the ALV output table.
    Thanks and Regards,
    Sayan Ghosh

    Hi Lekha,
    I am working with HRASR00_PROCESS_EXECUTE WD component of MSS application. In order to generate the data, this in turn calls another component called DATAOBJECTPROVIDER. I need to make the table selection as none and replace the SAP Object Selector with the radio button.
    Do you know under which method in DATAOBJECTPROVIDER do we need make the changes. I tried to search all the methods but couldnt understand a suitable one.
    Thanks and Regards,
    Sayan Ghosh

  • Embeding ALV table in dynamically created view container UI element

    Hi ,
    I created a view container UI element dynamically .that is working fine . I am using standard ALV component . Now i want to embed ALV table in View container UI element dynamically > please help me in this .
    Thanks in advance ,
    Vijay vorsu

    Hi,
    I am not sure how to do add an ALV table dynamically but you can have a look at this blog which talks about creating and adding a TABLE ui element dynamically. And TABLE UI element may solve your problem.
    http://mamma1360.blog.163.com/blog/static/314740992008127115551165/
    Thanks,
    Abhishek

  • The reference to the table, view or sequence is not allowed in this context

    Hi,
    I'm triying to execute the SP that I describe below and the OS give me an error:
    CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
        TBL_NAME VARCHAR2,
        START_DATE DATE,
        RESULT_ OUT NUMBER
      ) AS
      BEGIN
      DECLARE
        v_tbl_name VARCHAR2(30);
        v_start_date DATE;
        v_result NUMBER := 0;
        v_select_aux VARCHAR2(32767) := ' ';
        v_temp_table VARCHAR2(30);
        v_exists NUMBER;
      BEGIN
        v_tbl_name := TBL_NAME;
        v_start_date := START_DATE;
        v_temp_table := 'temp_' || v_tbl_name;
        SELECT count(*) INTO v_exists FROM tab WHERE lower(tname) = lower(v_temp_table);
        IF (v_exists = 1) THEN
          v_select_aux := '
            DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
          EXECUTE IMMEDIATE (v_select_aux);
          COMMIT;
        END IF;
        v_select_aux := 'CREATE TABLE ' || v_temp_table || ' AS
                                  SELECT ch.date_ month_revenue,
                                       s.date_sub month_sub,
                                       s.codpromoter,
                                       u.OPERATOR,
                                       SUM (ch.total) AS TOTAL_OK
                                       FROM cscv_sub_charges_' || to_char(v_start_date, 'YYYY_MM')|| ' ch
                                       INNER JOIN cscv_subs s
                                       ON ch.id_sub = s.ID
                                       INNER JOIN cscv_users u
                                       ON s.id_user    = u.ID
                                WHERE ch.STATUS = 0
                                GROUP BY ch.date_, s.date_sub, s.codpromoter, u.OPERATOR';
        EXECUTE IMMEDIATE (v_select_aux);
        COMMIT; 
         v_select_aux := '
    INSERT INTO ' || v_tbl_name || ' (
             month_revenue,
             month_sub,
             codpromoter,
             operator,
             TOTAL_0,
             TOTAL_1,
             TOTAL_2,
             TOTAL_3,
             TOTAL_4,
             TOTAL_5,
             TOTAL_6,
             TOTAL_7,
             TOTAL_8,
             TOTAL_9,
             TOTAL_10,
             TOTAL_11
            SELECT
             month_revenue,
             month_sub,
             codpromoter,
             operator,
             TOTAL_0,
             TOTAL_1,
             TOTAL_2,
             TOTAL_3,
             TOTAL_4,
             TOTAL_5,
             TOTAL_6,
             TOTAL_7,
             TOTAL_8,
             TOTAL_9,
             TOTAL_10,
             TOTAL_11
            FROM
               SELECT
                  month_revenue,
                  month_sub,
                  codpromoter,
                  operator,
                  sum(total_ok) total_0,
                  0 total_1,
                  0 total_2,
                  0 total_3,
                  0 total_4,
                  0 total_5,
                  0 total_6,
                  0 total_7,
                  0 total_8,
                  0 total_9,
                  0 total_10,
                  0 total_11
                 FROM '|| v_temp_table ||'
              WHERE to_char(month_sub,''mm/yyyy'') = to_char(sysdate,''mm/yyyy'')
              GROUP BY month_revenue,month_sub,codpromoter, operator
              UNION ALL
              SELECT
                  month_revenue,
                  month_sub,
                  codpromoter,
                  operator,
                  0,
                  sum(total_ok),
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                 FROM '|| v_temp_table ||'
              WHERE to_char(month_sub,''mm/yyyy'') = to_char((to_date(sysdate,''dd/mm/yy'') - INTERVAL ''1'' MONTH),''mm/yyyy'')
              GROUP BY month_revenue,month_sub,codpromoter, operator
            GROUP BY month_revenue,
             month_sub,
             codpromoter,
             operator
        EXECUTE IMMEDIATE (v_select_aux);
        v_result := v_result + SQL%ROWCOUNT;
        COMMIT;
        v_select_aux := '
          DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
        EXECUTE IMMEDIATE (v_select_aux);
        COMMIT;
        RESULT_ := v_result;
      END;
      END P_CSCV_AGR_MONTH_REVENUE;
    BEGIN
    DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
    END;
    /and the output is:
    Error at line 1
    ORA-06550: líne 2, column 32:
    PLS-00357: The reference to the table, view or sequence 'CSCV_AGR_MONTH_REVENUE'  is not allowed in this context
    ORA-06550: líne 2, column 1:
    PL/SQL: Statement ignoredwhat could I do to resove the problem??
    Thanks in advance...

    Hi,
    Your procedure's signature is
    CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
    TBL_NAME VARCHAR2,
    START_DATE DATE,
    RESULT_ OUT NUMBER
    ) i.e. it is expecting two input parameters, TBL_NAME in VARCHAR2 format and the other START_DATE in DATE format. Also you need a variable with data type as NUMBER to hold the value of OUT parameter RESULT_
    Now look at the way you are calling this procedure
    BEGIN
    DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
    END;
    /first parameter has to be a VARCHAR2, so enclose CSCV_AGR_MONTH_REVENUE into single quotes.
    second parameter should be a date, so use to_date() function.
    Lastly declare a variable with data type as Number for holding value of out parameter RESULT_
    Something like this :
    declare
    t_num number;
    begin
    a('CSCV_AGR_MONTH_REVENUE',to_date('01/01/2010','MM/DD/YYYY'),t_num);
    dbms_output.put_line(t_num);
    end;Vivek L

  • Table View with Multiple Context Nodes

    I want to create a table-view consisting of an object composition, e.g. multiple business objects. The chtml:configCellerator -tag supports just one context node which corresponds to just one business object.
    How do you create a table composed by different objects, i.e. BTAdminH and BTAdminI ?
    Edited by: romanglass on May 18, 2010 4:07 PM

    Hi,
    I would suggest to create a new component and not to disturb the standard ones. Because the super class of the header context node (BTAdminH in your case) must be inherited from CL_BSP_WD_CONTEXT_NODE_DTV - Deep table view.
    The dependent nodes must be passed to return parameter rt_result of method GET_SUB_CNODE_DEFINITIONS.
    This cant be done via wizard. I just tried to replicate your scenario. Below are the steps,
    1. create a view with context node BTADMINH as tableview. Then change the super class of the context node to   CL_BSP_WD_CONTEXT_NODE_DTV.
    2. Add another context node BTADMINI and mark it as dependent to BTADMINH.
    3. Now change the super class of context node BTADMINI to CL_BSP_WD_CONTEXT_NODE_TV  (Table View).
    4. Redefine method GET_SUB_CNODE_DEFINITIONS in context node BTADMINH.
    In the view layout you should use cellerator and pass an iterator with interface IF_THTMLB_CELLERATOR_ITERATOR. The interface has a method RENDER_DEPENDANT_OBJECTS which returns the table of dependant objects.
    Regards,
    Arun
    Edited by: Arun Kumar on May 19, 2010 1:01 PM

  • PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context

    Hello
    I am accepting input values from users through java web page. To accept the values I am using the following code:
    import java.sql.*;
    import javax.sql.DataSource;
    import javax.naming.*;
    public class spsrch
         public void spsrch()
         public String espsrch(String p, String d, String a)
              String s1= "";
              String strColor="#C0C0C0";
              try
                   InitialContext ctx = new InitialContext();
                   DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Oracle9i");
                   Connection Con = ds.getConnection();
                   Statement stmt = Con.createStatement();
                   CallableStatement proc1stmt1=Con.prepareCall ("{call Allsch("+p+","+d+")}");
    //               ResultSet rs = proc1stmt1.execute();
                   proc1stmt1.executeUpdate();
                   Con.close();
              catch(Exception e)
                   System.out.println("Flag Raised"+e);
              return s1;
    I am calling the procedure 'Allsch' to apply some logic before inserting data into a SQL table.
    The 'Allsch' procedure is :
    create or replace procedure tmpsch(pno varchar2,pdes varchar2) as
    mpartnum varchar2(30);
    mpn varchar2(30);
    mdes varchar2(150);
    cursor c1 is select partnum,description,aircraft_type from master_catalog where description like ltrim(rtrim(mdes))||'%' AND partnum like mpn||'%';
    cursor c2 is select partnum from ipc_master where partnum=mpartnum;
    cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
    cursor c4 is select partnum from superparts where partnum=mpartnum;
    cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
    mpno1 varchar2(30);
    mpno2 varchar2(30);
    mpno3 varchar2(30);
    mpno4 varchar2(30);
    mpno5 varchar2(30);
    mdescription varchar2(150);
    maircraft_type varchar2(15);
    mstat varchar2(1);
    mstat1 varchar2(30);
    mstat2 varchar2(30);
    mstat3 varchar2(30);
    mstat4 varchar2(30);
    begin
    mstat:='N';
    mpn:=pno;
    mdes:=pdes;
    for i in c1 loop
    mstat:='N';
    mstat1:='N';
    mstat2:='N';
    mstat3:='N';
    mstat4:='N';
    mpno1:=i.partnum;
    mpartnum:=i.partnum;
    mdescription:=i.description;
    maircraft_type:=i.aircraft_type;
    for j in c2 loop
    mpno2:=j.partnum;
    end loop;
    for k in c3 loop
    mpno3:=k.partnum;
    end loop;
    for l in c4 loop
    mpno4:=l.partnum;
    end loop;
    for m in c5 loop
    mpno5:=m.part_no;
    end loop;
    if mpno2=mpartnum then
    mstat1:=mpno2;
    end if;
    if mpno3=mpartnum then
    mstat2:=mpno3;
    end if;
    if mpno4=mpartnum then
    mstat3:=mpno4;
    end if;
    if mpno5=mpartnum then
    mstat4:=mpno5;
    end if;
    if mpno1=mpartnum then
    mstat:='Y';
    insert into tmpcat values(mpno1,mdescription,maircraft_type,mstat1,mstat2,mstat3,mstat4);
    end if;
    end loop;
    end;
    Java program compiling time, it not showing any error. But after executing, it is not inserting any data into 'tmpcat' table and throwing the following error :
    Flag Raisedjava.sql.SQLException: ORA-06550: line 1, column 14:
    PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    [07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
    code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
    [07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
    code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
    Any one please help me to solve the issue.
    With thanks
    Pramod kumar.
    My Email-id is : [email protected]

    What are p and d in
    "{call Allsch("+p+","+d+")}"
    Something tells me you might need some quotes in this statement since they are varchar2. Maybe
    "{call Allsch('"+p+"','"+d+"')}"
    If this doesn't work try to cut off parts of the procedure until it works.
    Mike

  • ALV: how to save context space for large tables ?

    Dear collegues,
    We are displaying an ALV table that is quite large. Therefore, the corrsponding DDIC structure and the WD context is large. This has an impact on performance and the load size of the program. Now we will enhance the ALV table again.
    Example: for an icon and its explaining tooltip that are displayed in the ALV: there is are context fields required like "SOURCE_FIELDNAME" for the tooltip as well as for for the icon. They need a lot of characters for each tooltip and icon).
    Question: do you have an idea, how to save context space for those ALV fields ?
    Best regards,
    Christian

    >We are displaying an ALV table that is quite large.
    Do you mean quite large as in a large number of columns or as in a large number of rows (or both)?  I assume that the problem is probably more related to a large number of rows.  For very large tables, you should consider using the table instead of the ALV. For very large tables you can even use a technique called context paging to keep only a subset of the data in the context memory at a time.  Here is a recent blog that I created on the topic with demonstrations of different techniques for table sharing, shared memory, and context paging when dealing with large tables in Web Dynpro ABAP:
    Web Dynpro ABAP: How Fast Can You Consume 1 Million Rows?

  • ALV Table - inhibit 'View' dropdown, filter button and settings button

    Can someone tell me what methods need to be used to modify an ALV table to inhibit the showing of the functioniality in the header?  I want to introduce this functionality to the users at a later date, but for now it should look like a standard table.

    Hi Bob.
    Hide / add function buttons in your ALV
    You can hide all function buttons of the ALV with one of these methods.
    Set toolbar visibility to false.
    data: lr_function_settings type ref to if_salv_wd_function_settings.
    lr_function_settings ?= wd_this->r_table. lr_function_settings->set_visible( CL_WD_UIELEMENT=>E_VISIBLE-NONE ).
    set default ALV Functions off
    data: lr_standard_functions type ref to if_salv_wd_std_functions.
    lr_standard_functions ?= wd_this->r_table.
    lr_standard_functions->set_sort_headerclick_allowed( ABAP_false ).
    lr_standard_functions->set_filter_filterline_allowed( ABAP_false ).
    lr_standard_functions->set_filter_complex_allowed( ABAP_false ).
    lr_standard_functions->set_sort_complex_allowed( ABAP_false ).
    You can set individual functions with these methods:
    CALL METHOD cl_salv_wd_config_table=>if_salv_wd_standard_functions~set_<x>_allowed
    EXPORTING
    Value = ABAP_true.
    Where <x> is to be replaced with the property of your choice.

  • How to process Line Selection on ALV Table in ABAP WebDynpro

    Hi there,
    I have a view with an ALV table whose context node retrieves its data from a Service Call for a method.
    The method provides certain data of a database table which the ALV displays.
    Now I would like to be able to select one row of that ALV table and after pressing a button or doubleclicking on the row or whatever a different view (as for me it is also ok on the same view) should appear to display the details of that selection.
    I only need to know how to retrieve the selected data.
    Or its index within the internal table.
    I am already looking for hours for a useful thread and actually there is one which obviously is about a similar issue apart from the multiple selection part: 
    How to process multiple row selection in ALV table in Wendynpro ABAP? Help!
    but i am afraid that i don't understand it. Or at least I misunderstand it since it does not work with me.
    The system example mentioned in the thread does not help me either because it somehow does not correspond to my needs, does it?
    It would be GREAT if somebody could help me with that. Please keep it simple for I am not an expert in webdynpro yet (obviously ^^) and also please explain in detail what I have to do with the context nodes since I am not sure whether the selection is stored in my already existing node or whether I need a special one for that.
    Thanks!!
    christina

    Hi Christina,
    If you just want to get one column data of the line that user clicked, use the Web Dynpro Code Wizard to Read Context of attibute you needed, then you will get code as follow:
    * Define data for read attribute
        node_alv TYPE REF TO if_wd_context_node,
        elem_alv TYPE REF TO if_wd_context_element,
        stru_alv TYPE if_view_display=>element_alv ,
        item_column_name  LIKE stru_alv-column_name.
    * navigate from <CONTEXT> to <ALV> via lead selection
      node_alv = wd_context->get_child_node( name = if_view_display=>wdctx_alv ).
    * get element via lead selection
      elem_alv = node_alv->get_element(  ).
    * get single attribute
      elem_alv->get_attribute(
        EXPORTING
          name =  `COLUMN_NAME'
        IMPORTING
          value = item_column_name ).
    The value of column_name is stored in item_column_name.
    If you need the index that the user clicked, try this:
    * Definition of field symbol for index
      FIELD-SYMBOLS : <fs_index> TYPE data.
    * Get the selected index
      ASSIGN r_param->index->* TO <fs_index>.
    The index of clicked line is stored in field symbol <fs_index>.
    Hope it will help.
    Best Regards,
    Stephanie

  • Legend in ALV Table

    Hi all,
    Can we have a legend in ALV table.
    Basically I have different colors in different rows depending on some conidtions in the data.
    I have to show a legend giving meanings of which color stands for what condirion.
    Regards,
    Reema

    Here is a quick demo I built:
    http://www.flickr.com/photos/tjung/2922995882/
    >How can I associate the legend ID with the ALV table.
    I actually didn't do any association.  I just placed a standalone Legend with the View.
    http://www.flickr.com/photos/tjung/2923003826/
    >Moreover, after creating a legend, how to create legend items
    Just right mouse click on the legend and choose Insert Item.  You can insert single LegendItems at design time and set their color, Icon, and text.  Or you can insert a MultipleLegendItem which gets bound to a context node for more dynamic legend items.
    http://www.flickr.com/photos/tjung/2922151867/

  • F4 help for ALV table field

    Hi Experts,
    I need to implement F4 help for ALV table field.
    I my scenario, I am using two views. If we click on any record in fist view then it displays the popup window (second view) with relevant record details.
    Here one of the columns having fieldnames corresponding values (old values), for correcting old values I have created new value editable column, we can enter new value for old value then we can save it. Till this functionality is ok.
    Then I have included OVS help for new value field. Here I need to get f4 help for newvalue field relevant to fieldname.
    For example: user clicks on f4 in cell (new value) then if corresponding fieldname is u2018WERKSu2019 then it shows the plant values
    Here I can get fieldname, domain name  and value table using method set_attribute ().
    Same concept I have implemented in ALV using F4IF_FIELD_VALUE_REQUEST. It is working fine
    Here I have little bit confusion. Please advise me how to implement in OVS.
    Regards,
    BBC

    Hi,
    you'll have to create a method for the OVS search help (define it in the "OVS component usage" field in the context).
    Sample code (should work for WERKS):
    method on_ovs .
    declare data structures for the fields to be displayed and
    for the table columns of the selection list, if necessary
      types:
        begin of lty_stru_input,
      add fields for the display of your search input here
          WERKS TYPE WERKS,
        end of lty_stru_input.
      types:
        begin of lty_stru_list,
      add fields for the selection list here
          WERKS TYPE WERKS_D,
          NAME1 type NAME1,
        end of lty_stru_list.
      data: ls_search_input  type lty_stru_input,
            lt_select_list   type standard table of lty_stru_list,
            ls_text          type wdr_name_value,
            lt_label_texts   type wdr_name_value_list,
            lt_column_texts  type wdr_name_value_list,
            lv_window_title  type string,
            lv_group_header  type string,
            lv_table_header  type string,
            lv_werks type werks_d.
      field-symbols: <ls_query_params> type lty_stru_input,
                     <ls_selection>    type lty_stru_list.
      case ovs_callback_object->phase_indicator.
        when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
      in this phase you have the possibility to define the texts,
      if you do not want to use the defaults (DDIC-texts)
    Set label from Medium Description to something more logical...
          ls_text-name = `NAME1`.  "must match a field in list structure
          ls_text-value = `Plant description`.
          insert ls_text into table lt_label_texts.
    Set col header from Medium Description to something more logical...
          ls_text-name = `NAME1`.  "must match a field in list structure
          ls_text-value = `Plant description`.
          insert ls_text into table lt_column_texts.
         lv_window_title = wd_assist->get_text( `003` ).
         lv_group_header = wd_assist->get_text( `004` ).
         lv_table_header = wd_assist->get_text( `005` ).
          ovs_callback_object->set_configuration(
                    label_texts  = lt_label_texts
                    column_texts = lt_column_texts
                    group_header = lv_group_header
                    window_title = lv_window_title
                    table_header = lv_table_header
                    col_count    = 2
                    row_count    = 20 ).
        when if_wd_ovs=>co_phase_1.  "set search structure and defaults
      In this phase you can set the structure and default values
      of the search structure. If this phase is omitted, the search
      fields will not be displayed, but the selection table is
      displayed directly.
      Read values of the original context (not necessary, but you
      may set these as the defaults). A reference to the context
      element is available in the callback object.
         ovs_callback_object->context_element->get_static_attributes(
             importing static_attributes = ls_search_input ).
        pass the values to the OVS component
         ovs_callback_object->set_input_structure(
             input = ls_search_input ).
        when if_wd_ovs=>co_phase_2.
      If phase 1 is implemented, use the field input for the
      selection of the table.
      If phase 1 is omitted, use values from your own context.
          if ovs_callback_object->query_parameters is not bound.
          endif.
          assign ovs_callback_object->query_parameters->*
                                  to <ls_query_params>.
          if not <ls_query_params> is assigned.
    TODO exception handling
          endif.
            call method ovs_callback_object->context_element->get_attribute
              exporting
                name  = 'WERKS'
              importing
                value = lv_werks.
            data: lv_subcat_text type rstxtmd.
            select werks
                   name1
              into table lt_select_list
              from T001W.
            ovs_callback_object->set_output_table( output = lt_select_list ).
        when if_wd_ovs=>co_phase_3.
      apply result
          if ovs_callback_object->selection is not bound.
          endif.
          assign ovs_callback_object->selection->* to <ls_selection>.
          if <ls_selection> is assigned.
            ovs_callback_object->context_element->set_attribute(
                                   name  = `WERKS`
                                   value = <ls_selection>-werks ).
          endif.
      endcase.
    endmethod.

  • How to create a ALV table

    Hi experts,
    I have to show an ALV table with the list of errors at the end of an operation. I have two separated views for this: one view when I run the operation and, at the end of this operation, I show a button and when I click on this button I can to navigate in a second view where I show the table with the list of errors... How can I do for make this table as an ALV table?
    Tks a lot!

    You can get the changes made by user in the context. To achieve this follow the process:
    1) Enable the context change log in the init method of component controller:
    DATA: z_context TYPE REF TO if_wd_context.
    z_context = wd_context->get_context( ).
    z_context->enable_context_change_log( ).
    Then call following method in the component controller to get the context changes:
    DATA: lt_changes TYPE wdr_context_change_list.
    DATA: z_context TYPE REF TO if_wd_context.
    z_context = wd_context->get_context( ).
    lt_changes = z_context->get_context_change_log( ).
    You will get all context changes in the table lt_changes.
    Compare these values with the values before context change.
    2) You can also get the changed cells using event 'on_data_check' of ALV.
    Refer following link for more help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/frameset.htm
    I hope this will help.
    Regards,
    Saket.

Maybe you are looking for

  • FIFO based pricing issue on sales orders!

    This is the situations : All setups in the comany are for FIFO. Item Level, Item Group Level, and Company Level. 1. We purchased 1 item1 for 125 dollars. PO invoice completed. First one in FIFO layer. 2. purchased 1 more of same  item1 for 150 dollar

  • IOS 5.1 iPhone 4s Problem

    I have updated my iphone 4s with iOS 5.1, now it shows me the the iPhone written screen with slider to unlock. When the phone is unlocked it takes me to Wi-FI networks screen to select available wifi network, post selection of network, it displays Th

  • Problem with burning with Encore

    Hi I'm new at using Encore, and I need help badly! I've edited my project with Premiere Pro CS3, exported it to Encore in order to create the menus, after doing so, every time I press build, a software error comes up stating: PGC "File name" has an e

  • Shift Substitution from ESS

    Hello All, I'm looking if Shift Substitution is possible in ESS. Has anyone done this before? Our requirement is that employees should be able to change their Daily Work Schedule  to a new DWS for few days. Handling this through shift substitution fr

  • Problem with "Run Web Layout" using own template

    When I run a report (using Run Web Layout) which uses my own template (a modified version of rwblue.tdf), it outputs a plain page on the browser (as though it has no template). When running the same report (using Run Paper Layout), the output is as i