Dropdown key populated by BAPI

Hi Everybody
I have a Z bapi that returns a table wit a single field. I want the contents of this single field to be displayed in Dropdown by key. Please don t ask me to create a node as I think that thats not required. Everything is properly mapped and mapping creates the nodes. Please tell me the code that I must write in doInit of my view to get values in the dropdown.
Thanx in advance
Saptarshi

Hi
Just chk the following code.......
Bapi_Flight_Getlist_Input bapiinput = new Bapi_Flight_Getlist_Input();
           wdContext.nodeBapi_Flight_Getlist_Input().bind(bapiinput);
           wdContext.nodeAirlineValue().addElement(wdContext.nodeAirlineValue().createElement());         
           wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();
           wdContext.nodeOutput().invalidate();
           int size = wdContext.nodeFlight_List().size();
           IWDMessageManager msg = wdComponentAPI.getMessageManager();
           //String compAirlineid = "AA";
           IPrivateTestComponentView.IAirlineValueElement airlineelem = wdContext.createAirlineValueElement();
           List retval = new ArrayList();          
           final IModifiableSimpleValueSet ValueSet =
                          wdThis
                               .wdGetTestComponentController()
                               .wdGetContext()
                               .getNodeInfo()
                               .getChild("AirlineValue")
                               .getAttribute("AirlineID")
                               .getModifiableSimpleType()
                               .getSVServices()
                               .getModifiableSimpleValueSet();          
           for (int indx=0;indx < size ; indx++)          
                ValueSet.put(wdContext.nodeFlight_List().getElementAt(indx).getAttributeValue("Airlineid"),"Airlineid" + indx);                    
           wdContext.nodeAirlineValue().addElement(airlineelem);

