Multiple selection - VBA

Hello All,
first of all, I hope that my English will be understandable.
Description:
I must create a report for sales orders by planned deliver date. Most of info what I need are in VBAP, but there is no delivery date there, only in VBAK. I download VBAK by VDATU, result is a list with 500-3k pcs of orders. Next step shouId be I take these order numbers and "insert" them into VBAP-VBELN, but I'm not able to find out how can I do it in VBA (multiple selection, therefore I download that by ERDAT (large interval, because the orders can arrive to system more weeks before delivery date). Result is a code what is downloading VBAP ~ten minutes... It is not acceptable. I would like to choose a simplier example (where problem is the same): MARA.
I have only 2-300 article number per list but I have to download 80k articles because I can filter only prefix and H% is not so exact filter...
One-dimensional array is the only one solution what I tried for that but RFC call is false in that case.
Sub MARA() '(user As String, password As String)
Const TABLA As String = "MARA"
Const UZI1 As String = "there is no connection to R/3"
Const UZI2 As String = "something wrong"
Const CLIENT As String = "300"
Const LANGUAGE As String = "your logon language"
Const SYSTEM As String = "your system"
Const user As String = "your username"
Const password As String = "your pw"
Dim Tomb As Long
Dim LTomb As Long
’store material numbers from A column of xls into matDatabank
    LTomb = Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row
    Tomb = 2
    If LTomb = 2 Then
matDatabank = "'" & Worksheets(1).Cells(Rand, 1).Value & "'"
    Else
Do While Worksheets(1).Cells(Tomb, 1).Value <> "" And Tomb < LTomb
matDatabank = matDatabank + "'" & Worksheets(1).Cells(Tomb, 1).Value & "', "
Tomb = Tomb + 1
Loop
matDatabank = matDatabank + "'" & Worksheets(1).Cells(Tomb, 1).Value & "'"
    End If
    matDatabank = Left(matDatabank, Len(matDatabank) - 1)
Set conn = CreateObject("SAP.functions")
conn.Connection.SYSTEM = SYSTEM
conn.Connection.CLIENT = CLIENT
conn.Connection.LANGUAGE = LANGUAGE
conn.Connection.user = user
conn.Connection.password = password
    retcd = conn.Connection.logon(0, True)
    If retcd <> True Then
     MsgBox UZI1, vbCritical
Exit Sub
    End If
Set RFC_READ_TABLE = conn.Add("RFC_READ_TABLE")
Set equery_tab = RFC_READ_TABLE.Exports("QUERY_TABLE")
Set toptions = RFC_READ_TABLE.Tables("OPTIONS")
Set tdata = RFC_READ_TABLE.Tables("DATA")
Set tfields = RFC_READ_TABLE.Tables("FIELDS")
equery_tab.Value = TABLA
toptions.AppendRow
toptions(1, "TEXT") = "MATNR IN" & "(" & matDatabank & ")"
’HM* selection needs more minutes because of huge amount of materials
'toptions.AppendRow
'toptions(1, "TEXT") = "MATNR like 'HM%'"
tfields.AppendRow
    tfields(1, "FIELDNAME") = "MATNR"
tfields.AppendRow
    tfields(2, "FIELDNAME") = "MATKL"
    If RFC_READ_TABLE.Call = True Then
MsgBox "success"
Else: MsgBox (UZI2)
    End If
conn.Connection.logoff
End Sub
Thank you for you help!
Regards,
Csaba

I tried this too, unsuccessfully:
x = Range("A65536").End(xlUp).Row
ReDim matDatabank(x)
For i = 2 To x
matDatabank(i) = "'" & Cells(i, 1).Value & "'"
Next i
For i = 2 To x
toptions.AppendRow
toptions(i - 1, "TEXT") = "MATNR EQ " & matDatabank(i)
Next i
Please help how can I use one dimensional array as selection.
Thanks,
Csaba

