Making field as Dropdown list in ALV

Hi
This is the code for making field as dropdown list in ALV.
But wat do you mean by HANDLE here.
What is the value one indicates.
FORM prepare_drilldown_values.
DATA lt_ddval TYPE lvc_t_drop .
DATA ls_ddval TYPE lvc_s_drop .
ls_ddval-handle = '1' .ls_ddval-value = 'JFK-12' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'JSF-44' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'KMDA-53' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'SS3O/N' .
APPEND ls_ddval TO lt_ddval .
CALL METHOD gr_alvgrid->set_drop_down_table
EXPORTING
it_drop_down = lt_ddval .
ENDFORM. " prepare_drilldown_values
Regards
Sandeep Reddy

Hi,
REPORT  YMS_DROPDOWNLISTBOX.
      TYPE-POOLS : VRM.
TABLES : AFKO,AFPO,SSCRFIELDS.
DATA : BEGIN OF IAFKO OCCURS 0,
       AUFNR LIKE AFKO-AUFNR,
       END OF IAFKO.
DATA : BEGIN OF IAFPO OCCURS 0,
       MATNR LIKE AFPO-MATNR,
       END OF IAFPO.
DATA : ITAB TYPE VRM_VALUE.
DATA : VID TYPE VRM_ID.
DATA : ITAB1 TYPE VRM_VALUES  ,
       ITAB2 TYPE VRM_VALUES  .
DATA : FLAG.
PARAMETERS : P_AUFNR LIKE AFKO-AUFNR AS LISTBOX VISIBLE LENGTH 15.
INITIALIZATION.
  SELECT AUFNR FROM AFKO UP TO 10 ROWS INTO TABLE IAFKO WHERE AUFNR LIKE
  '%704%'.
  LOOP AT IAFKO.
    ITAB-KEY = IAFKO-AUFNR.
    ITAB-TEXT = IAFKO-AUFNR.
    APPEND ITAB TO ITAB1.
  ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
  VID = 'P_AUFNR'.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID              = VID
      VALUES          = ITAB1
    EXCEPTIONS
      ID_ILLEGAL_NAME = 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.
Thanks,
Sankar M