Similar Messages

  • Dynamic Dropdown key bind in the row

    hi all,
    i am facing a typical scenario where, <b>for each row in a table of 10 cells i have 1 cell with dropdownbykey control. the requirement is that based on the row's data the dropdownkey's content differs. ie.,
    row 1's -> dropdownkey control's content can have x,y,z
    row 2's -> dropdownkey control's content can have a,b,c
    row z's ->dropdownkey control's content can have m,n,c</b>
    Now problem is that if each row's dropdown content doesnt change then i can bind the simple type to the cell, which would have the same dropdown values for all the row's.
    BUT in my case each row's dropdown key value differs based on some XYZ condition (fetch data from bapi/backend).
    Could anyone suggest me the alternative or solution for this problem.
    Thanks,
    Raghavendra

    Hi Raghavendra,
    You cannot use DropdownByKey for this functionality. Instead you can use DropdownByIndex for achieving this. This query may help help you in this regard. TableView
    Hope this helps,
    Best Regards,
    Nibu.

  • Incorrect posting key when using BAPI to post the document

    Dear Gurus,
    We are using a document upload program using BAPI_ACC_DOCUMENT_POST. It is for making payments to employees vendors via a mass mode.
    Now the payment to then is getting reflected as posting key 21, but we want to use key 25, so that in vendor report the line items for payments gets grouped together.
    How can we change this posting key in this BAPI?
    Cheers,
    Bhavesh

    Hi,
    This BAPI have the posting keys hardcoded based on account type, debit credit etc. You cannot change that in this BAPI.
    However I can find an OSS note 487722 which says some extension about this BAPI structure. You can try that to include the Posting Key Field:-
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=487722]
    Regards,
    Gaurav

  • POWL: dropdown key in a POWL

    Hello!
    Has any body implemented a dropdown key in the POWL worklist. I have used the
    field POWL_DISPLAY_DOM as 'DK' from structure POWL_FIELDCAT_STY. That hasn't helped me in getting a dropdown in the powl worklist.
    Thanks in advance!
    Best regards,
    Smitha.

    Hi,
    If you fill the information related to Drop-Down key in the field VALID_VALUES of structure POWL_FIELDCAT_STY then automatically the field will becomes as a drop-down only.
    <b>For Example:</b>  Here for CARRID field i am providing the drop-down information.
      ls_fieldcat-colid = 'CARRID'.
        ls_fieldcat-filter_ref = 'CARRID'.
      ls_fieldcat-colpos = '1'.
      ls_fieldcat-col_visible = abap_true.
      ls_fieldcat-enabled = abap_true.
      ls_fieldcat-allow_sort = abap_true.
      ls_fieldcat-allow_filter = abap_true.
      ls_valid_value-key = 'LH'.
      ls_valid_value-value = 'Lufthansa'.                       "#EC NOTEXT
      INSERT ls_valid_value INTO TABLE lt_valid_values.
      ls_valid_value-key = 'BA'.
      ls_valid_value-value = 'British Airways'.                 "#EC NOTEXT
      INSERT ls_valid_value INTO TABLE lt_valid_values.
      ls_valid_value-key = 'UA'.
      ls_valid_value-value = 'United Airlines'.                 "#EC NOTEXT
      INSERT ls_valid_value INTO TABLE lt_valid_values.
      ls_valid_value-key = '*'.
      ls_valid_value-value = 'All'.                             "#EC NOTEXT
      INSERT ls_valid_value INTO TABLE lt_valid_values.
      ls_fieldcat-valid_values = lt_valid_values.
      INSERT ls_fieldcat INTO TABLE c_fieldcat.
    I think I make you clear for your requirement
    Thanks and Best Regards,
    Vijay

  • Dropdown key

    Hi Experts,
                   What is the difference between Dropdown key and Dropdown index?
    Thanks,
    P.Manivannan.

    Hi,
    <b>DropdownbyIndex:</b>
    http://help.sap.com/saphelp_nw70/helpdata/en/dd/b0884118aa1709e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/frameset.htm
    <b>DropDownByKey:</b>
    http://help.sap.com/saphelp_nw70/helpdata/en/c5/e4884180951809e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm
    <b>Code Example:</b>
    http://help.sap.com/saphelp_nw70/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm

  • Multiple ALVs in a single view - dropdown not populated

    Hi,
    I have a web dynpro window in which I am having 2 ALVs. I have created 2 refernces to the class "CL_SALV_WD_CONFIG_TABLE" for each ALV (MR_ALV_1 and MR_ALV_2). The data to the ALVs comes from a node (MR_NODE_ALV).
    Now in the ALvs I have a column which is a "dropDownByKey". I am filling the values by getting the NODE_INFO of MR_NODE_ALV. The NODE_INFO is populated correctly with required entries for both ALVs in the same way.
    In the respective column of ALV1 I am able to see the dropdown entries. However in ALV2, I am not able to see any entries in the dropdown.
    Could you please tell why?
    Thanks,
    Shalini.

    Hi
    Can any of you help on this?
    Thanks
    Shalini

  • How to populate the dropdown key values as shown in the below screen shot

    Hi
    i am trying to populate the drop down by key value for trader , for Trader we  have few values i need to populate the Those values in values columns . as shown in the below screen shot .

    Hi,
    Follow below steps
    Step 1 - Create basic wdp table
    Step 2 - Create context to store dropdown values Within your web dynpro application table
    Now you need to create a context node to store the dropdown values, but this needs to be within the context node of your table.
    For this example I will use fields CARRID and CARRNAME from structure SCARR to create the dropdown list within the table context.
    Choose the attributes to represent the id and the text values
    The finished context should now look like this
    Step 3 - Update context mapping within VIEW
    Within the Context tab of your view update the context node you have just modified (CARRIERS) right click and select 'Update Mapping'. Alternatively if this is a new context drag it from the right hand window and drop it onto the context node in the left window,
    Step 4 - Update table field
    Within the layout tab of the view, field the table field you want to replace with with a dropdown and remove the UI element associated with it
    Now insert new dropdownbyindex UI cell element
    Step 5 - Assign Dropdown Ui element to Context
    Click on your UI element within the Layout tab, you will now see all the properties for this element which can be changed. You now need to assign the field within the context which you want to be displayed in the drop down i.e. it will be the CARRNAME field within context element DROPDOWN_CARR. To do this simply click on the button at the end of the 'texts' property (the one with a yellow square and circle on it) and select the correct context field.
    Step 6 - ABAP code to populate dropdown list and set correct initial value
    Insert the following ABAP code into the appropriate place. For this example it will go within the WDDOMODIFYVIEW method of the view.
      Data: it_scarr type standard table of scarr, wa_scarr like line of it_scarr, context_node type ref to if_wd_context_node.  Data: it_ddcarr type STANDARD TABLE OF if_main=>element_DROPDOWN_CARR, wa_ddcarr like line of it_ddcarr, lr_element TYPE REF TO if_wd_context_element, ld_tabix type sy-tabix, ld_index type sy-index, it_carriers type STANDARD TABLE OF if_main=>element_CARRIERS, wa_carriers like line of it_ddcarr.  select * from scarr into table it_scarr. sort it_scarr by carrid.  * select * from scarr into table it_scarr. context_node = wd_context->get_child_node( name = 'CARRIERS' ).  * Get all rows of table and values stored in each cell currently displayed to user context_node->get_static_attributes_table( importing table = it_carriers ).  if sy-subrc eq 0. loop at it_carriers into wa_carriers. free lr_element. ld_tabix = ld_tabix + 1.  *     assign context_node to table context context_node = wd_context->get_child_node( name = 'CARRIERS').  *     assign lr_element to row of table lr_element = context_node->get_element( ld_tabix ).  *     assign data to dropdown of the row  context_node = lr_element->get_child_node( name = 'DROPDOWN_CARR'). context_node->BIND_TABLE( it_scarr ).  *     Set correct initial value read table it_scarr into wa_scarr with key carrid = wa_carriers-carrid. ld_index = sy-tabix. context_node->set_lead_selection_index( index = ld_index ).  endloop. endif.
    Step 6 - Save, Activate and Run
    Save and activate your abap web dynpro, now when you execute it you should see a drop down object similar to the following:

  • Withholding Tax not populated using BAPI

    Hello
    We are using BAPI to post invoices instead of FB60 but noticed a difference in the withholding tax data.
    Using FB60 when we provide a N1, the tax code shows up as starand the withholding tax exempt is populated along with the  withholding tax code from the vendor master.
    When we try to do the same using the BAPI providing it with N1, it does not populate the withholding tax exempt and withholding tax code fields
    We are using classing withholding tax.
    why the BAPI is behaving differently than FB60 and not picking up the standard configuration
    This is priority as we are in Production and invoices which dont have these withholding  tax information are not getting picked up for payment.
    Thanks

    Solved myself...using the ACCOUNTPAYABLE-W_TAX_CODE field to populate the tax code which is stored on the Vendor Master

  • Are Service Keys are some BAPI/RFC?

    Hello Experts,
    I am going through some material on implementing Ess/MSS in SAP ERP HCM and it somwhere says as the Service Key. For e.g. the Service KEy for Personal Dat aiView is EMPLOYEE_PERSINFO_PERSDATA05. Is this servie key is some backend table service where the data has been stored? And can I call this service key EMPLOYEE_PERSINFO_PERSDATA05 in some other application...say WD application if it's BAPI/RFC?
    Please clarify this doubht..that will be really helpful.
    Thanks, RN

    Hi,
    This is the FM which gets called to render the Area page in the ESS role
    HRXSS_GET_MENUDATA
    Within this FM you can find the related FMs to read the Services.
    And the table where you can find the entries is V_T7XSSSER
    To find the exact table navigate to below location
    IMG-> Cross Application Components -> Homepage Framework->Services->Define Services-> Define
    Services (Add Entries) -> select print button and see the table V_T7xss*
    Hope this helps.
    Cheers,
    Pramod

  • E-REc : Recruiter Dropdown not populated during Requisition

    Please do not ask for or offer points. It is against the rules of the forum.
    Hi All,
    While creating Manpower Requisition through MSS on Portal, system does not populate Recruiter dropdown in the Adobe form.
    I have checked in the HR system that feature PINCH is properly created and called and accordingly table T526 is maintained with proper Recruiter user ID. The same User Id also has recrutier role assigned in Erec System.
    Do I need to check some other point in HR or Erec system?
    Helpful answers with be rewarded with points for sure
    Thanks.
    -Tejas
    Edited by: Matt on Sep 23, 2010 10:31 AM

    Hello,
    In EhP4 what package do you have? Check if note 1318164 is already applied because in earlier versions it was not possible to to see the activities if you were not assigned directly to the support team in HRP5131. The system was not considering those assigned through a support group until the note was released. So you can compare your versions and also check if you are able to see if you assign someone directly as a support team member and not through a support group.
    Regards,

  • Primary key population through sequence using SQL loader

    Hi Experts,
    Is it possible to populate primary key column using a sequence while trying to load the data through SQL loader?
    Requirement is like that..
    Flat file contains 4 fields and I need to populate 5th Column which will be primary key and will be from one sequence available in database.
    Regards,
    SKP

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#sthref1274
    Alternatively, you could load data, then populate the required column with unique values using sequence and then add primary key constraint.

  • Populating the bapi in retreiving the pricing condition

    Hi guys,
    given the ff data, how am i going to populate bapi_salesorder_simulate to retrieve the pricing condition?
    Condition      Table     Field                    SAP Field
    ABCD     907     Sales Org                   LIKP-VKORG
    ABCD     907     Customer                   LIKP-KUNNR         ABCD     907     Material                   LIPS-MATNR    XYZW     855     Sales Org                   LIKP-VKORG
    XYZW     855     Price Group     KNVV-KONDA
    XYZW     855     Material Group     MARA-MATKL
    XYZW     855     Duty Band                    MVKE-MVGR3
    Thanks a lot!
    Regards,
    Mark

    Hi Preet,
    I am sorry that we are back to square one. I checked OSS and two OSS notes specifically mention that you cannot do anything with condition records if you are in a version lower than 4.7.
    That leaves us with the option that I mentioned in your earlier posting which is to make config changes, and then write a small program to do repricing. That way all the sales orders will be repriced and based on the new configuration, the condition should disappear.
    You can give points by clicking the yellow star sign at the header of a post. You can give one 10 points for the post solving your issue, two 6 points for very helpful answers and unlimited 2 points for helpful answers.
    Regards,
    Srinivas
    Sorry forgot to mention the OSS notes. They are 593246 and 597970.
    Message was edited by: Srinivas Adavi

  • Regarding populating dropdowns

    Hi All,
    I am using two dropdowns(dropdown by key) in my application. One is used to populate a/c numbers and the other for a/c names.
    Both the dropdowns get populated from a BAPI.
    The problem is:
    When I select a a/c number in a dropdown, the corresponding a/c name should be automatically selected in the a/c name dropdown. Also, if i select a a/cname in the dropdown, then the corresponding a/c number should get automatically selected in the a/cnumber dropdown.
    Is it possible in Webdynpro???
    If so, How could I do that???
    Please help me in this context.
    Also, suggest me if there is any other solution for this.
    Regards,
    Murthy.

    Hi,
    <b>If you take DropDownByIndex...</b>
    Take one Context Node "Account" and create two value attributes in that node.
    one for "Account Number" and one for "Account Name".
    Insert the data coming from BAPI into this node.
    Then bind account name attribute attribute for first dropdown list and account number attribute for second dropdown list...
    this will solve your problem.....
    <b>If you take DropDownByKey..</b>
    then create on simpletype ...for example "valuestype".
    Then create one value attribute "values" of type that simple type "valuestype"
    then insert values into attribute "values" using the following code...
    ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("values");
    IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
            values.put("account number 1","account name 1");
                       values.put("account number 2","account name 2");
    like this...
    After that take one DropDownByKey and InputField Ui elements...
    and bind value attribute to those ui elements....
    this may solve your problem...

  • Population of a dropdown based on another dropdown selection

    Hi,
    I'm trying to develop a form in which a secondary dropdown is populated based on a selection from a primary dropdown.
    The idea behind this is as follows
    The first dropdown is bound to a database.
    From this dropdown a user would select a project.
    This selection would form part of a 'WHERE' clause in a SQL query that would select a list of users involved in the project.
    This list of users would then be used to populate the second dropdown.
    By selecting a user from the second dropdown the database would be queried again and the result used to populate the rest of the form.
    I've seen examples where a single dropdown is used to populate a form but I've been unable to find any code examples in which the result of one dropdown is used to populate a second.
    Can anyone help? Many thanks in advance.

    You can get pretty close out of the box using some configuration manager applet voodoo
    1)First off create a Table that will contain the options for your list. Create the columns e.g. label and id and then also create a column called dSecurityGroup
    2)Add a view based on the table you just created, choose the Security tab and select "Use standard document security"
    3)Add some values to your view - make sure that you populate the dSecurityGroup column with real values of security groups
    4)Once it is all published, have a look at the checkin and search screens. You should find that UCM will evaluate the options in the same way it would documents - based on the dSecurityGroup value you applied to the row - e.g. you will see an option on the search screen if you have at least R permissions, you will see an option on a checkin screen if you have at least RW permission
    Try it out :-)

  • Populating several textgroups based on two dropdown lists troubles

    Hi All,
    I have a dropdown list (case1) which contents "engine1", "engine2" and "engine3" and a second dropdown list (Component).
    If i select in "case1" = "engine1" then in "component" should be displayed "Motor" and "burner".
    it works this way...that's everything fine.
    ----- form1.#subform[0].#subform[1].Case1::enter: - (JavaScript, client) -----------------------
    var 
    arrayItems = eval(Case_1.value);
    for 
    (var i=0; i < arrayItems.length; i++) {this.addItem(arrayItems[i]);
    ----- form1.#subform[0].#subform[1].Case1::change: - (JavaScript, client) --------------------------
    if 
    (xfa.event.newText=="Engine1" || "Engine2" || "Engine3" );
    var 
    arrayItems = eval(Comp_0.value);
    for 
    (var i=0; i<arrayItems.length; i++) {Component.addItem(arrayItems[i]);
    ----- form1.#subform[0].#subform[1].Component::enter: - (JavaScript, client) -----------------------if  (xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine1"){
    xfa.resolveNode("form1.#subform.Component").clearItems();
    var arrayItems = eval(Comp_0.value); 
    for (var i=0; i < arrayItems.length; i++){
    this.addItem(arrayItems[i]);
    if  (xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine2"){
    xfa.resolveNode("form1.#subform.Component").clearItems();
    var arrayItems = eval(Comp_0.value); 
    for (var i=0; i < arrayItems.length; i++){
    this.addItem(arrayItems[i]);
    if  (xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine3"){
    xfa.resolveNode("form1.#subform.Component").clearItems();
    var arrayItems = eval(Comp_0.value); 
    for (var i=0; i < arrayItems.length; i++){
    this.addItem(arrayItems[i]);
    then if i select "motor" then should be visible a group "engine1Motor", "engine2Motor", "engine3motor".
    if i decide to select "burner" after "motor" the group which belongs to Motor should stay visible and a new group should which belongs to burner "engine1burner1", "engine1burner2", "engine1burner3" should be visible.
    and if case2 is filled then a new goup "1.ifcase2", "2.ifcase2", "3.ifcase2" should be visible.
    I tried it this way but it doesnt work :-(
    ----- form1.#subform[0].#subform[1].Component::change: - (JavaScript, client) ----------------------
    if  (xfa.resolveNode("form1.#subform[0].Case1.rawValue") == "Engine1"){
    xfa.resolveNode("form1.#subform.Component.rawValue")
    == "engine1Motor"; 
    Motor.presence
    = "visible";}
    else{
    Motor.presence= "hidden"}
    who can help me to solve this problem??
    Thank u!!
    D.

    Hi,
    The script in itself looks okay, but there are a few things to check:
    That the language is JavaScript.
    That the values your are testing against EITHER match the Item values (in the Object > Field palette) OR the bound values (if specified in the Object > Binding palette).
    I am presuming that this script is in the calculate event of the dropdown.
    The relative references between the objects is not full enough. See: http://assure.ly/kUP02y.
    I think that you could achieve this in an easier way!!!
    Select each of the dropdowns. In the Object > Field palette you will have the items listed. Okay, nothing to do here.
    Now go to the Object > Binding palette and tick specify values. Then for Category 1 specify PN1, Category 2 specify PN2, etc. Similarly for the product dropdowns: Product A specify A, Product B specify B, etc.
    Then in the caculate event of the textfield you would use FormCalc to concat the dropdowns:
    $ = Concat(Dropdown1, Dropdown2)
    I appreciate that the product dropdown is populated based on the users selection in the Category, but you can script the bound value.
    See examples here: http://assure.ly/fYCuQ2, and especially this one: http://assure.ly/jcTahK.
    Also if you want searchable dropdowns: http://assure.ly/mP5Lud.
    Good luck,
    Niall

Maybe you are looking for