Populating select-option, parameter simultaneously

Hi All,
I have a select option and a parameter on the selection screen. The parameter is disabled for input and enabled for output. The F4 for the the select option has a numeric value and a corresponding text (comes from a standard function module). When I select a value from F4, the numeric value should go to the select-option and the text should go to the input disabled parameter.
At the moment, I am having to press an enter after choosing F4, for the text to reflect in the parameter field. I need both of them displayed at the same time, without having to press an enter.
Please guide me about how I could achieve this.
Thanks and Regards,
Vidya.

use this code in your F4 Help of Select Option after F4 Help Function Module .
DATA SCR_FIELDS  LIKE DYNPREAD   OCCURS 0 WITH HEADER LINE.
SCR_FIELDS-FIELDNAME =  ur parameter Name.
SCR_FIELDS-FIELDVALUE =  ur parameter value(ur Text Field)
APPEND SCR_FIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      DYNAME               = PROG_name
      DYNUMB               = SY-DYNNR
    TABLES
      DYNPFIELDS           = SCR_FIELDS
    EXCEPTIONS
      INVALID_ABAPWORKAREA = 1
      INVALID_DYNPROFIELD  = 2
      INVALID_DYNPRONAME   = 3
      INVALID_DYNPRONUMMER = 4
      INVALID_REQUEST      = 5
      NO_FIELDDESCRIPTION  = 6
      UNDEFIND_ERROR       = 7
      OTHERS               = 8.
So you need not have to press Enter
Regards,
Alpesh
Edited by: Alpesh on Mar 14, 2009 11:44 AM

