Drop down in ALV for Webdynpro ABAP

Hi Experts,
I was trying to implement one Web dynpro ABAP application that will show one ALV and ALV will content one dropdown so that user can select data from the drop down. Addtion to that, my dropdown should have data based on another column of ALV.
I have followed one article which is available in Net.
At the end of development, ALV is displayed with dropdown. Also dropdown has data binded. However, no data is visible in dropdown.
I have created one context node having four dictionary element and one elemt for dispplaying the dropdown.
In the DoInit method of view, i have written below code:
Data Declaration
  DATA:
        lo_node_cskt  TYPE REF TO if_wd_context_node,
        lo_el_cskt    TYPE REF TO if_wd_context_element,
        ls_cskt       TYPE wd_this->element_cskt,
        lt_cskt       TYPE wd_this->elements_cskt,
        lo_cmp_usage  TYPE REF TO if_wd_component_usage,
        lv_value      TYPE REF TO cl_salv_wd_config_table,
        lr_column     TYPE REF TO cl_salv_wd_column,
        lr_drdn       TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
        ls_value_set  TYPE wdr_context_attr_value,
        lv_tabix      TYPE sy-tabix,
        lv_count(2)  TYPE c,
        lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
Navigate from <CONTEXT> to <CSKT> via lead selection:
  lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
get element via lead selection
  lo_el_cskt = lo_node_cskt->get_element( ).
Get Data:
  SELECT kokrs kostl datbi ktext FROM cskt  INTO CORRESPONDING FIELDS OF TABLE lt_cskt.
  lv_count = 0.
Populate value set
  LOOP AT lt_cskt INTO ls_cskt.
    lv_tabix = sy-tabix.
    CLEAR ls_cskt-ktext.
    DO 3 TIMES.
      lv_count = lv_count + 1.
      CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
      CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
      if lv_tabix = 2.
       if sy-index = 2.
         EXIT.
       endif.
      endif.
      APPEND ls_value_set TO ls_cskt-valueset.
    ENDDO.
    MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
  ENDLOOP.
Bind data
  lo_node_cskt->bind_table( lt_cskt ).
Instantiate ALV
  lo_cmp_usage = wd_this->wd_cpuse_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
  lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
