Getting dynamic number based on databank variable.

I have run into an interesting issue, and I was wondering if anyone has any ideas.
Here is a run down of the setup.
I have 3 drop downs Category, Sub-Category, and Sub-Sub-Category (nice huh).
The values of the drop down as stored by E-Tester are numeric, so I am running into a bit of a problem trying to databank this test. It is stored as <option value=18>MyCategory</option>
I need to be able to choose the drop-down based on my databanked variable of "categoryName", but I couldn't figure out a way to set that on the form.
The other option, which I was diving into was parsing out the number from the html but again I am running into a problem since this is running off a databank.
I tried to run it through either the custom variable option or custom VBA and am running into the same problem. I can't tell it that the ending part of the string is a variable.
Here is my DOM Property Expression working on the inner html
<OPTION value=(\d+)>MyCategory</OPTION>
It works great as long the category is MyCategory, but I can't figure out a way to set the last portion to use a variable. If I try anything less than <OPTION value=(\d+)>MyCategory it matches all of the options in the drop down including -1 which is to add a new one.
Does anyone have any ideas or am I attempting something beyond the limitations of VBA?

I think I may have a solution for you. Put this code on the page that you are trying to set the option of. Of course, the path to the select element will have to be replaced with the correct path.
Private Sub RSWVBAPage_afterPlay()
On Error GoTo ERRLBL
Dim element As HTMLSelectElement
Dim optionEl As HTMLOptionElement
Dim itemText As String
'Get the Path to the SELECT list
RSWApp.om.GetElementByPath "window(index=0).form(name=""myform"" | id=""myID"" | action=""submit.asp"" | index=0).formelement[SELECT](name=""Sub-Sub-Category"" | index=6)", element
If element Is Nothing Then
errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
'Get the Data bank value associated with the data bank value named "var_ItemText"
Call RSWApp.GetDataBankValue("var_ItemText", itemText)
'Go through each option element and match the text attribute with the data bank value. If we match, set the selected property to true
For Each optionEl In element
If StrComp(itemText, optionEl.text) = 0 Then
optionEl.selected = True
Exit For
End If
Next optionEl
Exit Sub
ERRLBL:
errDescription = Err.Description
errNumber = Err.Number
Let me know if this works for you.
- GateCity_QA