Similar Messages

  • How to use offset for select-option parameter ?

    Hi experts
    could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
    following is my code
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    here "prctr"  length is 10.
    i'm using two tables  1. vbsegd-bupla
                                    2. vbsegs-prctr
    here prctr+6(4) = bupla.
    "Bupla" length is 4
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                 WHERE belnr = it_vbkpf-belnr
                                                                   AND gjahr = it_vbkpf-gjahr
                                                                   AND bukrs = it_vbkpf-bukrs
                                                                   AND bupla IN s_prctr.  
    the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
    SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
                                                                WHERE belnr = it_vbkpf-belnr
                                                                  AND gjahr = it_vbkpf-gjahr
                                                                  AND bukrs = it_vbkpf-bukrs
                                                                  AND prctr IN s_prctr.
    this is working as prctr and s_prctr lengths are equal.
    could anybody please help me out in this.
    Thanks in advance.
    regards
    satish

    Below code will work for you.
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    RANGES: s_bupla FOR vbsegd-bupla.
    s_bupla[] = s_prctr[].
    DELETE ADJACENT DUPLICATES FROM s_bupla.
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                  WHERE belnr = it_vbkpf-belnr
                                                                    AND gjahr = it_vbkpf-gjahr
                                                                    AND bukrs = it_vbkpf-bukrs
                                                                    AND bupla IN s_bupla.

  • Passing select option parameter to a procedure

    Hello, i need to know pass a select option parameter to a procedure. I tried the following
    For eg if i have a select option called so_belnr & i call the procedure using the following
    PERFORM VALIDATE_DOCUMENT TABLES SO_BELNR USING GJAHR BUKRS  , i still cannot use the
    select option paramter in the called procedure.
    Pls help.

    Hi,
    in topinclude...
    data: lr_belnr type RNG_BELNR.
    at start-of-sel.....
    move so to range..
    refresh: lr_belnr.
    lr_belnr[] = so_belnr[].
    PERFORM VALIDATE_DOCUMENT TABLES lr_belnr USING GJAHR BUKRS .
    in form:
    ...   tables lr_belnr like structure of RNG_BELNR.
    reason(my definietion): perfom doesn´t know if the select-options is availible.....
    bestreg
    Robert

  • Select-option parameter passed to function module

    hi,
    I have passed the select-option parameter as a table to my function module,
    suppose i have passed it as date(it contains field date-high and date-low)
    In my function module while i am looping the table and selecting the data according to date_low,it is going to select only the data according to date_low.
    since the table contains only one row.
    loop at date.
    select the data according to date_low.
    date_low = date_low +1.
    modify date_low.
    endloop.
    how can i select all the data from date_low and date_high?

    Hi,
    there is issue  design of ur FM .
    You have to put 2 table parametrs or 2 import paremeters in the FM ,after that with in the Function module fill the internal table of type ranges (say itab).
    After filling the ranges internal table, this can be used in ur select stament just as select option ( select ...where podat in itab)
    revrt back if any issues.
    regards,
    Naveen

  • Populating select-options in a variant through selection variable

    I have a select-options on the selection screen of a report. I have created a variant for this report. Now i want to populate this variant field through selection variable (entries of table TVARVC). How can i manage to populate multiple values in this. Suppose i want the variant to hold a range of values, how do i set the variable in the table so that the multiple values can be set dynamically?

    Hi Ravi,
    I know how to populate select-options but i want to know how to set up the selection variable in table TVARVC for using it in populating a select-option in a report variant. we populate these selection variables using the transaction STVARV where we specify a value against a particular variable. How can this variable multiple values (for example a range) so that a select-option can be populated dynamically through this?
    regards,
    Priyank

  • HOW  TO PASS SELECT-OPTIONS PARAMETER TO A FUNCTION MODULE.

    Hi friends.
    HOW DO U PASS A SELECT-OPTIONS PARAMTER TO A FUNCTION MODULE AS ITS IMPORT PARAMETER(IN MY CASE rfc fM) .
    Really urgent!!!
    thanks to one and all

    Hi,
    If you are passing a single value, its better you take it from s_option-low or s_option-high (select options).
    Else if you are passing values to the FM in a loop for all select option values, then better you declare an internal table with type <b>WSELKUNNR</b>.
    get low & high fields from each row & pass them.
    It will make you clear when you check out your select options in debug mode by entering different combinations of inputs.

  • How to pass value to select-option parameter using SET PARAMETER Command

    Hi,
        Am passing values to selection-screen fields in report RV13A004 ( used in VK11, VK12 and VK13). using below statement but material number is select-option in this report. am able to pass  MATERIAL FROM using SET PARAMETER ID, can i know how to pass values MATERIAL TO range in select-options fields using SET PARAMETER Command ??
    Passing values to parameter id
    set parameter id 'VKS' field kschl.
    set parameter id 'VKO' field vkorg.
    set parameter id 'VTW' field vtweg.
    set parameter id 'KDA' field erdat.
    set parameter id 'MAT' field matnr_from.
    Change condition price.
    call transaction 'VK12' and skip first screen.
    Thanks in advance.
    Regards,
    Balamurugan.

    Hi,
    instead of using set parameters and dden call transaction use this..........
    submit RV13A004  WITH SELECTION-TABLE rspar
    Effect
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    Notes
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
    When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.
    Cheers
    Will.

  • Select option/Parameter

    Hi Folks,
    I have declared two variables vendor and PO Doc Type along with the other fields in the selection screen  and was not able to understand the way it behaves.
    vendor and potype are declared as select-option no intervals.
    In that way the select statement is selecting the data even if we leave the fields blank in the selection screen.
    But,
    When I declare the vendor as select option no intervals and potype as parameter
    and leave the fields as blank it is not selecting the data.If I gve some value to POtype then it is working fine.
    So,does it mean that if we declare a variable as parameter,is it a must to given some value in the selection screen?
    Kindly let me know.
    K.Kiran.

    Hi Kiran,
    If you declare the selection screen variable as parameter and using this in the WHERE clause of query then it should have some value.
    This is not the case with select option.
    Why is it like this.
    PARAMETER in WHERE clause - The select statement treat it as a single field so you need to fill it.
    SELECT-OPTION - It is treated as the no. of fields, so nothing is filled in this ...that means select ALL
    Hope it is clear.
    Regards,
    Atish

  • Select-option/Parameter & Primary Key

    Dear Abaper,
        It this compulsory to have a Table fields define in Parameter/Select-option of Selection screen should be  Primary key of respective tables??
    and
      If we used two different tables having common fields and if common field of Table1  is primary key and Table2  is not a primary key can we used that common field in Parameter/Select-option of selection screen?
    Thanks & regards
    Mahendra

    Hi,
    Its not necessary to have fields in parameters/select options to be primary key. It just takes the datatype irrespective of the primary key.
    I have written a small example for you:
    PARAMETERS: a(18) type c,
                b type matnr, "data element
                c type mara-matnr. "table-fieldname
    These all are one and the same thing. a/b/c will have char 18 data type and length.
    Regards
    Purnand

  • Submit statement and populating select options.

    Hi to all experts.
    My requirement to call the program RSWUWFML2 in my zreport with selection option (task) from zreport should be populated into the standard program selection screen.I know this can be done using submit report how to populate the select options .

    Hi,
    The screen elements of the called program must be declaredd as  ranges in the calling program as shown..
    RANGES: seltab1 FOR spfli-carrid,
            seltab2 FOR spfli-connid.
              seltab1-sign = 'I'.
              seltab1-option = 'EQ'.
              seltab1-low = 'AA'.
              APPEND seltab1.
              seltab2-sign = 'I'.
              seltab2-option = 'EQ'.
              seltab2-low = '0017'.
              APPEND seltab2.
    SUBMIT <called prog> VIA SELECTION-SCREEN
                                WITH s_carrid IN seltab1
                                WITH s_connid IN seltab2
                                AND RETURN.
    to call  report RSWUWFML2.....
    in zreport declare ranges as:
    RANGES: seltab1 for swwwihead-wi_rh_task.
              seltab1-sign = 'I'.
              seltab1-option = 'EQ'.
              seltab1-low = '<value>'.
              APPEND seltab1.
              seltab2-sign = 'I'.
              seltab2-option = 'EQ'.
              seltab2-high = '<value>'.
              APPEND seltab1.
    SUBMIT RSWUWFML2 VIA SELECTION-SCREEN
                                WITH p_tasks  IN seltab1
                               AND RETURN.
    Hope it helps.....
    Regards,
    Mdi.Deeba
    Edited by: Mdi.Deeba on Aug 3, 2009 10:59 AM

  • How to use a select option parameter?

    hi
    i have created a selection screen in this way
    select-option car_no for equi-equnr.
    now i want to move all the values that i have selected in car_no range into an itab?
    i used the debugger and so that i have low and high i can i move all the values into an itab
    thanks.

    Hi,
    If you want to move the values of your select-options into an internal table, LOOP the select options and move the values into your internal table.
    sample code:-
    select-options car_no for equi-equnr.
    loop at car_no.
    wa_itab-equnr = car_no-low.
    append wa_itab to itab.
    endloop.
    But here you have to take care of few things.
    Firstly the values which are excluded. There are 4 fields in selection options - Option, sign, Low and High. When sign is 'I' you can move it into your internal table. When it is 'E' you should not select that particular entry.
    Secondly, do you have any high values. If there are high values available then you have to take all the values beteween low and high an move them into your internal table. One thing can be done in this case - while declaring the select option you can add "NO INTERVALS " so there would be only low value available unless user goes into EXTENSION option and selects ranges option.
    If you wante to move them into ranges internal table, then you can declare ranges and move it into that table.
    smaple code:-
    DATA: r_equnr TYPE RANGE OF equi-equnr,  
              wa_r_equnr LIKE LINE OF r_equnr.
    r_equnr[] = car_no[]
    Can you give more clarification about your requirement, so that a better solution can be provided.
    Edited by: Krishna Adabala on Nov 27, 2008 9:50 AM

  • Populating select-options through code

    Hi Experts,
       I have a requirement like in my selection screen I will have a select-options which will be input disabled. But in the initialization event I want to populate some values through coding. How can I populate multiple values. I should not use variant. I have to code only.
    Expecting your help,
    Venkatraman.

    Hi,
    As problem has Solved but following my Sample Code can help People who will Search, in fact i am posting this one because it is different from all the previous replies i am using Macro to populate Select-Options or you can do the Same for Ranges.
    DEFINE fill_select_options.
      clear: &1.  &1-sign = &2.    &1-option = &3.   &1-low = &4. &1-high = &5.  append &1.
    END-OF-DEFINITION.
    SELECT-OPTIONS: sodate FOR sy-datum.
    INITIALIZATION.
      fill_select_options sodate 'I' 'BT' '20080101' '20080131'.
      fill_select_options sodate 'E' 'BT' '20080110' '20080115'.
      fill_select_options sodate 'I' 'EQ' '20080201' '20080201'.
      fill_select_options sodate 'I' 'EQ' '20080205' '20080205'.
    Regards,
    Faisal

  • Populating select-options dynamically

    Hey Everybody,
    I've done some reports with Select-options, but all the fields directly related to some field in a transparent table. As many of you might have experienced, things changed with the latest report that I have to develop.
    I have to derive the drop-down for the select-options dynamically.
    Could anybody provide me with the details, code snippets, hints on how to do this.
    Thank You.
    Sumit.

    Here is an example program where you are generically defining the select-option and building its F4 help at runtime.
    report zrich_0001 .
    data: begin of ihelp occurs 0,
          field type char10,
          ftext type char50,
          end of ihelp.
    data: a_field(20) type c.
    select-options s_field for a_field.
    initialization.
      ihelp-field = 'A'.
      ihelp-ftext = 'Description A'.
      append ihelp.
      ihelp-field = 'B'.
      ihelp-ftext = 'Description B'.
      append ihelp.
      ihelp-field = 'C'.
      ihelp-ftext = 'Description C'.
      append ihelp.
    at selection-screen on value-request for s_field-low.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
           exporting
                retfield    = 'FIELD'
                dynprofield = 'S_FIELD'
                dynpprog    = sy-cprog
                dynpnr      = sy-dynnr
                value_org   = 'S'
           tables
                value_tab   = ihelp.
    start-of-selection.
    REgards,
    Rich Heilman

  • Populating select-options in the main view

    hi
    i have two views. main screen and view1.
    in main i have created a selection screen with 6 fields. view1 also has selection screen and same fields in it. when i go to view1 and click on ok button, i need to comeback to main view and populate the selection field with the values entered in view1. i am successful to some extent. i am able to access the values entered in view1 selection fields in "modify" method of the main view, but do not know how to fill the selection fields of main view with this values.
    thanks

    Hi,
    I just want to be sure that have you created the node in the context of the component controller and mapped the same in both of the views for building the selection screen?
    If yes then you wont be having any problem in accessing the values from any views, changes in any view will reflect in the other .
    If no then just modify the design as per the above description.
    TO read the vlalue...just read the context of the node in the view using the code wizrd, and set the value to the attributes using set_attributes method.
    Hope this might help you out.
    Pooja

  • Select options to Function Module parameter

    Hello,
    I have a select options parameter in my report and then I have a function module that have to select into a database table using this SO.
    How can I pass the SO to the FM?
    The code must be something like that:
    REPORT ZXXXX.
    SELECT-OPTIONS:  so_werks FOR marc-werks.
    CALL FUNCTION 'ZFUNCTION'
    FUNCTION ZFUNCTION
    SELECT matnr FROM marc INTO TABLE it
    WHERE werks IN so_werks
    The select options must be a TABLES parameter? I have to create a structure type for that SO?

    Hi,
    In FM interface you can use
    structure EFG_RANGES ( In Tables Parameter ) . This structure is same as select options.
    Or in Importing parameters use EFG_TAB_RANGES . This is an internal table type .
    In both ways you can pass your select option to FM diretcly.
    Check the following link as well
    https://forums.sdn.sap.com/click.jspa?searchID=11071891&messageID=4908310
    Regards,
    Raj.

Maybe you are looking for