Bind Data to Interface Controller Node
   lo_interfacecontroller->set_data(
        r_node_data = lo_node_cskt
Get ALV reference table
   lv_value = lo_interfacecontroller->get_model( ).
Make KTEXT column as drop down
   CALL METHOD lv_value->if_salv_wd_column_settings~get_column
   EXPORTING
     id = 'KTEXT'
   RECEIVING
     value = lr_column.
Create Object for Drop down
  CREATE OBJECT lr_drdn
   EXPORTING
     selected_key_fieldname = 'KTEXT'.
  CALL METHOD lr_drdn->set_valueset_fieldname
  EXPORTING
    value = 'VALUESET'.
  CALL METHOD lr_drdn->set_type
  EXPORTING
    value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
  CALL METHOD lr_column->set_cell_editor
  EXPORTING
    value = lr_drdn.
  CALL METHOD  lv_value->if_salv_wd_table_settings~set_read_only
  EXPORTING
    value = abap_false.
I am still finding the answer why data in drop down is not visible. However, I can select by clicking dropdown and blank elements (since data is not visible) can be selected.

Hey
i am using  the same code except i have just modified little bit the select statement to restrict the number of entries.
and also besides writing the code in wddoinit i have added the compenent usage of alv component and added the node
having the structure ckst and after that deleting the dictionary reference to add the attribute valueset in both places
component controller and view controller and mapped them and mapped the data node of interface controller of comp
usage to this node in comp contrlr.
and adding the view container and embeding table view of alv comp there.
that's it
and here is the code which is almost same as yours except small change in select statement.
method WDDOINIT .
  DATA:
lo_node_cskt TYPE REF TO if_wd_context_node,
lo_el_cskt TYPE REF TO if_wd_context_element,
ls_cskt TYPE wd_this->element_cskt,
lt_cskt TYPE wd_this->elements_cskt,
lo_cmp_usage TYPE REF TO if_wd_component_usage,
lv_value TYPE REF TO cl_salv_wd_config_table,
lr_column TYPE REF TO cl_salv_wd_column,
lr_drdn TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
ls_value_set TYPE wdr_context_attr_value,
lv_tabix TYPE sy-tabix,
lv_count(2) TYPE c,
lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
* Navigate from <CONTEXT> to <CSKT> via lead selection:
lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
* get element via lead selection
lo_el_cskt = lo_node_cskt->get_element( ).
* Get Data:
SELECT kokrs kostl datbi ktext FROM cskt INTO CORRESPONDING FIELDS OF TABLE lt_cskt up to 10 rows .
lv_count = 0.
* Populate value set
LOOP AT lt_cskt INTO ls_cskt.
lv_tabix = sy-tabix.
CLEAR ls_cskt-ktext.
DO 3 TIMES.
lv_count = lv_count + 1.
CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
if lv_tabix = 2.
if sy-index = 2.
EXIT.
endif.
endif.
APPEND ls_value_set TO ls_cskt-valueset.
ENDDO.
MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
ENDLOOP.
* Bind data
lo_node_cskt->bind_table( lt_cskt ).
* Instantiate ALV
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
* Bind Data to Interface Controller Node
lo_interfacecontroller->set_data(
r_node_data = lo_node_cskt
* Get ALV reference table
lv_value = lo_interfacecontroller->get_model( ).
* Make KTEXT column as drop down
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'KTEXT'
RECEIVING
value = lr_column.
* Create Object for Drop down
CREATE OBJECT lr_drdn
EXPORTING
selected_key_fieldname = 'KTEXT'.
CALL METHOD lr_drdn->set_valueset_fieldname
EXPORTING
value = 'VALUESET'.
CALL METHOD lr_drdn->set_type
EXPORTING
value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
CALL METHOD lr_column->set_cell_editor
EXPORTING
value = lr_drdn.
CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
EXPORTING
value = abap_false.
endmethod.
thanks
sarbjeet

Similar Messages

  • OnSelect event for a Drop down UI Element in Webdynpro ABAP Select Options

    Hi Experts
    We have built our UI based on the webdynpro ABAP Select Options. We have a requirement that, when we change the value of a drop down box in the UI, I need to hide some fields. Can anybody help me out in handling of OnSelect event of a drop down box built using webdynpro ABAP Select Options. We are on SAP Netweaver 7.0 EHP1.
    Rrgards,
    Srikanth.
    Edited by: Srikanth Kancherla on Apr 29, 2010 10:43 PM

    Hi Srikanth,
    as you seem to be already aware, the component is dynamically built.
    so you would have to enhance the code that builds the element and insert a reference to a new action (enhancement) that could handle the onSelect event.
    What is it about this that you particularly want help with?
    Cheers,
    Chris

  • DROP Down By Index in Webdynpro ABAP

    Hi,
    I 've a small doubt in Drop down by Index in ABAP-Webdynpro
    I have two Dropdown, In first dropdown i have few Departmnet name for EX:- Dept1 , dept2 etc..
    based upon DEPT from first drop down i need to get  the employee deails in second dropdown.
    scenario:-
                          if i will chosse dept1 in first dropdown in second dropdown dept1 employee should populate
                         iif i will chosse dept2  in first dropdown in second dropdown dept2 employee should populate
    Thanks...
    Edited by: Rakshar on Sep 12, 2011 7:30 AM

    Hi Rakshar,
    1.  Add an onSelect event to the Dropdown 1.
    2.  In the event handler get the the selected value of Dropdown 1 from the context of the same. Based on the selected value, retrieve the data to be displayed in Dropdown 2 ( for example data from a table)
    3.  Invalidate the context for Dropdown 2
    4.  Bind the data retrieved from table to the context for Dropdown 2 by using method BIND_TABLE
    Let me know if you face any difficulty.
    Regards,
    Arpan

  • Hierarchical sequential display in ALV for webdynpro ABAP

    Hello,
    I am doing an ALV report WebDynpro for abap. I have a situation where I have to display Open Items and all the partial payments in the ALV report. In short. In summary, I have to display a Hierarchical Table of data which two different structures of data, but linked and displayed together.
    The only information I have to go about this is [Table as Hierarchy|http://help.sap.com/saphelp_nw2004s/helpdata/EN/3e/904b2624534e0db707c7314a5e1e9d/frameset.htm] in SAP Help.
    If you have any pointers for programming a Hierarchical Sequential report in Webdynpro alv that would be great. Any classes, methods etc I can use or , how I can do bindings to the context etc...
    Thank you for all your help.
    Sumit.

    Hello,
    I am doing an ALV report WebDynpro for abap. I have a situation where I have to display Open Items and all the partial payments in the ALV report. In short. In summary, I have to display a Hierarchical Table of data which two different structures of data, but linked and displayed together.
    The only information I have to go about this is [Table as Hierarchy|http://help.sap.com/saphelp_nw2004s/helpdata/EN/3e/904b2624534e0db707c7314a5e1e9d/frameset.htm] in SAP Help.
    If you have any pointers for programming a Hierarchical Sequential report in Webdynpro alv that would be great. Any classes, methods etc I can use or , how I can do bindings to the context etc...
    Thank you for all your help.
    Sumit.

  • How to use traffic lights concept in alv in webdynpro abap

    Hai ,
              How to use traffic lights concept for alv in webdynpro abap. If possible give me some code.

    Hi Ravi,
    You can create ICON  to get traffic light.
    Go through this step by step.. in this example
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?quicklink=index&overridelayout=true
    Please go through this...
    Re: Display ICON in the ALV table column
    Re: Image in ALV
    cheers,
    Kris.

  • How does one come to know this..drop down in ALV in WD

    Hello Friends,
                          I had a requirement of adding a drop down in ALV, i eventually got it but I have some questions about it
    I used the following code and got the drop down
    lr_column = lr_column_settings->get_column( 'BWART' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'BWART'.
      lr_column->set_cell_editor( lr_input_field ).
    DATA : LR_DROPDOWN TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
    CREATE OBJECT LR_DROPDOWN EXPORTING SELECTED_KEY_FIELDNAME = 'BWART'.
    LR_COLUMN->SET_CELL_EDITOR( LR_DROPDOWN ).
    DATA: LT_VALUESET TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE,
    LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE,
    LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
    LR_NODEINFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
    LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'RETURN_NODE' ).
    LR_NODEINFO = LR_NODE->GET_NODE_INFO( ).
    LS_VALUESET-VALUE = '973'.
    LS_VALUESET-TEXT = '973'.
    APPEND LS_VALUESET TO LT_VALUESET.
    LS_VALUESET-VALUE = '222'.
    LS_VALUESET-TEXT = '222'.
    APPEND LS_VALUESET TO LT_VALUESET.
    LR_NODEINFO->SET_ATTRIBUTE_VALUE_SET( EXPORTING NAME = 'BWART' VALUE_SET = LT_VALUESET ).
    My question is ... how does 1 know which class to use? how to use that class... most of concepts about OOPS are clear.. but i still cant figure out how does 1 find out which class to use.. is it all by expericence..

    In short: Yes, by experience. Then again, for WD4A there is a class for each UI-Element available. Once you know this, you can easily search se24 for CLWD<UI-NAME>* or the like.

  • Drop down list in web-dynpro abap

    Hi friend,
    i want to drop down list in WEB-DYNPRO abap kindly give me one example .
    regards
    vikash

    Suppose you have created a DropDownByIndex on your screen & bound its "Texts" attribute to a context attribute by name DROPDOWN then you can put the below coding into your WDDOINIT method to fill the values to be displayed:
    METHOD wddoinit .
      DATA: lv_node TYPE REF TO if_wd_context_node,
            lt_texts TYPE if_main=>elements_dropdown,
            wa_texts TYPE if_main=>element_dropdown.
      lv_node = wd_context->get_child_node( name = 'DROPDOWN' ).
      wa_texts-application = ' '.
      APPEND wa_texts TO lt_texts.
      wa_texts-application = 'MS Word'.
      APPEND wa_texts TO lt_texts.
      wa_texts-application = 'MS Excel'.
      APPEND wa_texts TO lt_texts.
      wa_texts-application = 'Notepad'.
      APPEND wa_texts TO lt_texts.
      lv_node->bind_table( new_items = lt_texts ).
    ENDMETHOD.
    Suppose you are using a DropDownByKey & bound the "Selected Key" property to the context attribute by name TEMP then you can proceed as shown below to fill the dropdown with values:
    data: lr_node_info type ref to if_wd_context_node_info,
            wa_value_set type wdr_context_attr_value,
            lt_value_set type table of wdr_context_attr_value.
      lr_node = wd_context->get_child_node( name = 'NODE' ).
      lr_node_info = lr_node->get_node_info( ).
      wa_value_set-value = '1'.
      wa_value_set-text  = 'One'.
      insert wa_value_set into table lt_value_set.
      wa_value_set-value = '2'.
      wa_value_set-text  = 'Two'.
      insert wa_value_set into table lt_value_set.
      wa_value_set-value = '3'.
      wa_value_set-text  = 'Three'.
      insert wa_value_set into table lt_value_set.
      lr_node_info->set_attribute_value_set( name      = 'TEMP'
                                             value_set = lt_value_set ).
    Regards,
    Uday
    Go through the Web Dynpro component DEMO_UIEL_STD_SELECTION for a working example of DropDownByKey & DropDownByIndex

  • Is there something wrong with with "Floorplan Manager for WebDynpro Abap"

    Hi,
    Seems like there may be something wrong with the forum
    [SAP Community Network Forums » SAP Solutions » Floorplan Manager for WebDynpro Abap |;
    no-one has got any p0ints (sorry for break but auto guideline logic is stopping the post) in the last 30 days - and it doesn't seem to be for lack of trying...
    [ref to thread where person claims not to be able to r3ward|;
    is this normal?
    Cheers,
    Chris

    Hello,
    And another thread in the same forum,
    [Thread: Change Close button translation in FPM screen  |Change Close button translation in FPM screen;
    where the person closing the thread has stated
    P.S. I did not see radio buttons for rewarding points. I don't how to do it then
    seems like there is some problem in this forum.
    Could you please investigate?
    Thanks,
    Chris

  • Why do we go for Webdynpro ABAP?

    Hi All,
             Why do we go for Webdynpro ABAP and How is it beneficial comparing with other technologies in SAP?
    Thanks
    Gopi.

    hi ,
    u may wish to like to go thru this WIKI
    http://wiki.sdn.sap.com/wiki/display/WDABAP/General+Issues#GeneralIssues-1.95
    in whch WD ABAP is compared with WD JAVA , BSP , JSP and HTMLB and mobile infrastrucutre .
    u may wish to go thru these WD ABAP tutorials :
    http://help.sap.com/saphelp_nw2004s/helpdata/en/03/0048413e466e24e10000000a155106/content.htm
    Main Topic Page:
    http://sdn.sap.com/irj/sdn/nw-wdabap#section2
    Tutorials for Beginners:
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    eLearning Videos:
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    go thru this quote by thomas
    The designers of WDA didn't want to lock developers into having to create an extra model layer. One of the values of WDA is that it sits closely with the underlying business logic and data. Therefore it can easily reuse existing function modules or classes (or even contain SQL directly - although this isn't recommended).
    There are different options for playing the role of model. You could create a faceless web dynpro component. This is sometimes used in large complex Floorplan Manager applications. However the cross-component context binding can represent a performance problem.
    More often a class is used as a simple model. These are called feeder classes in POWL. But really any ABAP class can be used to separate out the logic for the model. Data from this class can be accessed and then bound to the local context. Sometimes people use the Assistance Class as a model. It is possible to share a single instance of an assistance class between a hierarchy of components - making it an efficient way to share data.
    Of course there are the service call wizards. These aren't really models like in WDJ. Instead they are just shortcuts to generate context structures and code generators. However everything they generate can also be created by hand or altered after generation.
    rgds,
    amit

  • Suppress entries in the drop down list box for fields Priority and Category

    Hello,
    For the transaction type 'Service Process' , I want to suppress certain values in the drop down list box for the fields Priority and Category based on certain conditions.I couldn't find a suitable badi for this scenario.
    Is there a solution so that I can control the values displayed in the drop down list box ?
    Thanks,
    Sriram
    Edited by: Sriram Sundar Rajan on Mar 17, 2008 12:15 PM

    Hello,
    For the transaction type 'Service Process' , I want to suppress certain values in the drop down list box for the fields Priority and Category based on certain conditions.I couldn't find a suitable badi for this scenario.
    Is there a solution so that I can control the values displayed in the drop down list box ?
    Thanks,
    Sriram
    Edited by: Sriram Sundar Rajan on Mar 17, 2008 12:15 PM

  • Lenovo T500 battery stays on %100 for awhile then drops down to %99 for no reason

    Hi,
    The Lenovo T500 battery stays on %100 for awhile then drops down to %99 for no reason. What's up with this and how do I fix this issue? My laptop is really confusing me. The green battery says it's totally charged %100 and the little AC adapter icon in the system tray says "%99 available (plugged in, not charging.")
    Thanks,
    Liz 

    Hello Liz,
    that is considered to be normal.
    It´s bettter for a Li-ion battery not to be charged fully, so the powermanager don´t load the whole time.
    That´s why the percentage could drop. But thats not a problem thats a feature.
    if your battery handling is set to automatic in powermanager then, eveythings is ok.
    Do you use your machine with AC plugged in the whole time?
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Drop Down in ALV  ABAP and NOT in OO - ABAP

    Hello Everyone....
    I m workin on an ALV which is in simple ABAP and not in OO-ABAP. There is some selection criteria on the first screen , as soon as the user fulfills the requirement an ALV GRID is displayed in which the last column is editable.
      But the Problem is that i wanna make that editable field in ALV as drop down which would contain values from the database table.
      Suggest me some method , so that i dont have to do much changes in my code .
      A Sample code will be very benificial .
    Thanx n Regards,
    Harpreet.

    Hi Harpreet,
    [compiled from sap online help - always a good chice]
    To make an input/output field into a list box, you must set the value L or LISTBOX in the Dropdown attribute in the Screen Painter. The visLg attribute determines the output width of the list box and the field. You can assign a function code to a list box field. In this case, the PAI event is triggered as soon as the user chooses a value from the list, and the function code is placed in the SY-UCOMM and OK_CODE fields. If you do not assign a function code, the PAI event must be triggered in the usual way – that is, when the user chooses a pushbutton or an element from the GUI status.
    If you have assigned a list box to an input/output field, you can use the Value list attribute of the screen element to determine how the value list should be compiled. There are two options:
    Value list from input help (recommended)
    If you do not enter anything in the value list attribute, the text field uses the first column displayed in the input help assigned to the screen field. The input help can be defined in the ABAP Dictionary, the screen, or a POV dialog module. It should be laid out in two columns. The key is automatically filled.
    Value list from PBO modules (not recommended).
    If you enter A in the value list attribute, you must fill the value list yourself before the screen is sent (for example, in the PBO event) using the function module VRM_SET_VALUES. When you do this, you must pass an internal table with the type VRM_VALUES to the import parameter VALUES of the function module. VRM_VALUES belongs to the type group VRM. The line type is a structure consisting of the two text fields KEY (length 40) and TEXT (length 80). In the table, you can combine possible user entries from the KEY field with any texts from the TEXT component. You specify the corresponding input/output field in the import parameter ID.
    Examples
    Example
    Dropdown box with a value list from input help (recommended)
    *& Report DEMO_DROPDOWN_LIST_BOX                                 *
    REPORT demo_dropdown_list_box.
    *& Global Declarations                                           *
    * Screen Interfaces
    TABLES sdyn_conn.
    DATA   ok_code TYPE sy-ucomm.
    * Global data
    TYPES: BEGIN OF type_carrid,
             carrid type spfli-carrid,
             carrname type scarr-carrname,
           END OF type_carrid.
    DATA itab_carrid TYPE STANDARD TABLE
         OF type_carrid WITH HEADER LINE.
    *& Processing Blocks called by the Runtime Environment           *
    * Event Block START-OF-SELECTION
    START-OF-SELECTION.
    CALL SCREEN 100.
    * Dialog Module PBO
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    * Dialog Modules PAI
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'SELECTED'.
          MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
    ENDCASE.
    ENDMODULE.
    * Dialog Module POV
    MODULE create_dropdown_box INPUT.
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
    ENDIF.
    ENDMODULE.
    The next screen (statically defined) for screen 100 is 100. The only input field on the screen is the component SDYN_CONN-CARRID. Its Dropdown attribute is set to L, and it has the output length 20. The Value list attribute is empty, and it has the function code SELECTED. The function codes of the buttons EXECUTE and CANCEL. CANCEL are defined in the GUI status as having the function type E.
    The screen flow logic is as follows:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      MODULE user_command_0100.
    PROCESS ON VALUE-REQUEST.
      FIELD sdyn_conn-carrid MODULE create_dropdown_box.
    Users cannot enter any values into the screen fields. When they choose the input field on screen 100, the system displays a list box. The Value list attribute is empty, so the system launches the input mechanism. In this case, the event block PROCESS ON VALUE-REQUEST is created in the screen flow logic. This event block controls all other mechanisms. A two-column internal table is filled in the appropriate dialog module and passed to the input help using the F4IF_INT_TABLE_VALUE_REQUEST function module. The system inserts the two columns of the table into the list box.
    When the user chooses a line in the list box, the PAI event is triggered using the function code SELECTED and the value in the first column of the internal table is copied to the input field.
    Regards,
    Clemens

  • Drop Down in ALV Flashes and Disappears.

    Hi All,
    I have a strange issue going on. In an ALV (built on CL_GUI_ALV_GRID) I have got an editable field with a drop down option.Now lets say I have 10 rows in an ALV. I chose an entry from the drop down in one of the rows (this happens OK) and immediately after that I go on a click on drop down for any other row. What happens is that the drop down for the new row that I am in flashes and disappears. Now if I click for the drop down again the drop down appears. Basically whenever an entry is selected in one of the rows, drop down function immediately after that does not work. I have a feeling that it has something to do with the data _changed event but I am not sure how to handle that event.
    I saw a similar thread  [ALV Menu Flash|ALV HANDLE_DATA_CHANGED_FINISHED; but could not figure it out.
    Any suggestions ?
    Thanks
    Anuj

    Hi,
    Let us see the code and check it
    Make the necessary changes at the fieldcatalog
    clear ls_fcat.
    ls_fcat-fieldname = 'COURSE'.
    ls_fcat-col_pos = 5.
    ls_fcat-coltext = 'Course'.
    ls_fcat-outputlen = 10.
    ls_fcat-DRDN_HNDL = 25.
    ls_fcat-edit = 'X'.
    APPEND ls_fcat to lt_fcat.
    and in the class cl_gui_alv_grid we have one method  SET_DROP_DOWN_TABLE
    and it is having one parameter called  iT_DROPDOWN of type  LVC_T_DROP
    generate the internal table and call the method set_drop_down_table
    clear ls_drop.
    ls_drop-handle = '25'.
    ls_drop-value = 'ABAP'.
    append ls_drop to lt_drop.
    clear ls_drop.
    ls_drop-handle = '25'.
    ls_drop-value = 'CRM'.
    append ls_drop to lt_drop.
    clear ls_drop.
    ls_drop-handle = '25'.
    ls_drop-value = 'WEBDYNPRO'.
    append ls_drop to lt_drop.
      CALL METHOD o_grid->set_drop_down_table
        EXPORTING
          it_drop_down       = lt_drop.
    Thanks & Regards.
    Raghunadh.K

  • Drop down by index in webdynpro

    I am using a drop down by index element in my webdynpro ABAP screen.
    I populate this drop down by fetching values through a remote-enabled function module. How do i set one particular value as default after fetching these values. ?
    I am getting the currency keys as the list of values and want to show a particular value when the view is first shown. How is this possible?
    regards,
    Priyank

    Hi Priyank,
        I have the sample code where index is used.
        This code is used for radiobutton group by index.
        You can use same logic in your requirement.
    data:
        text    type string,
        element type ref to if_wd_context_element,
        index   type string.
      DATA:
        node_check                          TYPE REF TO if_wd_context_node,
        elem_check                          TYPE REF TO if_wd_context_element,
        stru_check                          TYPE if_start_ior=>element_check ,
        item_check_attribute                LIKE stru_check-check_attribute.
      element = wd_context->get_lead_selection( ).
      index = wdevent->get_string( 'INDEX' ).
    Case when Overhead option is selected
    navigate from <CONTEXT> to <CHECK> via lead selection
      node_check = wd_context->get_child_node( name = if_start_ior=>wdctx_check ).
    get element via lead selection
      elem_check = node_check->get_element(  ).
    get single attribute
      elem_check->get_attribute(
        EXPORTING
          name =  `CHECK_ATTRIBUTE`
        IMPORTING
          value = item_check_attribute ).
    if index EQ 2.
    elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_true ).
    endif.
    if index EQ 1.
    elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_false ).
    endif.
    Hope this answer will help you.
    Cheers,
    Darshna.

  • Drop Down in ALV

    Hi,
    i have a problem to insert value in drop down list in ALV. (I want to use  this call function CALLFUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' or 'REUSE_ALV_GRID_DISPLAY)
    How can i  insert directly in ABAP 3 value. Example of code you can test this :
    report ZCO_AFFACT_TEST.
    * type pools
    TYPE-POOLS: SLIS.
    * declarations for alv and internal tables
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
    WA_FIELDCAT TYPE LVC_S_FCAT,
    WA_LAYOUT TYPE LVC_S_LAYO,
    V_POSITION TYPE I ,
    LS_CELLCOLOR TYPE LVC_S_SCOL,
    L_INDEX TYPE SY-TABIX.
    DATA: BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN,
    POSNR LIKE VBAP-POSNR,
    flag  LIKE ztypfac-flag,
    CELLCOLOR TYPE LVC_T_SCOL,
    END OF IT_VBAP.
    * start of selection
    start-of-selection .
    *---get data from db table
    perform get_data .
    *---build layout for alv
    perform build_layout .
    *---build fieldcat for alv
    perform build_fieldcat .
    *---modify fieldcat for colors in alv
    Perform modify_fieldcat .
    *---display alv
    perform display_alv .
    *& Form get_data
    FORM get_data .
    SELECT VBELN
    POSNR
    UP TO 25 ROWS
    INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
    FROM VBAP.
    ENDFORM. " get_data
    *& Form build_fieldcat
    FORM build_fieldcat .
    WA_FIELDCAT-FIELDNAME = 'VBELN'.
    WA_FIELDCAT-REPTEXT   = 'VBELN'.
    WA_FIELDCAT-edit      = 'X'.
    WA_FIELDCAT-drdn_hndl = '1'. "I have had
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'POSNR'.
    WA_FIELDCAT-REPTEXT = 'POSNR'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'FLAG'.
    WA_FIELDCAT-REPTEXT = 'FLAG'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. " build_fieldcat
    *& Form build_layout
    FORM build_layout .
    WA_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
    WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM. " build_layout
    *& Form modify_fieldcat
    FORM modify_fieldcat .
    LOOP AT IT_VBAP.
    L_INDEX = SY-TABIX.
    if l_index = 5 or l_index = 15.
    LS_CELLCOLOR-FNAME = 'VBELN'.
    LS_CELLCOLOR-COLOR-COL = '6'.
    LS_CELLCOLOR-COLOR-INT = '1'.
    APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
    MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
    endif.
    if l_index = 10 or l_index = 20.
    LS_CELLCOLOR-FNAME = 'VBELN'.
    LS_CELLCOLOR-COLOR-COL = '4'.
    LS_CELLCOLOR-COLOR-INT = '1'.
    APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
    MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
    endif.
    if it_vbap-VBELN is initial .
    delete it_vbap.
    endif.
    ENDLOOP.
    ENDFORM. " modify_fieldcat
    *& Form display_alv
    FORM display_alv .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    I_CALLBACK_PROGRAM  = SY-REPID
    IS_LAYOUT_LVC       = WA_LAYOUT
    IT_FIELDCAT_LVC     = IT_FIELDCAT
    TABLES
    T_OUTTAB = IT_VBAP .
    ENDFORM. " display_alv
    Thank you for your answers!
    Edited by: Emilien P. on Jun 30, 2010 10:42 AM

    Finaly i have user OO because all the example use the Object...
    With my old ALV i have used User command and Hotspot, it is very easy to use.
    Now with the OO i have a problem to manage the hot spot and a cell, when i am in mode debug /h when i click on the cell with the hotspot nothing happen !!! I don't undertand what is missing
    report ZCO_AFFACT_TEST.
    Tables : VBRK, VBRP,ZTYPFAC.
    *-- Global data definitions for ALV
    *--- ALV Grid instance reference
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .
    *--- Name of the custom control added on the screen
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV' .
    *--- Custom container instance reference
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .
    *--- Field catalog table
    DATA gt_fieldcat TYPE lvc_t_fcat .
    *--- Layout structure
    DATA gs_layout TYPE lvc_s_layo.
    types : begin of wls_facture,
           ...        END OF wls_facture.
    types : begin of wls_resultat,
          ...        END OF wls_resultat.
    data : wlt_facture type TABLE OF wls_facture,
           wls_facture type          wls_facture,
           wlt_final   type TABLE OF wls_resultat,
           wls_final   type          wls_resultat.
    PERFORM BUILD_DATA.
    PERFORM display_alv.
    end-of-selection.
    call SCREEN 1000.
    "display_alv OUTPUT
    *&      Form  display_alv
    *       text
    FORM display_alv .
      IF gr_alvgrid IS INITIAL .
    *----Creating custom container instance
        CREATE OBJECT gr_ccontainer
          EXPORTING
            container_name              = gc_custom_control_name
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6.
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
    *----Creating ALV Grid instance
        CREATE OBJECT gr_alvgrid
          EXPORTING
            i_parent          = gr_ccontainer
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            others            = 5.
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
    *----Preparing field catalog.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
    *----Preparing layout structure
        PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_drilldown_values.
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
        CALL METHOD gr_alvgrid->set_table_for_first_display
            EXPORTING
         is_layout                     = gs_layout
            CHANGING
          it_outtab                    = wlt_final
          it_fieldcatalog              = gt_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4 .
        IF sy-subrc <> 0.
    *--Exception handling
        ENDIF.
      ELSE .
        CALL METHOD gr_alvgrid->refresh_table_display
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2 .
      ENDIF .
    ENDFORM .                    "display_alv
    If anybody  have an idea Thanks a lot !
    Emilien
    Edited by: Emilien P. on Jul 1, 2010 4:21 PM

Maybe you are looking for

  • After updating Airport software, Macbook will not boot

    I see others have updated with the new Airport software without incident, but not me. I just ran software update to install the Airport update (hoping it would cure the problem I've had -- and other users as well -- with the connection dropping every

  • LOV issue in af:query

    Hi, I have a "Type" attribute (LOV) in the VO which saves the code in the DB and displays the description. I have built a Defined a view Criteria for this "Type" attribute. When i use this in the af:query component this attribute is displayed as Inpu

  • Integration Builder execution

    Hi all,   what is the order of execution in runtime configuration(Directory)? Does interface determination happen before receiver determination and receiver agreement or is it a bottom up order?? -Teresa

  • SAP Tools vs. SQLTrace and TKPROF

    Experts, First let me say that I am NOT an oracle expert, I am a basis person.  Such is the reason I come seeking wisdom. We are undergoing somewhat of a knee-jerk performance analysis, based on some user complaints.  Our new-to-the-organization dba

  • Development Work

    Hi, I am in need of some help building a simple app using the SDK Collaboration Builder for use in Adobe Connect. Does anyone do contract work for this sort of thing?