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

Similar Messages

  • 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

  • Can I put a text view next to a select-options dynamically aligned?

    Hello,
    I need a text view next to a select-options aligned.
    I think the only way to do it is dynamically and in the same container.
    I tried putting textviews beside the container and aligns them, but I couldn't.
    Thanks,
    Rodrigo.

    Hi,
    Can you please let me know what type of layout manager you are using?
    You may use Matrix layout to align the elements without using dummy textview.
    -Ashutosh

  • 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

  • Creating select-options dynamically

    Hello Gurus,
    I have following program with me.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = itab_display
    IMPORTING
    ep_table = d_ref.
    ASSIGN d_ref->* TO <F_FS>.
    SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <F_FS>.
    I want to select from table dynamically. i.e.
    I want my select query as :
    *SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <F_FS> where field1 = ' x' and field2 = 'y' etc ....*
    " field1 , field2 " ....i should be able to give using select-options.
    Please tell me is it possible ?
    Thanks.

    Hi,
    Check the Following code
    DATA  tabname(10).
    DATA: BEGIN OF wa,
            id   TYPE scustom-id,
            name TYPE scustom-name,
          END OF wa.
    tabname = 'SCUSTOM'.
    SELECT id name INTO CORRESPONDING FIELDS OF wa FROM (tabname).
      WRITE: / wa-id, wa-name.
    ENDSELECT.
    Cheers,
    Kothand

  • 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

  • Disable the select-options dynamically based on value selected in listbox

    Hi friends,
    I have a peculiar problem in my program.
    I have a list box with two values.
    1) With Ref to Reservation No.
    2) Production order.
    I am doing the object for Transfer Posting ( Similar to MIGO).
    The contents of the listbox here are acting as the label to my select-options.
    I have two select-options in my program.
    1) Reservation No (s_rsnum for rsnum)
    2) Production Order (s_porder for aufnr)
    In runtime, based on the label selected in the listbox, the corresponding select-option should be in visible mode.
    for eg: if i select "With ref to Reservation No" S_rsnum should be enabled and vice-versa.

    Hi,
    here an example with listbox:
    TABLES: MARA.
    PARAMETERS: P0 DEFAULT 'KAUF' LIKE MARA-MTART AS LISTBOX VISIBLE LENGTH 8 USER-COMMAND DUMMY.
    SELECTION-SCREEN: SKIP 3.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR MODIF ID DI1.
    SELECTION-SCREEN: SKIP 3.
    SELECT-OPTIONS: S_MATKL FOR MARA-MATKL MODIF ID DI2.
    AT SELECTION-SCREEN OUTPUT.
      IF P0 = 'KAUF'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 EQ 'DI1'.
            SCREEN-ACTIVE      = '1'.
            SCREEN-INPUT       = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 EQ 'DI2'.
            SCREEN-ACTIVE      = '0'.
            SCREEN-INPUT       = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF P0 <> 'KAUF'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 EQ 'DI1'.
            SCREEN-ACTIVE      = '0'.
            SCREEN-INPUT       = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 EQ 'DI2'.
            SCREEN-ACTIVE      = '1'.
            SCREEN-INPUT       = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    use your own listbox in If-Clauses.
    Regards, Dieter

  • 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

  • Filling select-option dynamically

    Hi,
    I have two radio buttons.
    I want to fill the select-options (account group ktokk) when i click a radio button.
    I tried to fill them at INITIALIZATION event. But it is not working.
    Is it possible to do so.
    Please answer my question.
    Thanks
    Rekha

    Hi rekha,
    try like this.
    TABLES:vbak.
    PARAMETERS:p_1   RADIOBUTTON GROUP g1 USER-COMMAND cmd1,
    p_2   RADIOBUTTON GROUP g1.
    SELECT-OPTIONS:s_vbeln for vbak-vbeln.
    *SELECTION-SCREEN :PUSHBUTTON /2(10) but1 USER-COMMAND fcode .
    *INITIALIZATION.
    but1 = 'GET List'.
    AT SELECTION-SCREEN.
      IF p_1 = 'X'.
        s_vbeln-low = '1000'.
        s_vbeln-option = 'EQ'.
        s_vbeln-sign = 'I'.
        APPEND s_vbeln.
      ELSE.
        REFRESH s_vbeln.
      ENDIF.

  • 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

  • How to create select-options for 3 fields out of 5 by FREE_SELECTIONS_INIT

    Hi Experts,
    I am using the Function Modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG to create the select-options dynamically on the selection screen.
    My problem is that I am passing a field list of 10 fields in the FIELDS_TAB of the function.
    Now it creates the select-options for all 10 fields. I want to create select-options for only 5 fields initially and let the user select out of the remaining 5 fields to create the select-options.
    How to achieve this.?
    I tried by passing the 5 fields in FIELDS_NOT_SELECTED table but they get hidden and once hidden I am not able to get them back in my field list.
    Please help me out.
    Useful answers will be suitably rewarded.
    Thanks in advance.
    Regards,
    Himanshu

    Hi Experts,
    I am using the Function Modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG to create the select-options dynamically on the selection screen.
    My problem is that I am passing a field list of 10 fields in the FIELDS_TAB of the function.
    Now it creates the select-options for all 10 fields. I want to create select-options for only 5 fields initially and let the user select out of the remaining 5 fields to create the select-options.
    How to achieve this.?
    I tried by passing the 5 fields in FIELDS_NOT_SELECTED table but they get hidden and once hidden I am not able to get them back in my field list.
    Please help me out.
    Useful answers will be suitably rewarded.
    Thanks in advance.
    Regards,
    Himanshu

  • Select options using OVS empty

    Hi all,
    I have created a select options dynamically using OVS.
    If the output table is empty my OVS appears empty and i don't want that this appears.
    The search help must appear only when the output table is not empty.
    How do i solve this?
    Thanks

    Hi.
    My problem has not been repair.
    There is no way to disable an OVS at runtime.
    See:
    cancelling an OVS help?
    Thanks a lot.

  • Dynamically generating Ok_Code for select option of HUMO t-code

    Hi Gurus ,
    I have used BDC call transaction method in my program to call the HUMO t-code and populating the handling unit in the select option . The ok_code of the select option is written in the program as :
    PERFORM bdc_field USING 'BDC_OKCODE'
                            '=%00120100000003011'.
    Now these ok_code value is changing inside the ECC landscape , In all Non-production system the value remains same but in the production system the ok_code value is different , because of this program is successfully executing in non-production but not in production .
    If anyone of you have come across situation like this , please help me how to help hold of this ok_code or can we generate in dynamically . For temporary solution i have coded it based on the system like shown below but I am looking for a permanent solution
    IF syst-sysid = 'EWP'.
        PERFORM bdc_field USING 'BDC_OKCODE'
                            '=%00120100000003011'.
      ELSE.
        PERFORM bdc_field USING 'BDC_OKCODE'    
                          '=%00120100000718796'.               
      ENDIF.
    Regards
    Anshuman

    Hi Gurus ,
    I have used BDC call transaction method in my program to call the HUMO t-code and populating the handling unit in the select option . The ok_code of the select option is written in the program as :
    PERFORM bdc_field USING 'BDC_OKCODE'
                            '=%00120100000003011'.
    Now these ok_code value is changing inside the ECC landscape , In all Non-production system the value remains same but in the production system the ok_code value is different , because of this program is successfully executing in non-production but not in production .
    If anyone of you have come across situation like this , please help me how to help hold of this ok_code or can we generate in dynamically . For temporary solution i have coded it based on the system like shown below but I am looking for a permanent solution
    IF syst-sysid = 'EWP'.
        PERFORM bdc_field USING 'BDC_OKCODE'
                            '=%00120100000003011'.
      ELSE.
        PERFORM bdc_field USING 'BDC_OKCODE'    
                          '=%00120100000718796'.               
      ENDIF.
    Regards
    Anshuman

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • Need to disable one of the select-options in dynamic selection screen

    Hi,
    we have copied the Standard program: RFDOPR00 into Z, my requirement is to disable one of the select-options in dynamic selection screen for ex: Reason code(User shouldnot able to enter anything in it).
    Can anyone please tell me the procedure to do it... I had tried using at selection-screen but it doesnt work as it in 'LOOP AT SCREEN', i am not able to capture the Parameter name(screen-name).
    Thanks,
    Ravi

    Hi,
    Get inside your selection screen, by executing your program.
    Now type /h in the field where you enter transaction code and press enter.
    Now again press enter, this will take you debugger starting from your Selection screen.
    You might be knowing this, still if you are not aware of this, this might be a valuable tip.
    From here , you can trace your Parameter name.