Similar Messages

  • Function Module to get pernr number based on first name and last name

    Hi All,
    What is the Function Module to get pernr number based on first name and last name.
    Could you please help me.
    T@R.
    Vidya

    hi Vidya,
    you can get perner from PA0002 based on firs name and last name.
    use select query and get perner.

  • How to get po number based on billing document number

    Hi every body
          how to get a po number based on billing document number
    thanks in advance.
    sekhar.k

    Hi,
    Check this field VBRK-BSTNK_VF.
    Regards,
    Satish

  • How to get RFQ number based from PO number...

    Hello Experts,
    How do I get the RFQ(request for quotation) based on a given PO(purchase order) number?
    Thank you guys and take care!

    EKKO-EBELN = EKPO-EBELN
                             EKPO-ANFNR = RFQ Number.
    Hope this helps.
    Regards
    Vinayak

  • Getting Map entries based on a variable in JSTL?

    In JSTL, you can have a Map variable access the items within that map using the '.' notation.
    So, {$map.prop1} is similiar to map.get("prop1").
    But, 'prop1' in a EL expression is a constant, and you can't (apparently) build EL expressions on the fly easily.
    You can't do something like:
    <c:set var="myProp" value="prop1"/>
    ${map.get(myProp)}
    because EL doesn't really have "function calls".
    In normal Java, I'd simply do:
    String myProp="prop1";
    map.get(myProp);
    But, that doesn't work.
    Finally, if I'm using the new JSP File Tags functionality, I can't put <% %> code within those tags, so I can't even "punt" on this.
    Anyone have any hints?

    Use square brackets notation.
    <c:set var="myProp" value="prop1"/>
    ${map[myProp]}Basically
    ${map.prop1} is equivalent to ${map['prop1']}

  • ABAP GET Personnel Number based on SY-UNAME

    Hi,
    anyone knows a bapi, function, etc, that can return a personnel number with sy-uname as input ?

    Check out this link ...
    Get PERNR using SY-UNAME
    Hope this helps ...

  • How to get Partner Number based on Vendor Number

    Hi,
       I have vendor number(LIFNR), I would like to find out the partner number(PARNR) for this vendor number. I tried a lot but unable to find it.
    Any help will be appreciated.
    Thanks,
    Ibrahim

    Hi...
    have u checked the table VBPA(table for Sales Document: Partner)..in this table you can get the PARNR(Number of contact person)..
    Hope this solve your problem.
    Thanks
    shankar

  • FM to get transaction number based on product

    Hi,
    Do we have any FM to get all the transction number which are using the product?

    Don't know for function module, but you can certanly get it from tables. Do the following:
    1. from table COMM_PRODUCT read guid (PRODUCT_GUID) of material id (PRODUCT_ID)
    2. from table CRMD_ORDERADM_I read guid of header (HEADER) of material guid (PRODUCT)
    3. in table CRMD_ORDERADM_H read transaction number of header guid
    You can also try with just 2 step approach:
    1. from table CRMD_ORDERADM_I read guid of header (HEADER) of material id (ORDERED_PROD)
    2. in table CRMD_ORDERADM_H read transaction number of header guid
    Regards.

  • Get nth number of sets from user in proper set format in C#

    how to take nth number of sets from user using string type list in C#. 
    Each set should be in this format {1, 2 , 3, ab,....nth }.
    User can enter nth number of item in each set
    then count the number of item in each set
    Waiting for you answers 

    I think you still not got my point. okay once again i explain you what i want.
    User Enter set in WPF window in this format e.g {1,2,3,ab},{ab,cd,1,2}.
    User can enter nth number of set.
    User can enter nth number of elements\ items in each set.
    Count the number of elements in each set.
    Hopefully now you got my point
    If I understand you correctly, you want to get the number based on the string like "{1,2,3,ab},{ab,cd,1,2}". Maybe you could try Regular Expression:
    https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx
    For example this code snippet is able to count the set numbers and element numbers for you:
    string input = "{1,2,3,ab},{ab,cd,1,2}";
    string pattern1 = @"{.*?}";
    string pattern2 = @"\w+,?";
    Regex reg = new Regex(pattern1);
    MatchCollection mc1 = reg.Matches(input);
    Console.WriteLine("Number of set:" + mc1.Count);
    for (int i = 0; i < mc1.Count; i++)
    reg = new Regex(pattern2);
    MatchCollection mc2 = reg.Matches(mc1[i].Value);
    Console.WriteLine("Set " + (i + 1) + " element number:" + mc2.Count);
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Reg: Getting an error for getting Delivery number

    Hello ABAPers,
    Could you pleae assist me, For getting Delivery number based on the Sales Order Number.
    Here for getting Delivery number i used "BAPI_OUTB_DELIVERY_CREATE_SLS" Function Module, how ever i'm getting the below error message through Retrurns. i.e The sales document is not yet complete: Edit data.
    it would be a great helpful if you provide with sample coding. Thank you.
    Regards
    Mallikarjun

    to get delivery, read document flow table VBFA for next document....  However, the error you're mentioning comes from incompletion processing....probably cannot create a delivery when the SO document is incomplete!  Complete the SO document (by processing the incompletion data) and try again.

  • How do I get SUMIF to calculate based on multiple variables?

    Here's what I have now
    =SUMIF(Income Breakdown :: $Date,D1,Income Breakdown :: $Amount)
    Income Breakdown is the table I'm referring to. D1 is March, so if the cell in the Date column = March it will figure the total for me of just those items.
    However I want it to figure the total by both the Month and by the Category (a separate column in the table {but separate row in the table I'm trying to create the formula in}) I have listed in the table. How do I include variables for both month and category and get a sum based on that?
    Just a side note, I do not work with spreadsheets often. I looked through other discussions, but as none were quite my problem or my variables, I had trouble following them. I stumbled on this formula in a template and knew it should do what I want, I just cannot solve that 2nd variable.
    I tried doing this:
    =SUMIF(Income Breakdown :: $Date,D1,Income Breakdown :: $Category,A3,Income Breakdown :: $Amount)
    This causes all the required columns to highlight in color, but it gives me a red triangle once I hit enter.

    Hi,
    You're almost there.
    SUMIF calculates a sum of values that meet a single condition.
    SUMIFS calculates a sum of values that meet all of a set of conditions.
    The syntax is slightly different. Here's the description, from the Function Browser in Numbers '09:
    Note that the sum values (Income Breakdown::$Amount) is the first argument for SUMIFS, rather than the last, as it was for SUMIF. Test-value, Condition pairs are set in the same manner as in SUMIF.
    Regards,
    Barry

  • BAPI to get Invoice Details based on PO Number

    HI,
    Is there any BAPI to get Invoice Details based on PO number. If so could you pls let me know that.
    Regards,
    Ramesh

    Hi Ramesh  ,
    there is no Direct BAPI to get the List of Invoices ,But based on the Vendor list u can get the List .
    pass Vendor list , Document Dates.
    <b>BAPI_INCOMINGINVOICE_GETLIST</b> for more info check the Documentation of this FM.
    Regards
    Prabhu

  • How to get sales order number based on purchase order

    hi,
    what is the transaction code to find the sales order number based on the purchase order number
    Regards,
    Murali

    Hi,
    Go to Se16 (data browser), see the table VBKD, enter the PO number, if any, execute.
    Prase

  • Get the Serial Number based on the  Delivery

    Hi Experts,
    I want to fetch the serial number based on the delivery number  and Item.
    If I see in the LIPS table we have the field like SERNR but we dont have data in that field.
    But in the VL03n transaction Serial Number exists for the same delivery.
    Please any one Suggest me Using which table we can fetch the serial number.
    Thnx ,
    Sam

    TABLES: RSEROB.
    DATA : S_LV_IRSEROB TYPE STANDARD TABLE OF RSEROB WITH HEADER LINE.
    *       S_LV_ORSEROB TYPE STANDARD TABLE OF RSEROB WITH HEADER LINE,
    *       WA_RSEROB TYPE RSEROB.
    CLEAR : S_LV_IRSEROB , S_LV_ORSEROB , WA_RSEROB .
    *LOOP AT ITAB_LT_ITEMS INTO WA_ITEMS.
      S_LV_IRSEROB-TASER   = 'SER01'.
      S_LV_IRSEROB-LIEF_NR = WA_ITEMS-VGBEL.---delivery no.
      S_LV_IRSEROB-POSNR   = WA_ITEMS-VGPOS.--delivery item
      APPEND S_LV_IRSEROB.
      CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'
        EXPORTING
          KEY_DATA                  = S_LV_IRSEROB
    *   STATUS_PRE_READ           = ' '
    *   EQUNR_CORR                = 'X'
        TABLES
          SERNOS                    = S_LV_ORSEROB
    *   SERXX                     =
       EXCEPTIONS
         KEY_PARAMETER_ERROR       = 1
         NO_SUPPORTED_ACCESS       = 2
         NO_DATA_FOUND             = 3
         OTHERS                    = 4.
    *  IF SY-SUBRC EQ 0.
    *    Loop at S_LV_ORSEROB INTO WA_RSEROB.
    *      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    *  EXPORTING
    *    INPUT         =  WA_RSEROB-SERNR
    * IMPORTING
    *   OUTPUT        = WA_RSEROB-SERNR        .
    *      WA_ITEMS-SERIAL_NO = WA_RSEROB-SERNR(18).
    *      MODIFY ITAB_LT_ITEMS FROM WA_ITEMS.
    *    ENDLOOP.
    *  ENDIF.
    *ENDLOOP.

  • How to get total number of result count for particular key on cluster

    Hi-
    My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
    To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
    Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
    Thanks in advance.
    Prashant

    user11100190 wrote:
    Hi,
    Thanks for suggesting a soultion, it works well.
    But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
    Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
    If you want to do paging, you can use the LimitFilter class.
    If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
    What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
    This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
    We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
    You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
    Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
    No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
    The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
    At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
    On the storage node you should have a static HashMap.
    The filter should do the following two steps while being synchronized on the HashMap.
    1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
    2. Enqueue the total number count you want to pass to the aggregator into that queue.
    The parallel aggregator should do the following two steps while being synchronized on the HashMap.
    1. Dequeue a single element from the queue, and return it as a partial total count.
    2. If the queue is now empty, then remove it from the HashMap.
    The parallel aggregator should return the popped number as a partial total count as part of the partial result.
    The client side of the parallel aware aggregator should sum the total counts in the partial result.
    Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
    Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
    Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
    Best regards,
    Robert

Maybe you are looking for