Similar Messages

  • AppleScript : modify labels for multiple selection of files and folders in Finder ?

    As an experienced programmer in Pascal, Excel VBA, ... I am trying to find my way in AppleScript (first steps).
    I am trying to build a small script that will run on a keyboard shortcut, and that will toggle the label of selected files and folders (multiple selection ?) in Finder between "purple" and "no label".
    Based on a recorded action, I was trying something along the lines of
    tell application "Finder"
              Activate
              repeat with oneItem in selection
                             set label index of oneItem to 3
              end repeat
    end tell
    I am not clear on how to make the script understand that in a multiple selection I want to apply the requested command to each item. In addition, when testing it on one single item, it appears that I can't set the label index property of "selection" ...
    Can someone please advise what the correct way is of (a) setting the property of a selected item in the Finder and (b) looping through a multiple selection ?
    Thanks in advance.
    Philip
    P.S. Running Mac OSX 10.8.2 on MacBook Air, MacBook Pro and MacMini

    Thanks alot, Softwater. In fact, I have been playing around with that and found that the "get" statement in your script suggestion is not even necessary. The script I saved as a Finder Service is now :
    tell application "Finder"
              repeat with oneItem in selection as list
                             if label index of oneItem = 0 then
                                            set label index of oneItem to 5
                             else
                                            set label index of oneItem to 0
                             end if
              end repeat
    end tell
    By assigning a shortcut key to this one, I can now toggle labels.
    Additional trick I did is to restrict the applicability of the script to only movie-files (I am using this to change the labels of movies / TV shows on my computer which I still want to see versus the ones that I don't want to see anymore). I noticed during testing that the script would also color folders and drives selected in other finder windows than the one I was working in, so now it only works on movie files which is more what I want.
    Great tool, the AppleScript Editor and the Automator. Only a little bit a pitty that finding out about object structure and properties is not very straightforward in the AppleScript Editor (comparing to e.g. the VBA in MS Excel, which has an almost perfect help system and built-in reference). I am not a Microsoft fan in general, but when it comes to MS Excel VBA, I have not seen any built-in help system yet that approaches its usefulness ...
    I guess I will be "seeing" you again on this forum ... I am getting the taste of scripting again :-D

  • Multiple Select in same Query

    I'm building a report based on a single table in APEX. The report requires the following.
    select user, project, count(start date ), project, count(end date) where date between 01-jan-07 01-feb-07
    (simplified to show the idea)
    basicaly a count of projects that started between two dates and the ones that ended between the same two dates relating to the user.
    I have writen the selects to do both parts and they work BUT is it posible to glue them together in a single statement?
    I tried to searching the forum on "multiple selects" but never realy got anything close.
    Is it possible to do this type of select? If so does it have a special name (so I can try a search on that name)
    Thanks
    Bjorn

    First of all, '11-MAY-06' and '19-MAY-06' are not dates, they are strings. This has some important disadvantages:
    1) Oracle has to implicitly convert them to a date, when they are being compared to a date column
    2) Your application will be NLS (National Language Support) dependent, so they might break when you change a setting
    3) When compared to a varchar2 or other string column, the comparison will give incorrect results. For example: 12-MAY-06 will be between 06-JAN-06 and 18-JAN-06
    Bottom line: convert those dates to real dates using the to_date function, or the date 'yyyy-mm-dd' variant.
    Back to your question, apparently you don't want to count the number of occurences of CON_ACTUAL_START and CON_SIGN_OFF, but you only want to count them when this date is between the two boundary values. So use the following:
    select mli_clo
         , count(case when con_actual_start between date '2006-05-11' and date '2006-05-19' then 1 end)
         , count(case when con_sign_off between date '2006-05-11' and date '2006-05-19' then 1 end)
    ...Regards,
    Rob.

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Get all the values from a multiple select in a multipart form

    Hi there!
    I am using a form with enctype="multipart/form-data" in order to upload files from the form.
    I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
    The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
    Using servlets I have used this method:
    public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
    Is there a way to get all the values of a multi-valued parameter?
    Thanks a lot!
    Stefano

    Hi
    I have got solution for this problem so, I am listing here logic
    assume tag name of html
    <select name="moption" multiple="multiple">
    iterate it in as
    String moption="";
    boolean cnt=true;
    while(itr.hasNext())
    FileItem fi=(FileItem)itr.next();
    if(fi.isFormField())
    if(fi.getFieldName().equals("moption"))
    if(cnt==true)
    moption=fi.getString();
    cnt=false;
    else
    moption=moption+","+fi.getString();
    If wants more help then mail me your problem
    at [email protected]
    Thanks!
    Anand Shankar
    Edited by: AnandShankar on 6 Nov, 2009 12:54 PM

  • All values from multiple select LOV

    Hi.
    Ik have a customize screen for a chart where a can select days. That works. But i want the standard value to be 'all days', so the user does not have to click all seven days. When i have combobox i use in the where clause:
    "and (fieldname = :variable or :variable = '%')"
    For a mutiple select i use IN:
    "and fieldname IN :variable"
    That would make:
    "and (fieldname IN :variable or :variable = '%')"
    This does not work for a multiple select LOV.
    Anu ID how i can make it work???

    Try the following:
    (:variable = '%' or
    :variable <> '%' and fieldname in :variable)

  • Struts: getting multiple selected values from a select element

    Hi Friends,
    I am a total newbie with struts,I have manage to run a simple login script,
    Now I was wonderingif there is a select box and user has the ability to select multiple values from it how do I get those values in the *Form class
    my select tag looks like this
    <html:select property="listboxValue" mulitple="mulitple">
    ...options--
    </html:select>
    in the ****Form extends ActionForm{....I have setter and getters for getting the value  from select box as below
    public void setListboxValue(String value){
    this.listboxValue = value;
    and the getter is
    public String getListboxValue(){
    return this.listboxValue ;
    please never mind the missing brackets and such.
    What I was hoping to get to work was something like this
    public void setListboxValue(String[] value){
    this.listboxValue = value;
    but that does not work...If I have the an array being passed,it seems like this method is no even envoked
    Please guide me
    Thanks

    I'm having trouble to get in the ActionForm all the selected values in my multiple select. I select all the values by setting to true the selected attribute of all the options in a javascript function. In the ActionForm the variable is String[]. I'm not getting any ClassCastException, but I only receive the first value selected (String array with just one element).
    Select definition:
    <html:select name="detalleConsultaForm" property="destinatarios" multiple="true" size="8" >
    Javascript function:
    function validalistarelacion(campo)
    {   if (campo.length < 1)
    alert("Campo sin valores");
    campo.select();
    return false;
    for (var i = 0; i < campo.length; i++)
    campo.options.selected = true;
    return true;
    ActionForm:
    String[] destinatarios;
    public String[] getDestinatarios() {
    return destinatarios;
    public void setDestinatarios(String[] destinatarios) {
    this.destinatarios = destinatarios;
    What I get:
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG BeanUtils - setProperty(es.tme.apl.mante
    nimientosPlanificados.form.DetalleConsultaForm@59def5, destinatarios, [2320])
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG ConvertUtils - Convert String[1] to class
    'java.lang.String[]'
    Thnx

  • RE: Getting multiple values from more than one multiple select popup window

    I have a button on a JSP of mine that when clicked creates a popup window (right now it is called popup.html) with a multiple select menu.
    My question is how do I get all the values selected from the menu into my JSP (sample.jsp) so that I can set each of the values for my bean.
    The other problem is that I have more than one select multiple menu.
    Please help if you can. Any advice or suggestions here would be greatly appreciated!
    Thank you!

    I realize that I can use request.getParameterValues to get the values selected from my html because I am passing them to the hidden inputs I have and then using the request.getParameterValues to get each of the values.
    MY PROBLEM IS WHAT IF I HAVE 4 MULTIPLE SELECTS??? How can I use the same html popup menu to get the values from the 4 different multiple selects????
    I look forward to your response.
    This code is from my JSP:
    <INPUT TYPE="TEXT" NAME="Field1" SIZE="15">
    <INPUT TYPE="hidden" name="F1Rad1">
    <INPUT TYPE="hidden" name="Permission">
    <input type=button name=choice onClick="window.open('optionPicker.html','popuppage','width=250,height=100');" value="Options"></TD>
    Here is my optionPicker.html code for the pop up menu:
    <html>
    <head>
    <script language="JavaScript">
    function sendValue(s)
    var boxSize= s.options[0].value;
    var restrict     = s.options[1].value;
    window.opener.document.addNewForm.F1Rad1.value = boxSize;
    window.opener.document.addNewForm.Permission.value = restrict;
    window.close();
    </script>
    </head>
    <body>
    <center>
    <form name=selectform>
    <select multiple name=selectmenu size="2">
    <option value="large">Large Text Input Area
    <option value="restrict">Restricted Access
    </select>
    <p></p>
    <input type=button value="Select Option(s) For Field" onClick="sendValue(this.form.selectmenu);">
    </form>
    </center>
    </body>
    </html>

  • Problem getting all parameters from multiple select

    I have a multiple select option box that's properly displaying all the values. I'm using getParameterValues() to retrieve all of the selections but it returns the string[] with only the first selection made.
    JSP:
    <select name="selectList" multiple="true" size="2">
    <option value="value1"> Select 1
    </option>
    <option value="value2"> Select 2
    </option>
    </select>Servlet:
    String[] subset = request.getParameterValues("selectList");I think all my code above is fine. Anything else that would cause getParameterValues() to only return the top selected item?
    Thanks!

    The HTML cod is written in incorrect syntax, the browser nor the Server will understand.
    If you write it in XHTML then the proper syntax is:
    <select name="selectList" multiple="multiple" >
    If you write it in plain old HTML then the proper syntax is:
    <select name="selectList" MULTIPLE >
    (I'm not sure about this HTML syntax, but definitely the XHTML syntax shown above is correct)

  • How to perform multiple selection from dropdown list

    Hi,
           I have developed one application in which i have taken one dropdownbyindex and entered some values in it, now i need to have multiple selection of entries, can any one please suggest how to do these
    Regards,
    Prasanna

    A drop-down list is by definition a 1-from-many selector.
    Armin

  • How to get multiple selected fields in list

    Hello all,
    I am trying to get multiple selected value from a list but i dont know how to get multiple selected fields from a list though AS3.
    Actually i want to pass the selected fields to php, so for that i need to get the selections and send to php.
    Thankx..

    i want to put the selected fields of list in an array through AS3....
    actually......i figured it out how to do that...........
    Its simple......use
    list.selectedItems[index]
    and to get the number of items selected......
    list.selectedItems.length
    simple.....

  • Report Using Multiple Select

    hi
    I want to display a report with Multiple Select List like
    http://apex.oracle.com/pls/apex/f?p=267:16:
    Thanks
    Edited by: 805629 on Jan 6, 2011 9:28 PM

    Did you ever get this answered???
    This is exactly what I am looking for!

  • Get Selections From ALV on Multiple Selection Mode

    Hi,
    How can i get values of selected rows from ALV that has selection '0..n' (multiple selection) ?
    Can somebody help me pls?
    Thanks.

    Hi Nurullah,
    Steps to make multiple rows selectable in ALV:
    1) Create the selection property of the node that you are binding to the DATA node as o..n
    2) Un-check the, "Initialization Lead Selection" checkbox for the node which you are using to bind to the DATA node
    3) In the WDDOINIT method specify the ALV's selection mode as MULTI_NO_LEAD. It is important that you set the selection mode to MULTI_NO_LEAD or else in the end you would be capturing 1 row lesser than the total number of rows the user has selected. This is because 1 of the rows would have the LeadSelection property & our logic wouldnt be reading the data for that row. Check the example code fragment as shown below:
    DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_value = lo_interfacecontroller->get_model( ).
      CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
        EXPORTING
          value = cl_wd_table=>e_selection_mode-MULTI_NO_LEAD.
    Steps to get the multiple rows selected by the user
    In order to get the multiple rows which were selected by the user you will just have to call the get_selected_elements method of if_wd_context_node. So as you can see its no different from how you would get the multiple rows selected by the user in a table ui element. First get the reference of the node which you have used to bind to the ALV & then call this method on it. Check the example code fragment below:
    METHOD get_selected_rows .
      DATA: temp TYPE string.
      DATA: lr_node TYPE REF TO if_wd_context_node,
                wa_temp  TYPE REF TO if_wd_context_element,
                ls_node1 TYPE wd_this->element_node_flighttab,
                lt_node1 TYPE wd_this->elements_node_flighttab.
      lr_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' ).
    " This would now contain the references of all the selected rows
      lt_temp = lr_node->get_selected_elements( ).
        LOOP AT lt_temp INTO wa_temp.
    " Use the references to get the exact row data
          CALL METHOD wa_temp->get_static_attributes
            IMPORTING
              static_attributes = ls_node1.
          APPEND ls_node1 TO lt_node1.
          CLEAR ls_node1.
        ENDLOOP.
    ENDMETHOD.
    Hope this helps resolve your problem.
    Regards,
    Uday

  • Passing multiple select value from BI publisher to PL/SQL functions

    Hi - I have designed a report which pass parameters (Multi select) into a function to get the output result. When a single parameter value is passed to the function, report is being displayed. When multi select value is passed to the function it is returning the error `wrong number or types of arguments in call to 'F_PROCESS_WAVE_DATA'. When i checked the parameters passed to the function, i can see each multi select value is treated as different value and is assigned to different parameter in the function.
    Any help on passing the multi select parameter into function will be helpful.
    Regards,
    Vikram.

    All - Issue was resolved. I followed the following steps to resolve the issue
    1. Create a PL/SQL table type variable as VARCHAR2 in the database - Say as Larray
    2. Create PL/SQL type record and table for the record in database. Lrec, Ltable
    3. In BI report pass multiple select LOV variable as Larray(variable).
    4. In DB function, Parameter should be defined as LARRAY.
    5. Return PL/SQL table type Ltable from the function.
    Regards,
    Vikram.

  • Multiple select options in 1 drop down box?

    Hi,
    I have created a form that works perfectly except for the fact that I need to provide multiple select options in the 1 drop down box; for example, I'm asking what product the customer is interested in and his answer could be multiple items such as Soap, Sanitizer, Hand Towels, Face Cloths etc...
    At the moment, the customer can only select 1 item not multiple.
    Is this possible?
    Thanks in advance for the help!

    Hi,
    It is not possible to allow the user to select multiple items in a dropdown list.
    You could use a list box, which does allow multiple selections.
    Good luck,
    Niall
    Assure Dynamics

Maybe you are looking for

  • I am looking to buy an external hard drive for my maced to time machine.

    I am looking an external hard drive for my mac and I do see one in PC world that is compatible with time machine. I do not want it connected to time machine and wonder if I can use it without connecting.

  • Cannot Debug SSIS packages in 64 bit mode.

    Hi, To anyone who may be able to help.  We are using SQL server 2014 Enterprise addition.  Visual studio 2013, SSDT latest version installed, all 64 bit tools installed.  I have tried to run my packages  with the "Run64bitRuntime" set to true ( proje

  • After Effects Error 5070 :: 2 Please Help !

    Hi, My computer: 2011 iMac 27", 3.4 Ghz, 32 GB RAM, AMD Radeon HD 6970M + 2 x 24" Cinema Displays My problem: 1- In After Effects when I try to enable Ray-Traced 3D I get error 5070 :: 2 (see screenshot 1) 2- I updated the CUDA drivers to version 5.5

  • Repository database upgrade

    hi Regarding the repisotory database upgarde from 10.1.4.0 to 11.1.0.7 I have run utlu111i.sql script. I fixed all the warnings except: WARNING: --> Database contains schemas with objects dependent on network packages. .... Refer to the 11g Upgrade G

  • Assigning siteminder resource to an IDM user

    The IDM URL is currently protected by siteminder so that we can initiate single signon. My requirement is to have only the SSO login page and remove the IDM login module. I cerated a siteminder LDAP resource pointing to our siteminder server and a lo