Maybe you are looking for

  • Upgraded to pro X and having issues with form created in pro 9

    I created a form in LiveCyle using Pro 9, the form was created for an employer who had to buy Pro X so I was upgraded to Pro X.  Here are the issues I am having, This form was the first time I have ever created a form and I have never used Java Scrip

  • Edit in Photoshop command unavailble in Lightroom 3.4

    I upgraded my Lightroom 2 to Lightroom 3 on a Windows 7 computer with Photoshop CS4 installed. When I first used Lightroom 3.1 the Edit In... command showed that the Edit in Photoshop and all the other Photoshop related commands were available and co

  • Will the ssd in the macbook pro retinas ever be upgradible , ive seen that they can be removed .

    will the MBP-R SSD's ever be upgradible in the future ,as we know they can be removed , so will we see replacement drives become available ? check out the SSD (ifixit tear down ) http://www.ifixit.com/Guide/Image/meta/LpjTmUO4MTnygPTv

  • Mass Changes to Rate Routing

    Dear All, We were trying to carry out mass changes to Rate Routing, by using CA85N we were able to make changes to Normal routing but not rate routing, in CA85N we were able to select only three types of task lists ie N, S & Q. Also checked in CWEB h

  • Drop datafile

    Hi mates, I dropped a newly created datafile in a tablespace that has two datafiles. The syntax used is : startup mount; alter database datafile 'c\oradata\ooo.df01' offline drop; DATABASE ALTERED. Now the datafile still shows as available in the DBA