Select options default value

Hi,
Kindly assist me on how to set a default value for dynamically created Select options.
I am coding the below code snippet for default value and it's working but when I remove the default value for the select option on portal screen ...I encounter a dump stating line type does not match with internal table.
wd_this->m_wd_select_options = wd_this->wd_cpifc_wdr_select_options_e( ).
init the select screen
  wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
    lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'STRING' ).
    assign lt_range_table->* to <range_table>.
    insert initial line into table <range_table> assigning <range_table_line>.
    assign component 'SIGN'   of structure <range_table_line> to <sign>.
   assign component 'OPTION' of structure <range_table_line> to <option>.
    assign component 'LOW'    of structure <range_table_line> to <low>.
    assign component 'HIGH'   of structure <range_table_line> to <high>.
    <sign>   = 'I'.
    <option> = 'EQ'.
    <low>    = 'ZA'.
    clear <high>.
    wd_this->m_handler->set_range_table_of_sel_field(
      i_id          = 'DY_PARVW'
     it_range_table     = lt_range_table ).
Points will be rewarded!!!!

Hi.
I use the following code (snippet) to add default values:
lt_range = lr_selop->create_range_table(
                                    i_typename = 'VKORG' ).
  lr_selop->add_selection_field(
                     i_id = 'VKORG'
                     i_within_block = lv_id_gdata
                     i_no_intervals = abap_true
                     i_no_extension = abap_true
                     i_obligatory = abap_true
                     i_read_only = abap_true
                     it_result = lt_range
                     i_value_help_type = if_wd_value_help_handler=>co_prefix_none ).
