Select options range table to be passed to Assistance class

Hi Guru's,
I have an assistance class where I have to write all my select queries. I have a selection screen with multiple Select options (as input fields). Now I want to pass the select options range table to assistance class.
Please let me know if you have any sample code for this which may also include building range tables for select options.
Thanks,
Pradeep

Hi Pardeep,
U can use following code: for field ERDAT
data: rt_ERDAT      type ref to data,
        R_ERDAT       TYPE RANGE OF VIQMEL-ERDAT,
        R_ERDAT_line  LIKE LINE OF R_ERDAT,
field-symbols: <fs_ERDAT> type table.
Retrieve the data from the select option
  rt_ERDAT = wd_this->m_handler->get_range_table_of_sel_field( i_id = 'ERDAT' ).
Assign it to a field symbol
  assign rt_ERDAT->* to <fs_ERDAT>.
copy field symbols to local variable
  R_ERDAT = <fs_ERDAT>.
CALL METHOD WD_ASSIST->"METHOD_NAME"
      R_ERDAT        = R_ERDAT
where in class method:
R_ERDAT     Importing     Type     ZU5QNM_ERDAT_T
ZU5QNM_ERDAT_T : is a table type of ZU5QNM_ERDAT_R
and ZU5QNM_ERDAT_R has following structure :
SIGN     ACE_SIGN     CHAR     1     0     Debit/Credit Sign (+/-)
OPTION     ACE_OPTION     CHAR     2     0     Option for Ranges Tables
LOW     ERDAT     DATS     8     0     Date on Which Record Was Created
HIGH     ERDAT     DATS     8     0     Date on Which Record Was Created
I hope this wiol solve ur problem.
Regards,
Vishal.