Similar Messages

  • DropDown List in ALV Grid

    Hii,
    I am showing one of my Column Cells of ALV grid as DropDown List.
    I have developed this Code for that.
    DATA : ls_drpdwn TYPE lvc_s_drop,
             lwa_holders LIKE LINE OF gt_holders,
            gt_drpdwn1 TYPE lvc_t_drop.
    FIELD-SYMBOLS : <lwa_fcat> TYPE lvc_s_fcat.
    LOOP AT lt_fcat ASSIGNING <lwa_fcat>.
      IF <lwa_fcat>-fieldname EQ 'SHNAME'.
        <lwa_fcat>-edit = 'X'.
        <lwa_fcat>-drdn_hndl = 1.
      ENDIF.
    ENDLOOP.
    LOOP AT gt_holders INTO lwa_holders.
        ls_drpdwn-handle = 1.
        ls_drpdwn-value = lwa_holders-shname.
        APPEND ls_drpdwn TO gt_drpdwn1.
         CALL METHOD ref_grid->set_drop_down_table
        EXPORTING
          it_drop_down = gt_drpdwn1.
    My Issue is How can I make my column's SHNAME cells to show Different Share Name List for different Holder's Id i.e Cell's should display dynamic List for Different Primary Keys.
    Thanks and Regards,
    Dhiraj B.

    Hi Dhiraj,
    Check this report which does exactly to your requirement : BCALV_EDIT_07.
    Thanks & Regards,
    Faheem.

  • How to extract data from xml field to dropdown list?

    Hi,
    I have designed a form and connected to a SQL server database using a web service. The XML data retrieved from wsdl connection is currently hold in a text field called 'XMLfield'. I need to extract the data such as 'PersonnelName' from XMLfield into a dropdown list. I used the following code and I do not get any error, but nothing come up and all my fields in the forms become bank when i click the dropdown list.
    I would appreciate it if anyone can help me with this issue.
    form1.DropDownList::click - (JavaScript, client)
    xfa.datasets.data.loadXML(form1.XMLfield.rawValue,0,1);
    form1.XMLfield.rawValue = xfa.datasets.data.saveXML();
    var dataGroup = xfa.resolveNode("xfa.data.Timesheet.Personnel.PersonnelName");
    var dataGroupLength = dataGroup.nodes.length;
    if (dataGroupLength == 0) {
      xfa.host.messageBox("There are no parts in the XML doc");
    else {
      for (var i=0; i < dataGroupLength; i++){
        this.addItem(dataGroup.nodes.item(i).nodes.item(0).value);
    Thanks,
    Roya

    Hi Roya,
    I think the loadXML will override your form data, so blanking out your fields.  You could try loading the xml data at the xfa.datasets level (that is xfa.datasets.loadXML(form1.XMLfield.rawValue,0,1);) or using E4X to process the XML.
    Another option though might be more rework is to use the Acrobat SOAP api which will return you a JavaScript object so you wont have to do any XML work.
    There's a good intro to the SOAP api here, http://www.avoka.com/blog/page/11/.
    Regards
    Bruce

  • Dropdown list in alv toolbar

    Hello,
    I am trying to get a dropdown column in an ALV table. While searching in the forum I now have the dropdown in thr ALV column 'VALUE' but I am not able to to get values in the column.
    I have one node called 'RES' type WDR_CONTEXT_ATTR_VALUE with the attributs VALUE and TEXT and the following coding:
    ***********************ALV INIT
      data: lr_if_controller type ref to iwci_salv_wd_table,
            lr_cmdl          type ref to cl_salv_wd_config_table,
            lr_cmp_usage     type ref to if_wd_component_usage.
    Instantiate ALV1 component
      lr_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if lr_cmp_usage->has_active_component( ) is initial.
        lr_cmp_usage->create_component( ).
      endif.
    Get reference to model
      lr_if_controller = wd_this->wd_cpifc_alv( ).
      lr_cmdl          = lr_if_controller->get_model( ).
      data: lr_col type ref to cl_salv_wd_column,
            lr_dropdown type ref to cl_salv_wd_uie_dropdown_by_key.
      create object lr_dropdown
        exporting
          selected_key_fieldname = 'VALUE'.
      lr_cmdl->if_salv_wd_table_settings~set_read_only( abap_false ).
      lr_col = lr_cmdl->if_salv_wd_column_settings~get_column( id = 'VALUE' ).
      lr_col->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( name = wd_this->wdctx_res ).
    lr_nodeinfo = lr_node->get_node_info( ).
    ls_valueset-value = '1'.
    ls_valueset-text = 'eins'.
    append ls_valueset to lt_valueset.
    ls_valueset-value = '2'.
    ls_valueset-text = 'zwei'.
    append ls_valueset to lt_valueset.
    lr_nodeinfo->set_attribute_value_set(
    exporting
    name = 'VALUE'
    value_set = lt_valueset
    data: itab_res type table of wd_this->element_res,
          stru_res type wd_this->element_res.
    append stru_res to itab_res.
    lr_node->bind_table( itab_res ).
    Anyone knows what I am doing wrong?
    regards
    Stefan

    Hi ,
    I think its not get updated because the external context mapping of the node is done at design time... so remove the design time mapping and do the dyanamic mapping .. once the attributes valueset is updated.. see the below code...
    Instantiate ALV component
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
    l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
    IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
    l_ref_cmp_usage->create_component( ).
    ENDIF.
    Pass context node to ALV
    DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    hope this will help ..............
    Regards
    Yash

  • Dropdown list in ALV

    Hi all,
    Im using container to display the ALV.
    I am passing handler and values in the dropdown.
    and in my ALV, by checking the hadler im displaying the data. Everthing seeems fine.
    I want to pass the key instead of text in the dropdown .
    what to do?
    Rgds,
    Kanal

    Hoe to do it ?
    My iternal table conatins,
    Key    value
    10        aaaa
    20        bbb
    and the value in dropdwn is
    lv_filed_cat-drdn_handle = 1
    lv_filed_cat-value = itab-value
    and the result is coming fine.
    While saving , i get an error "maximum 2 char allowed"
    Rgds,
    SAP

  • How to put dropdown list for a field in MIGO

    Hi all,
    I added a new tab in MIGO by using the BADI  MB_MIGO_BADI
    in that tab for one of the field i have to put dropdown list (some static values)
    i tried VRM_SET_VALUES , but how to pass the static values to the screen field as dropdown list.
    please help on this issue.
    Thanks,
    Satish

    Hi,
    The logic u told is right it should work.
    PROCESS ON HELP-REQUEST.
      FIELD MSEG-VENDTYPE MODULE HELP.
      PROCESS ON VALUE-REQUEST.
      FIELD MSEG-VENDTYPE MODULE HELP_VENDOR.
    MODULE HELP_VENDOR INPUT.
    *break-point.
      wa_values-key = 'M'.
    wa_values-text = 'Manufacturer'.
    append wa_values to values.
    clear wa_values.
    wa_values-key = 'FD'.
    wa_values-text = 'First Stage Dealer'.
    append wa_values to values.
    clear wa_values.
    wa_values-key = 'I'.
    wa_values-text = 'Importer'.
    append wa_values to values.
    clear wa_values.
    wa_values-key = 'DI'.
    wa_values-text = 'First stage or Second stage dealer of Imported Goods'.
    append wa_values to values.
    clear wa_values.
    wa_values-key = 'MD'.
    wa_values-text = 'Manufacturers Depot or Consignment Agent'.
    append wa_values to values.
    clear wa_values.
    wa_values-key = 'SD'.
    wa_values-text = 'Second stage dealer of Indeginious Ecisable Goods'.
    append wa_values to values.
    clear wa_values.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = '01'
        VALUES                = VALUES
    EXCEPTIONS
       ID_ILLEGAL_NAME       = 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.
    ENDMODULE.                 " HELP_VENDOR  INPUT
    *&      Module  HELP  INPUT
          text
    MODULE HELP INPUT.
    if sy-uname = 'ABAPUSER'.
      break-point.
    endif.
    ENDMODULE.                 " HELP  INPUT
    Process on help req is triggering on pressing the F1 help but process on value req is not triggering on pressing F4 it is triggering before the screen display i.e in PBO can u tell wat might be the problem.
    Thank u very much.

  • Combo box vs Dropdown list

    The Java Studio Creator (2004Q2, Update 8) help screen says that �Dropdown lists are the same as combo boxes in Swing and Microsoft Windows.�
    According to a SUN Java Swing web page, �Combo boxes require little screen space, and their editable (text field) form is useful for letting the user quickly choose a value without limiting the user to the displayed values.�
    How does one get the Combo box functionality (i.e. editable text field) in Dropdown lists in Creator?
    Thank you.

    Hi,
    Combo boxes are of two types, editable and non editable. Reference to this can be found at:
    http://java.sun.com/products/jfc/tsc/articles/jlf/index.html
    The dropdown list component provided in Creator is a non editable combo box. Also please refer to the Writing custom components for Creator by Edwin Goei available at:
    http://wiki.java.net/bin/view/Javatools/SunJavaStudioCreator
    Hope this helps
    Cheers
    Giri

  • ALV: Dropdown list individual for each line of the table

    Hi
    Question.. I would like to make a dropdown list for a field in the ALV list. The dropdown list is not the difficult point. But this dropdown list should be based on the line item.
    Example:
    Material 100.100     has plants (10, 20, 30)
    Material 100.800     has plants (60, 70)
    so the ALV list should show in the dropdown menu only the plants that this material has.
    As I'm not sure, that my explanations are any good, here a example:
    <u>
    ALV-List</u>
    Material       Description             Plants
    100.100        Screwdriver             (Dropdown list shows only 10,20,30)
    100.800        Hammer                  (Dropdown list shows only 60,70).
    Can anyone tell me if this is feasable? And if so how? Is it do-able with this method?
      call method grid->set_drop_down_table
        exporting
          it_drop_down = lt_dropdown.
    The program BCALV_EDIT_07 has sort of two different dropdown lists.. but I have more then two materials, there would be many lists to create.. (many drop_down_handle's)
    Any other idea?
    I know, this is a tricky one...
    Thanks
    Petra
    Message was edited by:
            Petra

    hi
    i have a code for drop down list use this
    this code is for selection-screen deop-down list yu can add this same code in ALV
    REPORT  ZCHETANA_PRAC10                         .
    Type-pools: VRM.
    data: name type vrm_id,
          list_month type vrm_values,
          list_year type vrm_values,
          value type vrm_value.
    selection-screen: begin of block b with frame.
    parameter: p_year(10) type c as listbox visible length 10,
               p_month(10) type c as listbox visible length 10.
    selection-screen: end of block b.
    at selection-screen output.
    value-key = 'JAN'.
    value-text = 'JAN'.
    append value to list_month.
    value-key = 'FEB'.
    value-text = 'FEB'.
    append value to list_month.
    value-key = 'MAR'.
    value-text = 'MAR'.
    append value to list_month.
    value-key = 'APR'.
    value-text = 'APR'.
    append value to list_month.
    value-key = '1998'.
    value-text = '1998'.
    append value to list_year.
    value-key = '1999'.
    value-text = '1999'.
    append value to list_year.
    value-key = '2000'.
    value-text = '2000'.
    append value to list_year.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_MONTH'
        VALUES                = list_month
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 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 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_YEAR'
        VALUES                = list_year
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 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.
    start-of-selection.
    write:/ p_year,
           p_month.

  • How to trigger dropdown list click in editable alv?

    I have an editable alv - and wehn a certain field is changed - I want to force the user to update a 2nd field, which is filled via a dropdown list.
    Ive trapped the change of the first field, in the handle_data_changed method, but need to from there - call an event to simulate a click onthe 2nd dropdown field, and can not figure out how to do that. the method modify_cell wont work as it expects a value to be passed in and I need to use my dropwdown.
    How is this done?
    Do I have to change it from a dropdown to an f4 event? I woudl really rather not.

    Dear srivallika,
    first you have do build up an steploop on your dynpro for the it_ccode-bukrs
    AT PBO
    loop at it_ccode cursor g_ccode_cur into wa_cccode.
    my set loopc
    module ccode_loopc.
    endloop.
    Include PBO
    module ccode_loopc.
      g_ccode_loopc = sy-loopc.
    endmodule.
    You only see via DIAG Dialog the displayed rows on the Dynpro.
    So if you only have a steploop of 4 rows -- you only get 4 rows to the wgate.
    Better use the field-set makro.
    AT PBO
    module rfc_fieldset_ccode.
    INCLUDE PBO
    module rfc_fieldset_ccode.
    data: ls_ccode like line of it_ccode.
    data: i type i.
    I'll use deeper structure
      perform rfc_fieldset_ccode.
    but you also can define the code here
    loop at it_ccode into ls_ccode.
         add 1 to i.
         field-set 'INDX'       i i .
         field-set 'BUKRS'   i   ls_ccode-bukrs .
    endloop.
    endmodule.
    Why to do this? The field-set makro (don't forget to include AVWRTCXM at your topinclude) will send the data from internal table via AGATE to the WGATE.
    Here now you can define the dropdown list:
    srivallika, i'll hope i could help you a little. If you have any questions, you won't bother me. ASK!
    With best regards
    Thorsten

  • How to get the keys for a field in the dropdown list?

    The dropdown list of payment terms on an account is unfortunately very big, containing al lot of different values, in our system and therefore very confusing for the user working with Web UI version 5.2 to pick the right one. The keys (code like e.i Z077 or ZO23) are not stated in the list available for user. Is there any way in the system to flag if the different fields should show boths the keys(codes) and the description of the values in the field as Payment terms, etc.
    In the ERP SAP Gui it is possible to activate if you want the keys should be shown in all drop down list.
    If this is not possible for all the fields at one time, what can be a solution to have the keys in the drop down lists, any suggestion will be very valuable for us.
    Kindly regards
    Camilla

    HI Joost
    No it is not that simple, that is not a solution for us. The fields are maintained i our backend system and replicated to CRM, and these fields descriptions are also printed at Order confirmations and invoices, and we do not want the keys that do not give any meaning  to be visible to customers.
    BR
    Camilla

  • Is it possible to create the ALV output with dropdown list for the columns

    Hi forum experts,
                              Could the ALV output contain the dropdown list for the column names? if yes, then how we can acheive this to happen.
    Thanks in advance,
    Regards,
    Samad.
    Edited by: Samad arif on Aug 21, 2009 4:40 PM

    Hi Arif,
    Yes we can .FOr the codding check the article,
    [dropdowns in ALV|https://wiki.sdn.sap.com/wiki/display/Snippets/DropdownsinALV]
    regards,
    Archana
    Edited by: Archana Kumari on Aug 21, 2009 1:22 PM

  • How to fill the dropdown list in a input field

    Hi all,
    I have three input fields, Month, Material type and material.
    My requirement is to search material based on material type.  So if i select one material type from the dropdown list, corresponding material should be populate in the material dropdown.
    Pls suggest to this requirement i have
    Regards
    Jeswin

    Hi,
    Refer Below Blog Step By Step For fill data in dropdownlist Getting Data From SAP BI Systems.
    Visual Composer :Get drop down list values  from BI InfoObject master data
    The Below Link is the For getting data from SAP ECC Systems For Both Value Help And DropDown list.
    Visual Composer: Value Help Data Service
    Go Through Above Links
    Points Are Welcome
    tahnks
    SubbaRao Chinta

  • Dropdown list on Dynpro for a disabled input field - No PAI triggered?

    Hello experts,
    I am facing a problem with a dropdown list on a dynpro (defined as a subscreen). The drop down list should be  for a field that is not input ready (at least it should appear not being input ready).
    The user should be able to pick a value from the dropdown list and as soon the selected row changes a PAI should be processed as other fields on the main dynpro as well as the subscreen itself need to change accordingly.
    The dropdown list works fine but with the field not being set to input ready - neither the input field changes nor a PAI etc. is triggered.
    But if the property for input is set to input ready, it works fine.
    Info:
    Dropdown list is populated in POV
    A function code is assigned to the field
    What am I missing here?
    What properties must be set for the field.
    Thanks,
    Chris
    PS. If set to input - how do I prevent the single empty line in the list?

    hi
    good
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE node.
    allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program
    F4 HELP->
    AT SELECTION SCREEN ON VALUE REQUEST FOR P_SACHA.
        PERFORM VALUES_SACHA.
    THANKS
    MRUTYUN^

  • Data in dropdown list field are empty in PDF form

    Hi all.
    Viewing a pdf form created with SAP interactive Forms offline method, the data in the dropdown list field are empty.
    The data in the dropdown list field are generated by xml file produced by an abap report.
    The problem occurs opening the form with Adobe Reader 8.1 or higher. Using Adobe Reader release 7.0.9 everything is ok.
    Do you have any suggestion?
    Thanks in advanced.
    Best Regards.
    Moreno

    Hi Otto,
    the only release of Adobe Reader that work is 7.0.9. Release 8.1 and 9 have the same problem where the data in the dropdown list field are empty.
    At the end of the trace file in Adobe Reader 9.0.3 I find this error message:
    "Invalid version: The current version of the XFA template model exceeds the capability of Acrobat / Adobe Reader 7.0.5."
    The form has been created using Adobe Lifecycle Design 7.1.
    Any idea?
    Thanks
    Moreno

  • How to hide two fields in SharePoint list when a dropdown value selected?

    Hi all,
    I have a SharePoint list which have four columns 1 Title 2.Type (Dropdown: option1:Issues Option2:Risk) 3.Risk Name and 4.Risk type. If 'type' value is 'Issues' then I need to hide field 3 and 4. In other words, default value in dropdown should be 'Issue'
    and want to hide field 3 and 4 are onload without using InfoPath.
    How to achieve this? Thanks in advance!

    You can make use of jquery for the same. Add script editor webpart on the page and access the dropdown value and based on the value you get, show or hide the fields. Below are some pointers.
    http://sachinvkatkar.blogspot.in/2013/02/hide-fields-from-sharepoint-newform.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/50aa6f8d-f742-4400-82f3-7949ab1c215e/need-help-manipulating-form-fieldsrows-using-jquery?forum=sharepointdevelopmentprevious#802d9d4d-c19b-4752-a4fb-e38f40f50c51
    http://social.technet.microsoft.com/wiki/contents/articles/21730.sharepoint-2010-conditionally-hide-fields-on-standard-list-forms-using-jquery.aspx
    http://sharepointnadeem.blogspot.in/2013/09/sharepoint-showhide-list-column-based.html
    Geetanjali Arora | My blogs |

Maybe you are looking for

  • Backup to external drive question

    Alright, so I have been trying to partition my Macbook HD for a little while now (to install Bootcamp), but it is now telling me to backup all data and format my HD. So, after looking around for a little while, I found a backup program on the Apple d

  • IBooks is telling me a specific book's contents " failed to load because the requested resource is missing."

    A download of Eric Metaxas' "Amazing Grace" is showing up as a literal empty book on my New iPad. All the other books appear.

  • Regarding outbound delivery

    i need a bapi  for this message type shp_obdlv_save_relica02   for creation of outbound delivery ......... and also let me know the procedure for outbound delivery to WM system..... very urgent point will be rewarded for the answers.............

  • JMS to MQ configuration

    Hi , i have configured foreign server between weblogic jms and MQ I am noticing the following exceptions: <Feb 23, 2010 2:44:40 PM EST> <Warning> <JMSPool> <BEA-169808> <There was an error while making the initial connection to the JMS resource named

  • Apple TV not streaming video

    So suddenly one day after working fine for months, my AppleTV (2nd gen) won't stream home movies or tv shows from my Tunes library. Music playlists play fine but when it comes to video I just get the timer which then goes back to the start screen. I'