DATA:
        lr_user        TYPE REF TO zcl_user,
        lr_param       TYPE REF TO data,
        lr_headerline  TYPE REF TO data.
  DATA:
        ls_tmprange    TYPE rsparams.
  FIELD-SYMBOLS:
                 <fs_param>      TYPE ANY,
                 <fs_range>      TYPE ANY,
                 <fs_rangetable> TYPE table.
  lr_user = zcl_user=>get_instance( ).
  lr_param  = lr_user->get_usermaster_param(
     param_name = param_name
  ASSIGN lr_param->* TO <fs_param>.
  MOVE <fs_param> TO ls_tmprange-low.
  IF ls_tmprange-low IS NOT INITIAL.
    ls_tmprange-sign = zcl_salsa_assistance=>userparam_sign_default.
    ls_tmprange-option = zcl_salsa_assistance=>userparam_option_default.
    ASSIGN lr_range->* TO <fs_rangetable>.
    CREATE DATA lr_headerline LIKE LINE OF  <fs_rangetable>.
    ASSIGN lr_headerline->* TO <fs_range>.
    MOVE-CORRESPONDING  ls_tmprange TO <fs_range>.
    APPEND <fs_range> TO <fs_rangetable>.
  ENDIF.
lr_user->get_usermaster_param( param_name = param_name ) just returns a data reference to a parameter value.
After assigning this value to the range table i do not have to call set_range_table_of_sel_field cause lr_range is already a reference to the range table.
This works well and I can remove the default value without getting dumps.
Cheers,
Sascha

Similar Messages

  • Select options default value and execute

    Hello,
    I managed to fill my select options default value. But what I also want is that the user does not have to press the execute button when the screen is shown at the first time. I would like to show the result screen for these default values at the same time the screen is shown first.
    I tried in WDDOINIT:
      data: l_ref_interfacecontroller type ref to iwci_wdr_select_options .
      l_ref_interfacecontroller =   wd_this->wd_cpifc_select_options( ).
      l_ref_interfacecontroller->execute(
    but this coding only works when the select-option screen was shown the first time.
    Any ideas?
    regards
    stefan

    Hello Sascha,
    I checked that WD_THIS->MR_SELOPT is filled.
    My coding in WDDOINIT is:
    *--- Instantiate select options component
      lr_usage = wd_this->wd_cpuse_usage_so( ).
      if lr_usage->has_active_component( ) is initial.
        lr_usage->create_component( ).
      endif.
    *--- Initialize selection screen
      lr_if_controller = wd_this->wd_cpifc_usage_so( ).
      wd_this->mr_selopt = lr_if_controller->init_selection_screen( ).
    *--- Configure layout options
      wd_this->mr_selopt->set_global_options(
                                 i_display_btn_cancel  = abap_false
                                 i_display_btn_check   = abap_false
                                 i_display_btn_reset   = abap_true
                                 i_display_btn_execute = abap_true ).
    *--- Create range tables
      lt_range = wd_this->mr_selopt->create_range_table(
                                                       i_typename = 'DATUM' ).
    *Range vorbelegen
      wa_dats = sy-datum - 30.
      wa_range_datum-sign = 'I'.
      wa_range_datum-option = 'BT'.
      wa_range_datum-low = wa_dats.
      wa_range_datum-high = sy-datum.
      assign lt_range->* to <fs_rangetable>.
      create data r_headerline like line of  <fs_rangetable>.
      assign r_headerline->* to <fs_range>.
      move-corresponding  wa_range_datum to <fs_range>.
      append <fs_range> to <fs_rangetable>.
      wd_this->mr_selopt->add_selection_field( i_id        = 'DATUM'
                                               it_result   = lt_range ).
      lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UZEIT' ).
      wd_this->mr_selopt->add_selection_field( i_id        = 'UZEIT'
                                               it_result   = lt_range ).
      lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UNAME' ).
      wd_this->mr_selopt->add_selection_field( i_id        = 'UNAME'
                                               it_result   = lt_range
                                               i_no_intervals = 'X'
                                               i_no_extension = 'X' ).
    data: event type ref to cl_wd_custom_event.
    create object event
      exporting
        name   = 'EXECUTE'
       parameters =
      wd_this->search_sel_opt(
        wdevent =    event                       " Ref to cl_Wd_Custom_Event
    Maybe you can see my mistake?
    regards
    stefan

  • Help on the selection screen.....Select-options default values

    Dear Friends,
    We have one requirement,i.e. In Report program i am using select-option once will execute the program ALV report will be generated.In ALV Report we have one button like 'WM DATA'.Once click the WMDATA one pop-up is displaying...In that pop-up also same select-options are there upto here it's working fine...Now my problem is on pop-up select-options i have to display by default..... which i am using on report select-options values.
    Please help on the same
    Thank You.

    Do like this. Before calling your next screen assign the select option value or just assign the value in start of selection only.
    tables
    :lqua.
    SELECT-OPTIONS:
    s_lgnum FOR lqua-lgnum MODIF ID sc1 OBLIGATORY,
    s_lgtyp FOR lqua-lgtyp MODIF ID sc1.
    SELECTION-SCREEN BEGIN OF SCREEN 300 .
    SELECT-OPTIONS : s_lgnum1 FOR lqua-lgnum OBLIGATORY,
    s_lgtyp1 FOR lqua-lgtyp OBLIGATORY.
    SELECTION-SCREEN END OF SCREEN 300.
    START-OF-SELECTION.
    s_lgnum1[] = s_lgnum[].
    s_lgtyp1[] = s_lgtyp[].
    call SELECTION-SCREEN 300.

  • Select-option default value???

    DATA: gsber1         like csks-gsber.
    select distinct GSBER
      into (gsber1)
      from csks
    where kostl = sch_kostl.
    endselect.
      SELECT-OPTIONS : gsber    FOR csks-gsber DEFAULT gsber1.
    why not input value gsber1?

    Pung,
    Pls. see the docs. below.
    To assign default values to a selection criterion, you use the following syntax:
    SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] ....
    Default values <g> and <h> can be literals or field names. You can only use fields that contain a value when the program is started. These fields include several predefined data objects.
    For each SELECT-OPTIONS statement, you can specify only one DEFAULT addition. This means that you can fill only the first row of selection table <seltab> with default values. To fill more rows with default values, the selection table must be processed before the selection screen is called, for example, during the AT SELECTION-SCREEN -OUTPUT event.
    You use the DEFAULT addition as follows to address the individual components of the first row:
    To fill only the LOW field (single field comparison), use:
    ........DEFAULT <g>.
    To fill the LOW and HIGH fields (range selection), use:
    ........DEFAULT <g> TO <h>.
    To fill the OPTION field, use:
    ........DEFAULT <g> [to <h>] OPTION <op>.
    For single field comparisons, <op> can be EQ, NE, GE, GT, LE, LT, CP, or NP. The default value is EQ. For range selections, <op> can be BT or NB. The default value is BT.
    To fill the SIGN field, use:
    ........DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>.
    The value of <s> can be I or E. The default value is I.
    The input fields of the selection criterion are filled with the default values. The user can accept or change these values.
    REPORT DEMO.
    DATA WA_SPFLI TYPE SPFLI.
    SELECT-OPTIONS AIRLINE FOR WA_SPFLI-CARRID
                   DEFAULT 'AA'
                        TO 'LH'
                    OPTION  NB
                      SIGN  I.
    Don't forget ot reward if useful...

  • WD4A select options, default value

    Hello,
    while using the select option screen i tried to fill a default value in one of my fields. I used:
    *add a new field to the selection
      wd_this->m_handler->add_selection_field(
      i_id = 'Z_TEST'
      it_result = lt_range_table
      i_memory_id = 'SXV'
      i_no_intervals = abap_true
      i_no_extension =  abap_true ).
    I checked that the parameter ID SXV is filled but there is no default value in the dynpro.
    Any ideas?
    best regards
    stefan

    Hi Stefan.
    Is it necessary to use memory id's for you?
    It is quiet easy to work with field-symbols and
    add a value to the range table:
      data:
            ls_tmprange    type rsparams.
      field-symbols:
                     <fs_param>      type any,
                     <fs_range>      type any,
                     <fs_rangetable> type table.
      ls_tmprange-low = some value.
      ls_tmprange-sign = some value.
      ls_tmprange-option = some value.
      assign lt_range_table->* to <fs_rangetable>.
      create DATA lr_headerline like LINE OF  <fs_rangetable>.
      ASSIGN lr_headerline->* to <fs_range>.
      move-CORRESPONDING  ls_tmprange to <fs_range>.
      append <fs_range> to <fs_rangetable>.
    After that you can call add_selection_field with lt_range_table.
    Hope this helps.
    Cheers,
    Sascha

  • Populate SELECT-OPTIONS default value using CALL FUNCTION

    Hi Experts,
    I would like to populate SELECT-OPTIONS s_currm default with value in w_currm, however, it doesn't seem to work.  Can you please advise what the correct syntax is.
    Note that CALL FUNCTION 'GET_CURRENT_YEAR' is working correctly and populating w_currm (as I can use it in a SQL SELECT statement), however, it does not seem to work for SELECT-OPTIONS s_currm.
    Thank you for your time.
    Code snippet is as a follows:
    REPORT  Z_DOWNLOAD_BSIS_TEST.
    *Data Declaration
    DATA: w_currm TYPE BSIS-MONAT.
    *Define current fiscal month
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm.   " Current Fiscal Month
    SELECT-OPTIONS s_currm FOR w_currm
                   DEFAULT w_currm. " The default value is NOT being populated (appears blank)

    Hi Venkat.O,
    Thank you for your clear response.  I have implemented your suggestion and it works, however, I now have a new problem. 
    Each time the report is executed or the "multiple selection" button is clicked the selection fields are populated once again with the default (low) values.
    For example, when report is first opened the s_curry field displays '2010'.  Clicking "multiple selection" results in another '2010' being populated.  After executing the report the selection screen is populated again with '2010' (so we now have '2010' listed 3 times in the s_curry field).
    How do I prevent the default values from repeating?
    REPORT  Z_DOWNLOAD_BSIS_TEST
    *Data Declaration
    DATA:  w_currm TYPE BSIS-MONAT,
           w_curry TYPE BSIS-GJAHR,
           w_prevm TYPE BSIS-MONAT,
           w_prevy TYPE BSIS-GJAHR.
    SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-001 .
    *Parameters to enter the path
    PARAMETERS: FILENAME(128) OBLIGATORY DEFAULT '/usr/sap/tmp/TEST.txt'
                             LOWER CASE.
    SELECT-OPTIONS: s_curry FOR w_curry,
                    s_currm FOR w_currm.
    SELECTION-SCREEN END OF BLOCK b11.
    AT SELECTION-SCREEN OUTPUT.
    *Define current/previous financial periods
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm    " Current Fiscal Month
        CURRY         = w_curry    " Current Fiscal Year
        PREVM         = w_prevm    " Previous Fiscal Month
        PREVY         = w_prevy.   " Previous Fiscal Year
        s_curry-low = w_curry.
        s_curry-option = 'EQ'.
        s_curry-sign = 'I'.
        APPEND s_curry.
        CLEAR  s_curry.
        s_currm-low = w_currm.
        s_currm-option = 'EQ'.
        s_currm-sign = 'I'.
        APPEND s_currm.
        CLEAR  s_currm.

  • Select-option default values

    Hi,
    I have date as select-option.
    I am required to
    default current date minus one day to current date .simply my select-option-low = sy-datum-1,
    select-option-high = sy-datum should be defaulted.
    How to do this...?
    thanks

    HI,
    Please refer the code below:
    tables: bsis.
    select-options : so_date for bsis-budat.
    at selection-screen output.
    so_date-low = sy-datum-1.
    so_date-high = sy-datum.
    append so_date.
    Thanks,
    Sriram Ponna.

  • Dynamic variant for select option High value

    Hi ,
    Please help me in creating dynamic variable for a select option date field high value.
    II tried the following method:
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (i.e. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    5. Save the variant.
    But it is saving the date value in Field LOW of select option( From value).
    I need it in TO field( High value).
    Please help.
    regards,
    Sheeba

    Hi Sheeba
        we can do it other way .. Select the same steps as you have done but after the assigning the value current date to low ..click on the selection option push button at the application bar and choose the 'less than or equal to' option to your select option value and try the same ....
    I guess this would throw you same results as that of the value in the high value button
    Cheers,
    Jacks.

  • Check select-options parametr value

    hi,
    i want to check if select-option parameter value is '002' then execute some code, how can i do that .
    thanks in advance,
    ramakrishna buddala.
    Moderator Message: Not enough search done. Thread locked.
    Edited by: Suhas Saha on Oct 20, 2011 3:15 PM

    Hi
    Perform the validation in AT Selection-screen on field event.If validation is not succes then give error message.
    AT selection-screen on <Fieldname>.
    if fieldname-low <> '002'.
       message '<Message Text>' type 'E'.
    endif.
    Regards.
    Raghu.

  • Infoset-query-selection-screen-default-values

    Hi All,
    I am having the requirement as I need to put default values in the selecion-screen of the report by using  Infoset query. Let me know the settings required for this.
    I am using SQ01, SQ02, SQ03 T.Codes.
    And I need display  one record only if any field contains mulitple records, for example in the HR-ABAP, field p0105-usrid contains multiple values depending on the subtype.So, I need to display USRID when URSTY = '900'. All these should display by Infoset query only.
    Pls help me in this scenario , its an urgent requirement.I am very much thankful for you for reading my proble, if you will provide some sort of solution, I feel very happy.
    Advance thanks for this .
    Regards,
    Prakash.

    Prakash,
    To default the values on your selection screen, you will need to do some ABAP I guess. (if you do not want to use variant). Open up the infioset in SQ02 and then goto code option for the PNP**** field and then you can code to initialize the selection screen variables. Test with an ABAPer.
    To display multiple records as multiple columns, you will have to create custom fields in infoset, and then go from there. Again see ABAPer.

  • Selection Screen Default Values

    Hi,
    The selection screen can have the default values by using the parameter ID. To be the parameter ID value to defaulted we normally add the entry in User Profile>Own data>paramters with Parameter ID and the value.
    I would like to know is there any other way to achieve the same, it could be parameter or select-options.
    With Regards,
    Azhar

    For Parameter u can use DEFAULT keyword
    eg. PARAMETERS: p_matnr TYPE mara-matnr DEFAULT 'B1200'.
    For select option
    As u might be knowing select options creates an intenal table, so if  u want to have some default values then u can use the following code in the INITIALIZATION event:
    DATA: v_matnr TYPE mara-matnr.
    INITIALIZATION.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    s_matnr-low = 'BT100'.
    s_matnr-high = 'BT900'.
    append s_matnr.
    This will give default values in the selection screen for select-options.

  • Select options: Restricting Value Display in Search Help Parameters

    Hello friends,
    I have following requirement.
    I have declared one select option. On that select options I'am having different search help paremeters on which I can restrict the search help values display.
    Can I specify the restriction in search help at the time of programming so that it would display only the values that follows the given restriction?
    I can ofcourse do this by AT SELECTION-SCREEN ON VALUE REQUEST, however I am trying to avoid this.
    How can I proceed?
    Points will be rewarded generously.
    Best Regards,
    Navin

    hI
    SEE THIS CODE
    **************DATA TYPES DECLARATION **********************
    TABLES: HRP1001, HRP1026, HRP1000,PCHDY.
    TYPE-POOLS SLIS.
    TYPES :BEGIN OF ST_OUTPUT,
            COUNT TYPE STRING,
            OBJID TYPE HRP1001-OBJID,
            STEXT TYPE HRP1000-STEXT,
            BEGDA TYPE HRP1000-BEGDA,
            ENDDA TYPE HRP1000-ENDDA,
            CANCRT TYPE T77CRT-CANCRT,
            AEDTM TYPE HRP1026-AEDTM,
            UNAME TYPE HRP1026-UNAME,
            LSTEXT TYPE HRP1000-STEXT,
           RINVT TYPE T777V-RINVT,
           END OF ST_OUTPUT.
    TYPES: BEGIN OF ST_HRP1000,
            OBJID TYPE HRP1001-OBJID,
            STEXT TYPE HRP1000-STEXT,
           END OF ST_HRP1000.
    TYPES : BEGIN OF ST_HRP1001,
             OTYPE TYPE HRP1001-OTYPE,
             OBJID TYPE HRP1001-OBJID,
             RELAT type hrp1001-RELAT,
             BEGDA TYPE HRP1001-BEGDA,
             ENDDA TYPE HRP1001-ENDDA,
             SCLAS TYPE HRP1001-SCLAS,
             SOBID TYPE HRP1001-SOBID,
            END OF ST_HRP1001.
    TYPES : BEGIN OF ST_HRP1026,
             OTYPE TYPE HRP1026-OTYPE,
             OBJID TYPE HRP1001-OBJID,
             AEDTM TYPE HRP1026-AEDTM,
             UNAME TYPE HRP1026-UNAME,
             DELET TYPE HRP1026-DELET,
             CANCR TYPE HRP1026-CANCR,
            END OF ST_HRP1026.
    TYPES : BEGIN OF ST_REASON,
             CANCR TYPE HRP1026-CANCR,
             CANCRT TYPE T77CRT-CANCRT,
            END OF ST_REASON.
    TYPES : BEGIN OF ST_SOBID,
             OTYPE TYPE HRP1001-OTYPE,
             OBJID TYPE HRP1001-OBJID,
             RELAT type hrp1001-OBJID,
             BEGDA TYPE HRP1001-BEGDA,
             ENDDA TYPE HRP1001-ENDDA,
             SCLAS TYPE HRP1001-SCLAS,
             SOBID TYPE HRP1001-OBJID,
            END OF ST_SOBID.
    TYPES : BEGIN OF ST_OBJID,
             OBJID TYPE HRP1001-OBJID,
            END OF ST_OBJID.
    TYPES : BEGIN OF ST_LOCATION,
             OTYPE TYPE HRP1001-OTYPE,
             OBJID TYPE HRP1001-OBJID,
             RSIGN TYPE HRP1001-RSIGN,
             RELAT TYPE HRP1001-RELAT,
             SCLAS TYPE HRP1001-SCLAS,
             SOBID TYPE HRP1001-SOBID,
            END OF ST_LOCATION.
    TYPES : BEGIN OF ST_LOCATION1,
             OTYPE TYPE HRP1001-OTYPE,
             OBJID TYPE HRP1001-OBJID,
             RSIGN TYPE HRP1001-RSIGN,
             RELAT TYPE HRP1001-RELAT,
             SCLAS TYPE HRP1001-SCLAS,
             SOBID TYPE HRP1001-OBJID,
            END OF ST_LOCATION1.
    TYPES : BEGIN OF ST_LSTEXT,
             OTYPE TYPE HRP1000-OTYPE,
             OBJID TYPE HRP1000-OBJID,
             LSTEXT TYPE HRP1000-STEXT,
            END OF ST_LSTEXT.
    TYPES : BEGIN OF ST_OBJID_SH,
             OTYPE TYPE HRP1000-OTYPE,
             OBJID TYPE HRP1000-OBJID,
            END OF ST_OBJID_SH.
    DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
    DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
    DATA : IT_LSTEXT TYPE STANDARD TABLE OF ST_LSTEXT.              "TOS STORE THE TEXT OF COURCE LOCATION
    DATA : WA_LSTEXT TYPE ST_LSTEXT.
    DATA : IT_LOCATION TYPE STANDARD TABLE OF ST_LOCATION.          " TO STORE THE LOCATION OF COURCE
    DATA : WA_LOCATION TYPE ST_LOCATION.
    DATA : IT_LOCATION1 TYPE STANDARD TABLE OF ST_LOCATION1.        " TO CONVERT SOBID INTO OBJID FOR COURCE LOCATION
    DATA : WA_LOCATION1 TYPE ST_LOCATION1.
    DATA : IT_SOBID TYPE STANDARD TABLE OF ST_SOBID.                " TO CHANGE THE SOBID OF HRP1001 TO OBJID OF HRP1026
    DATA : WA_SOBID TYPE ST_SOBID.                                   " BY USING FOR ALL ENTRIES
    DATA : IT_REASON TYPE STANDARD TABLE OF ST_REASON.              "TO STORE T HE REASON FOR CANCELL TEXT
    DATA : WA_REASON TYPE ST_REASON.
    DATA : IT_OUTPUT TYPE STANDARD TABLE OF ST_OUTPUT.               "OUTPUT FEILDS OF REPORT.
    DATA : WA_OUTPUT TYPE ST_OUTPUT.
    DATA : IT_OUTPUT_1 TYPE STANDARD TABLE OF ST_OUTPUT.               " TEMP OUTPUT FEILDS OF REPORT.
    DATA : WA_OUTPUT_1 TYPE ST_OUTPUT.
    DATA : IT_HRP1000 TYPE STANDARD TABLE OF ST_HRP1000.             "DATA FROM HRP1000 TABLE
    DATA : WA_HRP1000 TYPE ST_HRP1000.
    DATA : IT_HRP1001 TYPE STANDARD TABLE OF ST_HRP1001.             "DATA FROM HRP1001 TABLE
    DATA : WA_HRP1001 TYPE ST_HRP1001.
    DATA : IT_HRP1026 TYPE STANDARD TABLE OF ST_HRP1026.              "DATA FROM HRP1026 TABLE
    DATA : WA_HRP1026 TYPE ST_HRP1026.
    DATA : IT_OBJID TYPE STANDARD TABLE OF ST_OBJID.                  " TO STORE THE OBJID OF HRP1001
    DATA : WA_OBJID TYPE ST_OBJID.
    DATA: WS_FCAT    TYPE SLIS_FIELDCAT_ALV .                         " FEILDCATALOG FOR ALV REPORT
    DATA: IN_FCAT    TYPE SLIS_T_FIELDCAT_ALV.
    DATA: W_LAYOUT   TYPE SLIS_LAYOUT_ALV.
    DATA : LV_COUNT TYPE I.                                           "FEILD FOR SERIAL NUMBER
    ***************************END OF DATA DECLARATION******************************************
    ************SELECTION SCREEN DESIGN************************
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
    SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
    SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    ***********END OF SELECTION SCREEN DESIGN******************
    *****INITIALIZATION VENT TO ASIGN DEFAULT VALUES TO OTYPE
    *INITIALIZATION.
    S_OTYPE-LOW = 'D'.*
    S_OTYPE-SIGN = 'I'.*
    S_OTYPE-OPTION = 'EQ'.*
    APPEND S_OTYPE.*
    CLEAR S_OTYPE.*
    **************END OF EVENT INITIALIZATION******************
    **********VALIDATION FOR SCREEN FIELDS*********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
    IF S_OBJID IS NOT INITIAL.*
        SELECT OTYPE OBJID FROM HRP1000
                     INTO TABLE IT_OBJID_SH
                     WHERE OTYPE = 'D'.
    IF SY-SUBRC EQ 0.
    SEARCH HELP FOR QUALIFICATION.*
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
                 DDIC_STRUCTURE         = ' '*
            RETFIELD               =  'OBJID'
                 PVALKEY                = ' '*
           DYNPPROG               = SY-REPID
           DYNPNR                 = SY-DYNNR
           DYNPROFIELD            = 'S_OBJID'
                 STEPL                  = 0*
                 WINDOW_TITLE           =*
                 VALUE                  = ' '*
           VALUE_ORG              = 'S'
                 MULTIPLE_CHOICE        = ' '*
                 DISPLAY                = ' '*
                 CALLBACK_PROGRAM       = ' '*
                 CALLBACK_FORM          = ' '*
                 MARK_TAB               =*
               IMPORTING*
                 USER_RESET             =*
          TABLES
            VALUE_TAB              =  IT_OBJID_SH
                 FIELD_TAB              =*
                 RETURN_TAB             = RETURN_TAB*
                 DYNPFLD_MAPPING        =*
               EXCEPTIONS*
                 PARAMETER_ERROR        = 1*
                 NO_VALUES_FOUND        = 2*
                 OTHERS                 = 3*
        IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.*
        ENDIF.
      ENDIF.

  • Select MULTIPLE default values for a multiple selection list box based on another field in Infopath 2010

    Hello there - Before I explain my issue, I would like to point out that I have reviewed some other discussions on selecting default values for multiple selection listbox. But my issue is specific and different, and not answered by any of the discussions
    I visited.
    I have a multiple selection list box (say for example all countries in the world as values), and I would like to pre-select or setup multiple default values (say five countries) based on some criteria that I query from MS SQL database table.
    I know we can go to Data | Default Values option to setup one or many default values for multiple selection list box. When I enter the default values manually this works. I also right click the field under the Multiple-Selection List Box group, then select
    Add another Value Below and set the Default Value for this field to setup multiple default values.
    However, if I reference a field (either an infopath field or a field from SQL database) I am not able to setup multiple default values. Infopath automatically selects the last field I selected for all instances and in the end I am able to see only one
    default value selected instead of many. How to fix this problem? Why would infopath allow multiple default values when we enter it manually but not when we reference some fields?
    Please let me know if you need more info. Appreciate your help.
    Thanks!

    Hi redhotc,
    According to your description, my understanding is that you want to set multiple default values for a multiple checkbox list in InfoPath form.
    I did a test with SQL database table. I set three default values for the checkbox list by adding three values field under the group field(Data->Default values), each value field is for a default value. Then publish it to my SharePoint site, everything
    was fine.Please have a try as the below link:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Note: if you are using SQL databse table, you may need to enable ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file’ in CA. More information, please refer to:
    http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010customization.aspx?ID=418b9423-a96c-4e5e-91f9-6a1b010ebb69
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How-To populate SELECT LIST default value from SQL Query

    OK, I've done my homework, and did not find my answer in the Forum, so here it is.
    I have a Page that displays fields from a SQL Query. The Page also has below that radiogroups, checkboxes, and Select Lists to allow the user to change values in the fields that are displayed at the top of the Region. I am able to pre-populate the radiogroups and checkboxes by performing a SELECT in the 'Source value or expression' of the Source area of the Page Item.
    However, I am unable to do the same for the Select List fields. Their default value ends up being the first value in the LOV ('-- None --' for NULL values). Source Used: Only when current value in session state is null. Source Type: SQL Query. Also, when I first go into the Page when running it, and check the Session State values, they are all null, so I don't understand why the field is not populated by the SQL Query statement as the radiogroups and checkboxes are.
    Any suggestions??? I've tried all sorts of combinations.

    Thank you for the suggestion.
    I had considered that, but cannot do so, because we are using Oracle Application Express more for development than for data containment.
    We have all our data in an Oracle 10.g DB which is separate from the OAEX server, and the OAEX app will reference that data via VIEWs and DB LINKs. We are doing so primarily as an added data security layer, where the data is housed separate from the app, in case the Web site is ever compromised. The data that can be viewed is restricted to a subset of the actual data that is available.
    Since the data is on a separate server, (I assume) we will not be able to set the source type to Database column, because (I asume) that is dependent upon the data being housed by the OAEX server.
    That still leaves me with having to populate the field with a SELECT statement from the Oracle DB. This unfortuneately is almost a show-stopper for me because of down-stream processing data requirements. Have not been able to come up with contingencies yet.

  • Create a structure based on Selection option field values?

    Hi Guys,
                 can anybody tell me is ther anyway to creat a strucitre after giving the values to selection screen .I have a req where fiscal period is entered based on this i have to create a structure suppose i he give 3 to 8 then i have to create a strucure with with some fields including period3 period4 like that until Period8 so is there anyway tocreate like that or not?
    Thanks,
    Gopi.

    You need an internal table not a structure.  Either count from from the low value to the high value adding a record to the table or select the entries from the Period master table for that selection range.
    Option 1
    REPORT  ZCOUNT.
    tables: t009b.
    select-options:
      s_period   for t009b-poper no-extension.
    data:
      gt_poper type table of poper,
      gs_poper type poper.
    start-of-selection.
      move s_period-low to gs_poper.
      while gs_poper le s_period-high.
         append gs_poper to gt_poper.
         add 1 to gs_poper.
      endwhile.
      loop at gt_poper into gs_poper.
        write:/  gs_poper.
      endloop.
    endloop.
    Option 2
    REPORT  ZCOUNT.
    tables: t009b.
    select-options:
      s_period   for t009b-poper.
    data:
      gt_poper type table of poper,
      gs_poper type poper.
    start-of-selection.
      select poper
        from t009b
        into table gt_poper
        where bdatj = '2007'
         and poper in s_period.
      loop at gt_poper into gs_poper.
        write:/  gs_poper.
      endloop.
    Not sure if t009b is the right table.
    Ta... JR

Maybe you are looking for

  • Audio tracks not lined up and no sound

    For some reason my audio tracks for my clips are on different tracks. Most are on a5/a6 and a3/a4 - those play with sound. The audio on a1/a2 is not heard when I play the clip??? When I try to move the audio to different tracks it messes up my video.

  • Printing a .pdf in CMYK not working??

    Hello! I need to create a pdf of an advert that I am having printed in a magazine. The Ad is about 10cm X 10cm so can fit onto and A4. The magazine say they need it with full printer marks inlcuding density bars and registration marks. As far as I ca

  • F2105 HP Monitor Will NOT Stay Awake

    Failed to awaken when W8 computer did. Have tried the monitor on W7, XP, another W8 computer and a Mac OsX - on all of which the monitor had previously worked. When the monitor is first hooked up (VGA, DVI) or turned on the monitor shows the expected

  • ORA-01103: database name 'ORDB' in control file is not 'ORCL'

    hey there !! 11.2.0 win 7 pro let me tell u whole scenario for how i reach to this error - ORA-01103: database name 'ORDB' in control file is not 'ORCL' -installed new 11g ( test/ practice environment ) -by default database created 'ORCL' while insta

  • FaceTime, User Not Available

    For some reason, when people try to connect to me via FaceTime, they get a message saying that "the user is not available to FaceTime." In this particular istance ... I try to FaceTime between two computers in my house, mine and my wife's. My wife la