Similar Messages

  • To yashpal Gupta-Select option range table

    Dear Yashpal,
                        I have created range table and put conditions and passed empty table in this fashion.still the result is the same (If i give both input then functionality works,only one of then is given then sy-subrc = 4.).I am wondering ehther u haev passed empty table correctly or not.
    if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
        wa_salesno-sign = 'I'.
        wa_salesno-option = 'EQ'.
        wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
        APPEND wa_salesno TO r_salesno.
        CLEAR : wa_salesno .
      else.
        wa_salesno-sign = 'I'.
        wa_salesno-option = 'EQ'.
        wa_salesno-LOW = space.
        APPEND wa_salesno TO r_salesno.
         CLEAR : wa_salesno .
      endif.
      if  Stru_Cn_Selcrtr-ca_brand is not initial.
        wa_brandid-sign = 'I'.
        wa_brandid-option = 'EQ'.
        wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
        APPEND  wa_brandid TO  r_brandid.
        CLEAR :  wa_brandid .
      else.
        wa_brandid-sign = 'I'.
        wa_brandid-option = 'EQ'.
         wa_brandid-LOW = space.
        APPEND wa_brandid  TO  r_brandid.
        CLEAR : wa_brandid  .
      endif.
    **Situation where these fields are not provided  on the screen.
    *If any of these are given then select data accordingly.
        select * from ZNSLVWHDIMMD_LCL
                 into corresponding fields of table IT_VIEW
                 WHERE SALESRLNO in  r_salesno
    *             and   CREATEDBY in It_crtby_selopt
    *            and   STARTDATE in It_validfrm_selopt
    *             and   ENDDATE   in It_validto_selopt
    *             and  STATUS     in It_status_selopt1
                 and   BRANDID   in r_brandid.
    *             and   MODELNO   in It_model_selopt

    dynamic selection on data.thnx

  • How to Captured Value into Select-Options Range Table Without "Enter"

    Hi,
    I defined a set of Select-Options in the Web Dynpro. I found that the value for the Select-Options will not be captured whenever I manually type in the value instead of choosing it from F4 Help Drop Down.
    However, this problem can be resolved if I manually type in the value for Select-Options in the Selection Field and I press "Enter". Without pressing "Enter" value will not be captured.
    Any solution for this issue? Please help.

    Hi Kris,
    My problem is only when the user key in the value themselves rather than choosing it from Select-Options drop down value. Most of the time user will know what value to key in and will skip the step to choose from the Drop Down List. Thus, if this happen, the value keyed in by the user will not be able to capture into the range table.
    I am using this logic to capture the value for selection item:
      wd_this->m_helper->get_selection_screen_items(
        IMPORTING et_selection_screen_items = lt_sel_item ).
    * Values From Selection Screen
      LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
        CASE <fs_sel_item>-m_id.
          WHEN `PERNR`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_pernr>.
          WHEN `BUKRS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_bukrs>.
          WHEN `STAT2`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_stat2>.
          WHEN `WERKS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_werks>.
          WHEN `BTRTL`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_btrtl>.
          WHEN `PERSG`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persg>.
          WHEN `PERSK`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persk>.
          WHEN `ABKRS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_abkrs>.
          WHEN `BEGDA`.
            ASSIGN <fs_sel_item>-m_value->* TO <fs_begda>.
        ENDCASE.
      ENDLOOP.
    E.g. User key in the BUKRS without using the Drop Down Value provided by the Select-Options. For this case, <fs_bukrs> table will be initial as no value is captured.
    Edited by: Girish Nabar on Apr 21, 2011 8:55 AM

  • Dynamic Select Options/Ranges Maintain and Display in my screen

    Hi I am trying to figure out if I can create a screen which will will read various select-options I have stored in a custom table but am having trouble finding something which will allow me to display each of 'select-options' in my dynpro... has anyone ever done this?
    I'd rather not reinvent the wheel or mimic - does anyone know of a way to basically use a loaded range and display it on a screen for display or maintenance using standard SAP routines/classes?
    Thanks in advance!
    Roc..

    @Adrian - I got your email regarding the code sample, here is a quick example of how to popup a dynamic selection for up to 5 tables...
    *& Report  ZRS_DYNAMIC
    REPORT  zrs_dynamic.
    * START Dynamic Range Selection Definitions
    * Definition of the selection_if variable, which is used to reference
    * the selections obtained
    DATA: gv_selid TYPE rsdynsel-selid.
    * Definition of the TABLES_TAB table for use in providing the list of
    * fields available for creating select options from
    DATA: gt_tables TYPE STANDARD TABLE OF rsdstabs.
    DATA: gs_tables TYPE rsdstabs.
    PARAMETERS: p_tab1 TYPE tabname DEFAULT 'KNA1',
                p_tab2 TYPE tabname DEFAULT 'KNB1',
                p_tab3 TYPE tabname DEFAULT 'KNC1',
                p_tab4 TYPE tabname DEFAULT 'KNVV',
                p_tab5 TYPE tabname DEFAULT 'KNVP'.
    START-OF-SELECTION.
      gs_tables-prim_tab = p_tab1 .APPEND gs_tables TO gt_tables.
      gs_tables-prim_tab = p_tab2 .APPEND gs_tables TO gt_tables.
      gs_tables-prim_tab = p_tab3 .APPEND gs_tables TO gt_tables.
      gs_tables-prim_tab = p_tab4 .APPEND gs_tables TO gt_tables.
      gs_tables-prim_tab = p_tab5 .APPEND gs_tables TO gt_tables.
    * Definition of Table which includes the select-option range for field
      TYPES: ty_selopt_t TYPE  rsdsselopt OCCURS 10.
    * Definition of field name and select option range table
      TYPES: BEGIN OF ty_frange,
               fieldname TYPE rsdstabs-prim_fname,
               selopt_t TYPE ty_selopt_t,
             END OF ty_frange.
      TYPES: ty_frange_t TYPE ty_frange OCCURS 10.
      TYPES: BEGIN OF ty_range,
               tablename LIKE rsdstabs-prim_tab,
               frange_t TYPE ty_frange_t,
             END OF ty_range.
      TYPES: ty_range_t TYPE STANDARD TABLE OF ty_range.
      DATA: it_ranges TYPE ty_range_t.
    * work areas
      DATA: gs_ranges TYPE ty_range.
      DATA: gs_frange TYPE ty_frange.
      DATA: gs_selopt TYPE rsdsselopt.
      DATA: gt_ranges TYPE ty_range_t.
      DATA: gt_frange TYPE ty_frange_t.
      DATA: gt_selopt TYPE ty_selopt_t.
    * Definition of the fields list avaiable
      TYPES: ty_fields TYPE STANDARD TABLE OF rsdsfields.
      DATA: it_fields TYPE ty_fields.
      DATA: gs_fields TYPE rsdsfields.
    * END Dynamic Range Selection --------------------------------------------
      CALL FUNCTION 'FREE_SELECTIONS_INIT'
        EXPORTING
          kind         = 'T'
        IMPORTING
          selection_id = gv_selid
        TABLES
          tables_tab   = gt_tables.
      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 'FREE_SELECTIONS_DIALOG'
        EXPORTING
          selection_id    = gv_selid
          title           = 'Select WHERE criteria for Rule'(s12)
          as_window       = 'X'
          start_row       = 7
          start_col       = 10
        IMPORTING
          field_ranges    = it_ranges
        TABLES
          fields_tab      = it_fields
        EXCEPTIONS
          internal_error  = 1
          no_action       = 2
          selid_not_found = 3
          illegal_status  = 4
          OTHERS          = 5.
    Edited by: Rocco Scocco on Jun 17, 2010 3:48 PM
    Edited by: Rocco Scocco on Jun 17, 2010 3:49 PM

  • SELECT-OPTIONS in table maintenance generator screen

    Hi
    Is it possible to create SELECT-OPTIONS in table maintenance screen?
    My requirement is to allow the user to enter single Company code and Range of G/L Accounts in the Table Maintenance input screen. Please let me know.
    Thanks
    Abdul Hakim

    Hello Tamas,
    As a matter of fact we can add a custom selection-screen to the TMG screen & without manually modifying the TMG
    You can do so by using the [Event AA: Instead of the Standard Data Read Routine|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f56a9d111d1a5690000e82deaaa/content.htm].
    Please check the code snippet:
    DATA: gv_fldate TYPE s_date.
    * User-defined selection-screen
    SELECTION-SCREEN: BEGIN OF SCREEN 9000.
    PARAMETERS:     p_carrid TYPE s_carr_id OBLIGATORY.
    SELECT-OPTIONS: s_fldate FOR gv_fldate OBLIGATORY.
    SELECTION-SCREEN: END OF SCREEN 9000.
    *&      Form  sub_yvsflight_event_aa
    *       text
    FORM sub_yvsflight_event_aa.
      DATA: ls_temp_data TYPE yvsflight,
            lt_temp_data TYPE STANDARD TABLE OF yvsflight.
    * Call the user-defined selection-screen
      CALL SELECTION-SCREEN 9000 STARTING AT 25 10.
    * Populate the int. table TOTAL
      PERFORM get_data_yvsflight.
    * Delete the records which are not required
      LOOP AT total.
        ls_temp_data = <vim_total_struc>. "Copy to local struct.
        IF ls_temp_data-carrid NE p_carrid OR
           ls_temp_data-fldate NOT IN s_fldate.
          DELETE total. "Remove the record from the TOTAL
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "sub_yvsflight_event_aa
    BR,
    Suhas

  • Passing select options internal table to BAPI attributes...

    Hello Web Dynpro Gurus,
    When I get the values from select options into interna table, how can I pass the same to the attribtues of the importing/exporting nodes of the BAPI by reading the context.
    Please help .
    Regards,
    Jainam.

    Hello,
    The code in bold below sets attributes  of my node one by one for the select option node atttributes i.e. SIGN, OPTION, LOW and HIGH.
    Instead of that how can I set all attributes of node which is of type select-options in one shot.
    method ONACTIONSEARCH .
    DATA: S_WAERS TYPE REF TO DATA.
    FIELD-SYMBOLS:  <FS_WAERS> TYPE TABLE.
    Retrieve the data from the select option
      S_WAERS = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'WAERS' ).
      Assign it to a field symbol
       ASSIGN S_WAERS->* TO <FS_WAERS>.
       data:
        Node_Rep_Curr                       type ref to If_Wd_Context_Node,
        Elem_Rep_Curr                       type ref to If_Wd_Context_Element,
        Stru_Rep_Curr                       type If_Select_View=>Element_Rep_Curr .
    navigate from <CONTEXT> to <REP_CURR> via lead selection
      Node_Rep_Curr = wd_Context->get_Child_Node( Name = IF_SELECT_VIEW=>wdctx_Rep_Curr ).
    get element via lead selection
      Elem_Rep_Curr = Node_Rep_Curr->get_Element(  ).
    get all declared attributes
      Elem_Rep_Curr->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Rep_Curr ).
        Node_Rep_Curr->set_attribute(
        Exporting
          name = 'SIGN'
          value = 'I' ).{code}
    endmethod.
    Edited by: Jainam Shah on Feb 5, 2010 2:55 PM

  • Function to append a 0 to the front of values in a Select-Options range?

    Hi,
    Is anyone aware of any function or class that will append a 0 (or any character) to the front of a range (or set of ranges) in an internal table of a Select-Options from a selection screen?
    Hope that made sense.
    Thanks,
    Andy

    Hi
    Why not?
    My code it's only a sample, but it can create a routine for a generic range table based on the fields of the internal table for the range have always the same names:
    SIGN, OPTION, LOW and HIGH:
    TABLES: BKPF.
    SELECT-OPTIONS: SO_BELNR FOR BKPF-BELNR,
                    SO_GJAHR FOR BKPF-GJAHR,
                    SO_BUKRS FOR BKPF-BUKRS.
    AT SELECTION-SCREEN.
      PERFORM  CONV_RANGE USING: SO_BELNR[],
                                 SO_GJAHR[],
                                 SO_BUKRS[].
    *&      Form  CONV_RANGE
    *       text
    *      -->T_RANGE    text
    FORM CONV_RANGE USING T_RANGE TYPE TABLE.
      FIELD-SYMBOLS: <W_RANGE> TYPE ANY,
                     <W_LOW>   TYPE ANY,
                     <W_HIGH>  TYPE ANY.
      LOOP AT T_RANGE ASSIGNING <W_RANGE>.
        ASSIGN COMPONENT 'LOW' OF STRUCTURE <W_RANGE>  TO <W_LOW>.
        ASSIGN COMPONENT 'HIGH' OF STRUCTURE <W_RANGE> TO <W_HIGH>.
        PERFORM CONVERSION_EXIT_ALPHA_INPUT USING: <W_LOW>,
                                                   <W_HIGH>.
      ENDLOOP.
    ENDFORM.                    "CONV_RANGE
    *&      Form  CONVERSION_EXIT_ALPHA_INPUT
    *       text
    *      -->INPUT      text
    FORM CONVERSION_EXIT_ALPHA_INPUT USING P_INPUT.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_INPUT
        IMPORTING
          OUTPUT = P_INPUT.
    ENDFORM.                    "CONVERSION_EXIT_ALPHA_INPUT
    Max

  • Select-options/range in screen

    Hi all,
    I just wanted to display select-options in the screen numbered 1000,
    by putting which control can i do this ??........
    regards
    Jose

    if u want to pass values in the selection screen use
    Ex:
             selection-screen begin of block b1
               select-options : p_matnr for mara-matnr.
             selection-screen end of block b1.
    else if u want to pass while execution of program
    use Ranges
    Ex:  ranges: p_matnr for mara-matnr.
             Pass variables
             p_matnr-low, p_matnr-high....................
    Regards,
    Ajay

  • Select/option with cfquery - how to pass selected value to field downform

    I have a form that has a basic select/option dropdown using a cfquery result.  I would like to use the value that the user selects to pre-populate an editable 'title' field further along on the form.  For example:
    <form action="index.cfm?fuseaction=sendEmail" method="POST" name="email_approval" enctype="multipart/form-data">
    <table width="500" border="1" cellspacing="0" cellpadding="2" align="center">
    <tr>
      <td align="left">Request ID:</td>
      <td align="left" width="100"><b><cfoutput>#RequestId#</cfoutput></b></td>
      <td align="left">Application:</td>
      <td align="left" width="400"><b><cfoutput>#this_request.app_abbrev#</cfoutput></b></td>
      <td align="left">WR/RD#:</td>
      <td align="left" width="400"><b><cfoutput>#this_request.request_number#</cfoutput></b></td>
    </tr>
    <tr>
      <td align="left">Email Type:</td>
      <td align="left" colspan="2">
          <select name="approval_type" size="1" >
          <cfoutput query="approval_types">
             <option value="#approval_types.approval_descrip#" style="font-size:8pt">#approval_types.approval_descrip#</option>
           </cfoutput>
         </select>
      </td>
      <td align="left"> </td>
      <td align="left">Date Sent:</td>
      <td align="left"><b><cfoutput>#dateformat(Now(), "MM/DD/YYYY")#</cfoutput></b></td>
    </tr>
      <cfset subjectLine = "#RequestId#" & " " & "#approval_types.approval_descrip#" & " Approval Request" >
    <script  type="text/javascript" language="JavaScript">
    <cfoutput>
      var #toScript(subjectLine, "jsLine")#;
    </cfoutput>
    </script>
    <script  type="text/javascript" language="JavaScript">
    function setValue()
      document.getElementById('subject').value =jsLine;
    </script>
    <tr>
      <td align="left">Subject:</td>
      <td align="left" colspan="5">
       <b><input type="Text" name="subject"  required="Yes" size="70" maxlength="70" onClick="setValue();"></b>
    </td>
    </tr>
    When the user gets to the subject field,the onClick will pre-populate the field with the combined value using <cfset subjectLine = "#RequestId#" & " " & "#approval_types.approval_descrip#" & " Approval Request" >.  regardless of what is selected, it uses the first item in the query list because that is what is rendered when the form is loaded (got that).  I figure that I need a javascript onChange event for the select statement for the dropdown, but can't figure out how to pass this javascript variable back to the CF form.  Any ideas, or am I stuck?
    Thanks in advance for your thoughts!

    You will need to do it with JS as the values you want to access are not set until the form is submitted. This should give you what you want.
    It uses a hidden form field to hold the requestID, that is then accessed with JS. (I am assuming this value is available when the page loads)
    <form action="index.cfm?fuseaction=sendEmail" method="POST" name="email_approval" enctype="multipart/form-data">
    <input type="hidden" name="requestID" id="reqID" value="1234" />
    <table width="500" border="1" cellspacing="0" cellpadding="2" align="center">
    <tr>
      <td align="left">Email Type:</td>
      <td align="left" colspan="2">
          <select name="approval_type" id="approval_type" size="1" >
             <option value="test" style="font-size:8pt">test</option>
         </select>
      </td>
      <td align="left"> </td>
      <td align="left">Date Sent:</td>
      <td align="left"><b><cfoutput>#dateformat(Now(), "MM/DD/YYYY")#</cfoutput></b></td>
    </tr>
    <script  type="text/javascript" language="JavaScript">
    function setValue(){
        var e = document.getElementById("approval_type");
        var approval_type_value = e.options[e.selectedIndex].value;
        var subjectLine = document.getElementById('reqID').value + ' ' + approval_type_value + ' Approval Request';
        document.getElementById("subject").value = subjectLine;
        alert(subjectLine); 
    </script> 
    <tr>
      <td align="left">Subject:</td>
      <td align="left" colspan="5">
       <b><input type="Text" name="subject"  required="Yes" size="70" maxlength="70" onClick="setValue();"></b>
    </td>
    </tr>

  • Entries in Select-Options Range

    Hi Experts,
    I am experiencing short dump if i give more no of entries in select option (in range)
    can any one please suggest a solution to this?
    Points will be awarded.
    Thanks
    Dany

    Maximum number of entries in select options is only around 1630, you cannot give more than that
    i guess it is around 1600 - 1700
    chk this program , if u increase the do loop to 1800 it will give dump
    REPORT ychatest LINE-SIZE 350.
    TABLES : mara.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE mara.
    DATA:    END OF itab.
    DO 1600 TIMES.
      s_matnr-sign = 'I'.
      s_matnr-option = 'BT'.
      s_matnr-low = ''.
      s_matnr-high = ''.
      APPEND s_matnr.
      CLEAR s_matnr.
    ENDDO.
    SELECT  * FROM mara INTO TABLE itab WHERE matnr IN s_matnr.
    WRITE : 'hi'.
    Message was edited by:
            Chandrasekhar Jagarlamudi

  • Dynamical declaration of SELECT-OPTIONS / RANGE possible

    Hi fellow programmers,
    does anybody know whether there is a way to declare a
    SELECT-OPTION respectively a RANGE dynamically during
    runtime? I have both the name of the range to be created
    and the DDIC-referencefield stored in variables.
    Thanks in advance for your appreciated help.
    Andreas

    Hi Andreas,
    DYNAMIC PROGAM SHOWS SELECTION-SCREEN.
    1 Sap does not allow execution of dynamic programs from memory.
      (dynamic means, only in memory, not in database)
    2. However, it allows execution of dynamic FORM/ENDFORM.
    3. But your requirement is of selection-screen using parameters and select-options.
    4. Hence, we can use the concept of DYNAMIC PROGRAM
       (build the program code in an internal table)
       using command
       INSERT REPORT 'ZDYN01' FROM itab.
       THIS WILL SAVE / OVERWRITE THE PRGRAM IN DB.
       HENCE, BE CAUTIOUS.
    5. Just Copy/Paste this sample program
       It will generate a dynamic program called ZDYN01.
       it will also execute it and
       SHOW SELECTION-SCREEN
       of the DYNAMIC PROGRAM.
    6. You may build up yuour own logic
        of constructing selection-screen from   
         required data stored in tables.
    7.
    REPORT abc.
    Data
    DATA : BEGIN OF itab OCCURS 0,
           l(72) TYPE c,
           END OF itab.
    DATA : prog(8) TYPE c.
    Make Dynamic Program
    CLEAR itab.
    itab-l = 'REPORT ABC.'.
    APPEND itab.
    itab-l = 'PARAMETERS : MATNR LIKE MARA-MATNR.'.
    APPEND itab.
    itab-l = 'START-OF-SELECTION.'. APPEND itab.
    itab-l = 'WRITE :/  MATNR.'. APPEND itab.
    Generate Program
    INSERT REPORT 'ZDYN01' FROM itab.
    COMMIT WORK. "----- COMMIT NECESSARY FOR DB
    *------ Call Report
    SUBMIT zdyn01 VIA SELECTION-SCREEN.
    HOPE THE ABOVE HELPS.
    Regards,
    Amit M.

  • Update a select-option From Table

    Hi,
    I'm originally a C++ developer trying to learn ABAP.
    I want to append values to a select-option from a table if another select-option is specified.  I wrote some code that I believe will work but looks very inefficient to me.  Any advice on how to streamline this process would appreciated.
    The following is pseudo code and I left out some tweaks for simplicity and understanding but the basic idea is there.  I want to add selection criteria to a select-option based upon a second select option (that may or may not be provided) table lookup.
    Example:
    DATA: groups TYPE table3.
    SELECT-OPTIONS:
         s_accountNo FOR table1-accountNo,
         s_accountGroupNo FOR table2-accountGroupNo.
    **** get the Account Groups that meet the selection criteria.
    START-OF-SELECTION
         SELECT * INTO TABLE groups
              FROM table3
              WHERE accountGroupNo IN s_accountGroupNo.
    **** Remove duplicate accounts from the Account Groups
    SORT groups BY accountNo.
    DELETE ADJACENT DUPLICATES FROM groups COMPARING accountNo.
    **** Append the account #'s onto the s_accountNo range/select-option
    LOOP AT groups.
         APPEND groups-accountNo TO s_accountNo.
    ENDLOOP.
    **** manually edit the  s_accountNo to have the correct option/sign for use in further select statements.
    LOOP AT s_accountNo.
         s_accountNo-sign = 'I'.
         s_accountNo-option = 'EQ'.
         MODIFY s_accountNo.
    ENDLOOP.
    Thanks much,
    -Chris

    The actual selection is fairly complicated from my point of view.  I wrote the accountNo example to make things less confusing for me as much as anyone else, not to hide anything.  I also didn't expect this amount of feedback, though it is appreciated.
    The eventual select statement that is done is the following:
      SELECT DISTINCT vttp~zseq_num
                      likp~vbeln
                      likp~lprio
                      likp~vstel
                      lips~werks
                      likp~lgnum
                      lips~posnr
                      lips~lgort
                      lips~vgbel
                      lips~vgpos
                      lips~sobkz
                      lips~lfimg
                      lips~vrkme
                      lips~matnr
                      lips~volum
                      mara~raube
                      vttk~dplbg
                      vttp~tknum
                      vttp~tpnum
                      likp~berot
                      likp~vkorg
                      likp~lfart
                      INTO TABLE temp_deliveries
      FROM vttk
           INNER JOIN vttp
           ON vttk~tknum = vttp~tknum
           INNER JOIN likpuk AS likp
           ON vttp~vbeln = likp~vbeln
           INNER JOIN lipsup AS lips
           ON likp~vbeln = lips~vbeln
           INNER JOIN mara
           ON lips~matnr = mara~matnr
      WHERE likp~vstel = p_vstel
        AND lips~werks = p_werks
        AND likp~lgnum IN s_lgnum
        AND likp~vbeln IN s_vbeln
        AND lips~vgbel IN s_vgbel
        AND vttk~dplbg IN s_dplbg
        AND vttk~tknum IN s_tknum
        AND mara~raube = p_raube
        AND likp~lfart IN ('ZLF', 'NL')
        AND lips~kosta <> 'C'
        AND lips~kosta <> ''
        AND likp~kostk <> 'C'
        AND likp~vbtyp = outbound.
    and the structure it is put into is the following:
    TYPES: BEGIN OF type_deliveries,
              zseq_num    TYPE vttp-zseq_num,
              vbeln       TYPE likp-vbeln,
              lprio       TYPE likp-lprio,
              vstel       TYPE likp-vstel,
              werks       TYPE likp-werks,
              lgnum       TYPE likp-lgnum,
              posnr       TYPE lips-posnr,
              lgort       TYPE lips-lgort,
              vgbel       TYPE lips-vgbel,
              vgpos       TYPE lips-vgpos,
              sobkz       TYPE lips-sobkz,
              lfimg       TYPE lips-lfimg,
              vrkme       TYPE lips-vrkme,
              matnr       TYPE lips-matnr,
              volum       TYPE lips-volum,
              raube       TYPE mara-raube,
              dplbg       TYPE vttk-dplbg,
              tknum       TYPE vttk-tknum,
              tpnum       TYPE vttp-tpnum,
              berot       TYPE likp-berot,
              vkorg       TYPE likp-vkorg,
              lfart       TYPE likp-lfart,
              sdabw       type likp-sdabw,
              orig_lgort  TYPE lips-zzorig_lgort,
              selected    TYPE flag,
              counter(15) TYPE n,
            END OF type_deliveries.
    Currently there is a select option for tknum and I am attempting (successfully with my change shown above, though as many have pointed out I may be misusing the intended functionality) to add another select-option for s_pickno which is a field of a custom table that has pickno as one of it's unique keys and tknum as another of it's fields.  The idea is to be able to take a pickno and use it to find all the tknum's associated and then use them in the select statement above as well as any tknum's provided as initial input by the user.  If there is a better method than modifying the s_tknum selection I'm open to feedback.
    Apologies that my initial example did not portray this, but being new I was a little overwhelmed myself and want something I can wrap my head around better.  There's my wall of text

  • Single select option in table view as radio button without design

    Hi,
    When I use the Content design = "Design2002" or design = "Design2003" then I get a checkbox in table view by giving the single select option. But when I do not use any design for the Content then I get a radio button in the table view.
    How do I get a radio button in the table view with Content Design = "Design2002" or design = "Design2003"?
    Message was edited by: Brian McKellar
    Assume you are asking about design=2002 versus 2003? Updated question.

    Hallo Sachin,
    Later this afternoon I will check your question with a colleague for an answer. We are all offsite today.
    Until then, it would be good if you review your questions Tableview radio button event..
    ++bcm

  • Passing SELECT-OPTIONS and Internal Tables to SUBROUTINES

    Hi Guys
    In the code below my colleague has created her own table types in order to pass a select option and internal tables to her subroutine. Is there an easier way of making them known to the subroutine.
    data : v_vbeln type vbeln_vf,
          it_bdoc type table of vbrp,
          it_t006 type table of t006a,
          wa_bdoc type vbrp,
          wa_t006 type t006a,
          it_bdoc2 type table of zsswathi_st_vbeln,
          wa_bdoc2 type zsswathi_st_vbeln
    select-options s_vbeln for v_vbeln matchcode object zswathi_vbeln obligatory.
    start-of-selection.
    perform bdoc using s_vbeln[]
                 changing it_bdoc
                          it_bdoc2
                          it_t006.
      loop at it_bdoc2 into wa_bdoc2.
    form bdoc using f_s_vbeln type ZSWATHI_ST_SELECT_OPTION_TA_TY       " all these are table types. for select options, a structure is created and then a table type for it is created.
            changing f_it_bdoc type zswathi_vbrp_ty_ta
                     f_it_bdoc2 type zswathi_vbeln_ty_ta
                      f_it_t006 type ZSWATHI_T006_TA_TY.
    select * from vbrp into table f_it_bdoc where vbeln in f_s_vbeln.
          if f_it_bdoc is not initial.
          select  vbeln sum( netwr ) prsdt from vbrp into table f_it_bdoc2 where vbeln in f_s_vbeln group by vbeln prsdt.
          sort f_it_bdoc2 by vbeln.
          "select * from t006a into table it_t006 for all entries in it_bdoc where msehi = it_bdoc-vrkme.
          select * from t006a into table f_it_t006 for all entries in f_it_bdoc where msehi = f_it_bdoc-vrkme.
       endif.
        endform.

    Hi Brett,
    1. you can use a select-options-range in a FORM subroutine also without passing it as a parameter because parameters and select-option range tables are global fields in their program.
    2. If you need a parameter, declare it as type table or type standard table or type any table. You do not need any special table type.
    Regards
    Clemens

  • Generating HANA where clause for select options having CP as the operator

    Hi All
    I am trying to generate where clause in HANA sql from the select options range table .
    I tried using the function modules  RSDS_RANGE_TO_WHERE and  RH_DYNAMIC_WHERE_BUILD .
    They are working for most of the cases . But  , when the range table has entries like
    Fieldname   sign opt  low high
    VBELN        I/E    CP  *4*
    Both of them fail to generate the right result .
    Could you suggest any other function modules , which take care of all such cases like include single values , exclude single values , incluse and excluse ranges , patterns etc .
    Thanks and Best Regards
    Varsha

    Hi Karthik,
    this is the api, I have done,
    create or replace
    FUNCTION get_where_clause_for_emp_req (
       emp_id       IN   NUMBER,
       salary            IN   NUMBER,
       job         IN   VARCHAR2,
       dept IN NUMBER
       RETURN VARCHAR2
    IS
       l_where_clause   VARCHAR2 (2000);
    BEGIN
       IF (    (emp_id IS NULL)
           AND (salary IS NULL)
           AND (job IS NULL)
           AND (deptIS NULL)
       THEN
          RETURN NULL;
       ELSE
          l_where_clause := 'WHERE ';
       END IF;
       IF (emp_id IS NOT NULL)
       THEN
          l_where_clause :=
                        l_where_clause || ' emp_id =' || emp_id || '';
       END IF;
       IF ((emp_id IS NOT NULL) AND (salary IS NOT NULL))
       THEN
          l_where_clause :=
                          l_where_clause || ' AND salary= ' || salary;
       ELSIF (salary IS NOT NULL)
       THEN
          l_where_clause := l_where_clause || ' salary= ' || salary;
       END IF;
       IF (((salary IS NOT NULL) AND (dept IS NOT NULL)) OR ((emp_id IS NOT NULL) AND (salary IS NULL) AND (dept IS NOT NULL)))
       THEN
          l_where_clause := l_where_clause || ' AND dept= ' || dept;
       ELSIF (status_i IS NOT NULL)
       THEN
          l_where_clause := l_where_clause || ' dept= ' || dept;
       END IF;
    l_where_clause := l_where_clause || ' ;';
       RETURN l_where_clause;
    END;I have done for three parameters, i need to include two more input parameters for this function, so I see going forward my testing cases will increases,
    so am looking for the best solution
    Thanks
    Edited by: NSK2KSN on Jul 7, 2010 3:11 PM

Maybe you are looking for