Parameters & select-options

What will happen if we execute a report without giving any value in parameter in selection screen ?
What will happen if we execute a report without giving any value in select-options in selection screen ?

Hi Swapna,
Here you go..Use this code and find the differennce
*--   2) Difference between Parameters and Select options with
*--    No-Intervals and No-extension
Explanation: -
1) If u dont enter any value in parameter, the system consider it as a initial value and dont retrive any records. If u dont enter any value in select-options, the system selects all values from the database.
2) The other difference is You can check a value againist a Entries against a check table with Parameter option by as " VALUE CHECK ". However it is recommended to use this only when the parameter is obligatory becuase it checks for blank entries also. This option( VALUE CHECK ) cannot be used in SELECT-OPTIONS.
( Eg:- p_matnr like mara-matnr OBLIGATORY VALUE CHECK. )
TABLES: MARA.
DATA: p_count TYPE i,
      s_count TYPE i.
PARAMETERS: p_mtart like mara-mtart.
SELECT-OPTIONS: s_mtart FOR mara-mtart NO INTERVALS NO-EXTENSION.
SELECT count(*) FROM
   MARA into p_count
   WHERE matnr = p_mtart.
SELECT count(*) FROM
   MARA into s_count
   WHERE matnr IN s_mtart.
WRITE:/ p_count,
        s_count.
In this output, p_count = 0.
            and s_count will be total no. of records in database.
Reward points if this code is helpful.
Thanks.
Hari krishna

Similar Messages

  • Mix of Parameters & Select Options in a Selection screen in WD4A

    Hi All.
    I just created my first selection screen in WD4A couple of days back.
    Now, we have to mix up some parameters and select-options just like in normal ABAP.
    But I could only find a way to insert a "Range" into the WD4A screens via "Create_Range_table".
    Supposing I have 2 select-options, then 2 parameters - i.e. no Pattern or range or intervals options (simple = option); then again 2 select-options.
    Can't we make a simple Parameter option in WD4A selection screen? I know we can make no_extension and no_intervals as true so that it does look like a parameter. But still user can enter a pattern search in it like a select-option.
    Hope my query is clear.
    Another question is : As far as I understood, we ALWAYS need a IT_RESULT table in the method ADD_SELECTION_FIELD. Then why is it not mandatory in the method? 
    Thanks in adv.

    Hi Aishi,
    In an early version of SelectOptions, the parameter it_result was mandatory. Some time later, a developer contacted me and showed me an example where it was benefitial to first create the field and to pass in the range table at a later point in his algorithm. This can be done by calling set_range_table_of_sel_field( ). Hence, the parameter has become optional. Of course, a range table needs to be specified before the page gets rendered.
    Best regards,
    Thomas

  • Selection screen Parameters  - Select -options  values  populated from ITAB

    PARAMETERS  : PLANT
    SELECT-OPTIONS : MATERIAL
    My Selection Screen contents of  should  change   as  the PLANT changes ..
    and i want  to populate the  contents of  SELECT-OPTIONS  from an ITAB  how can i do that .
    wen  plant changes  its  corresponding  materials should  reflect  inthe Select -options.   this is my need .
    please solve..
    thanks, .
    Aslam.

    Srry Raj u misundersttod me ...
    I was not saying ur solution is not gud ...my question was different .....may be this is not the right forum to ask what i want to know ....
    just bear with me moderators plz ...
    i just wanted to understand the interview process...since I have not appreared for any interview ( I started my carreer with a company and I am still with it ..wuld luv to continue [:d])
    I believe , if you would have asked me the same question probably i would not have given u the best possible solution...as u r also admitting for ur particular scenario ur solution is better than max's .....
    as an inteviewer will u expect the best solution from me .....( which might not come to my mind ( nd I am sure will not ..I luv abap debugger ) or u just wanna check if I know how to use difference selection screen events .
    If u wanted to hear only the better solution ...( I am rejected ............now I will have to continue sticking to my current job [:d], not bcoz i prefer but bcoz I cant switch )
    if u want to test if i know how to use selection screen events then ( I am selected ...but now I would like to stick to my current job ...bcoz I want to )
    Now I realize I cannot do ABAP without Debugger.

  • How to write text name of parameters / select options in  ABAP list??

    Hi gurus, i must read the text name of parameterd / select options in ABAP program and write it in a list of the same program for log.......how can i do it??
    Thanks in advance!
    Best regards!
    Ferdinando
    Message was edited by:
            Ferdinando Sellitto

    Hello Ferdinandino
    Useful function modules are:
    RS_PRINT_SELECTIONS
    RS_LIST_SELECTION_TABLE (Generates list according to values in selection table(RSPARAMS))
    RS_REFRESH_FROM_SELECTOPTIONS (Current contents of selection screen)
    Function module RS_REFRESH_FROM_SELECTOPTIONS can provide the input for function module RS_LIST_SELECTION_TABLE.
    Regards
      Uwe

  • ALV Grid Print Parameters (Select-Option Headerpage)

    Dear developers,
    I'm searching for the right method to call, parameter to
    set or whatever I may need to do in order to get my
    programm using the function REUSE_ALV_GRID_DISPLAY to
    set the option for the printout of the leading page
    with the select-options list. I want to force the output and I thought I coulde use the IS_PRINT - parameter for
    that (structure SLIS_PRINT_ALV, field no_print_selinfos),
    but that doesn't seeem to work. What am I doing wrong ?
    regards
    Andreas

    If all else fails, you can write your select-options manually in the header.  Something like this.
    report zrich_0001
           no standard page heading.
    * Global ALV Data Declarations
    type-pools slis.
    data: begin of i_alv occurs 0,
          matnr type mara-matnr,
          end of i_alv.
    * Miscellanous Data Declarations
    data: fieldcat type slis_t_fieldcat_alv,
          events   type slis_t_event,
          list_top_of_page type slis_t_listheader,
          top_of_page  type slis_formname value 'TOP_OF_PAGE'.
    select-options: s_matnr for i_alv-matnr.
    start-of-selection.
      perform initialization.
      perform get_data.
      perform call_alv.
    end-of-selection.
    *  Form  Initialization
    form initialization.
      clear i_alv.       refresh i_alv.
      perform eventtab_build using events[].
    endform.
    *  Form  Get_Data
    form  get_data.
      select matnr into table i_alv
                  from mara where matnr in s_matnr.
    endform.
    *  CALL_ALV
    form call_alv.
      data: variant type  disvariant.
      data: repid type sy-repid.
      repid = sy-repid.
      variant-report = sy-repid.
      variant-username = sy-uname.
      perform build_field_catalog.
      perform comment_build using list_top_of_page[].
    * Call ABAP List Viewer (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat        = fieldcat
                i_callback_program = repid
                is_variant         = variant
                it_events          = events[]
                i_save             = 'U'
           tables
                t_outtab           = i_alv.
    endform.
    * EVENTTAB_BUILD
    form eventtab_build using events type slis_t_event.
    * Registration of events to happen during list display
      data: tmp_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = events.
      read table events with key name = slis_ev_top_of_page
                               into tmp_event.
      if sy-subrc = 0.
        move top_of_page to tmp_event-form.
        append tmp_event to events.
      endif.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      clear: fieldcat. refresh: fieldcat.
      data: tmp_fc type slis_fieldcat_alv.
      tmp_fc-reptext_ddic = 'Material'.
      tmp_fc-fieldname    = 'MATNR'.
      tmp_fc-tabname      = 'I_ALV'.
      tmp_fc-outputlen    = 18.
      append tmp_fc to fieldcat.
    endform.
    * COMMENT_BUILD
    form comment_build using list_top_of_page type
                                            slis_t_listheader.
      data: tmp_line type slis_listheader.
      clear tmp_line.
      tmp_line-typ  = 'H'.
      tmp_line-info = 'Select-Options'.
      append tmp_line to list_top_of_page.
      read table s_matnr index 1.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'From Material'.
      tmp_line-info = s_matnr-low.
      append tmp_line to list_top_of_page.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'To Material'.
      tmp_line-info = s_matnr-high.
      append tmp_line to list_top_of_page.
    endform.
    * TOP_OF_PAGE
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = list_top_of_page.
    endform.
    Regards,
    Rich Heilman

  • SELECT OPTIONS DATE.

    Hello , I need your help ,  to access to  every date in an interval of the select option , in order to execute a function module that use date in one of its parameters .
    select-options : dat for sy-datum .
       CALL FUNCTION 'ZPRUEBA''
         EXPORTING
           offic                =
           chdsk                =
           inicio_periodo       =
         FIM_PERIODO          =  dat  "but i need here every date of the interval
         NO_UPDATE            =
       IMPORTING
         NR_COBRANCAS         =
       ENDSELECT.
    How can I do that ? , tnhx.

    hi
    put the function module in the loop.
    data : date like sy-datum.
    select-options : s_date for date.
    while ( s_date-low LE s_date-high ).
    CALL FUNCTION 'ZPRUEBA''
    EXPORTING
    offic =
    chdsk =
    inicio_periodo =
    FIM_PERIODO = s_date-low
    NO_UPDATE =
    IMPORTING
    NR_COBRANCAS =
    add 1 to s_date-low.
    endwhile.
    reward if helpful
    prasanth

  • Doubt in select options

    Hi frnds,
    Normally select option allowing only 8 charactor in declaration part, but i want to display with morethan 8 charator. i think some text id formet is there, how to do that.
    for ex,
    s_org for vbak-vkorg  .
    for this i want to give sales organisation.
    how to do this.
    plz its urgent.
    Gowri

    SELECTION-SCREEN BEGIN OF LINE.
    [SELECTION-SCREEN POSITION pos [ldb_additions]].
    SELECTION-SCREEN END OF LINE.
    Effect
    The first and last statements define a new line below the existing elements on the selection screen.
    All the screen elements within these statements that are defined with PARAMETERS SELECT-OPTIONS and SELECTION-SCREEN statements are placed in this line one after the other without spaces.
    Several SELECTION-SCREEN POSITION statements can be listed within the definition of a line. The SELECTION-SCREEN POSITION statement can be used to define the output position for the following screen element. The position pos can either be specified directly as a number between 1 and 83 or using pos_low or pos_high expressions. The expression pos_low specifies the position in which the input field for a parameter or the first input field for a selection criterion is displayed as standard. The expression pos_high specifies the position in which the second input field for a selection criterion is to be displayed as standard. If you make a different specification of the position in the statement defining the following element, this is taken into account. The statement SELECTION-SCREEN POSITION is only possible within the definition of a line. If there are conflicts with existing screen elements, the selection screen cannot be generated.
    The additions ldb_additions can only be used in a selection include for a logical database.
    The following applies in the definition of a line:
    Output fields are not created for selection texts for the parameters displayed in these kinds of lines. Instead, these can be created by specifying a SELECTION-SCREEN COMMENT.
    You cannot define other lines with SELECTION-SCREEN BEGIN OF LINE.
    You cannot define blocks or tabstrip controls with SELECTION-SCREEN BEGIN OF [TABBED] BLOCK.
    Within a line, only one selection criteria should be defined with SELECT-OPTIONS whose description can be specified in advance using SELECTION-SCREEN COMMENT. Other combinations, especially definitions of elements according to the selection criteria, can lead to an undefined behaviour.,
    The backslash (/) is not allowed when giving format specifications.
    You can omit the position specification pos in formatting specifications.
    Note
    If a screen element is assigned a position greater than 83 or is positioned outside a block with a frame, the selection screen is not generated. In the case of input and output fields that were positioned beforehand but have a length that extends beyond the end of the line, the visible length is shortened accordingly and the content is displayed in the visible length and can be scrolled. In this case, pushbuttons and horizontal lines are cut off at position 83 or where the frame of the block ends.
    Example
    A pushbutton, an input field, and an output field in a line in the standard selection screen for an executable program.
    SELECTION-SCREEN: BEGIN OF LINE,
                      PUSHBUTTON 2(10) push USER-COMMAND fcode,
                      POSITION 16.
    PARAMETERS para TYPE c LENGTH 20.
    SELECTION-SCREEN: COMMENT 40(40) text,
                      END OF LINE.
    INITIALIZATION.
      push = 'Push'.
      text = '<--- Fill field, then push button!'.

  • Select-options on Module pool

    Hi,
      COuld any body tell me how to give range of values as in input in module pool program same as Select-options on standard selection screen.
    Regards,
      Satya

    Hi,
    The two statements:
    SELECTION-SCREEN BEGIN OF SCREEN numb [TITLE tit] [AS WINDOW].
    SELECTION-SCREEN END OF SCREEN numb.
    define a user-defined selection screen with screen number numb. All PARAMETERS, SELECT-OPTIONS, and SELECTION-SCREEN statements that occur between these two statements define the input fields and the formatting of this selection screen. Screen number numb can be any four-digit number apart from 1000, which is the number of the standard selection screen. You must also ensure that you do not accidentally assign a number to a selection screen which is already in use for another screen of the program.
    From your screen program in which selection screens are defined, you can call these screens at any point of the program flow using the following statement:
    CALL SELECTION-SCREEN <numb> [STARTING AT <x1> <y 1>]
    [ENDING AT <x2> <y 2>].
    Look at the DEMO program <b>DEMO_DYNPRO_SUBSCREENS.</b>
    Regards
    Sudheer

  • 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

  • Creating select option to get wadat from likp to use in the query

    Hi People,
    Urgent Help. I have to make a select-option in my selection screen for date to use the field wadat from likp. Now the after the following code what should I be doing:
    Selection-Screen BEGIN OF BLOCK b with frame Title t1.
    PARAMETERS:
    SELECT-OPTIONS: p_date for likp-wadat.
    SELECTION-SCREEN END OF BLOCK b.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
    <b>SELECT avbeln alfdat awadat akunnr bwerks bspart INTO
    CORRESPONDING FIELDS OF TABLE typ_tab FROM likp as a INNER JOIN lips as b on avbeln = bvbeln where wadat IN p_dat.</b>
    On the selection screen there will be two boxes for the from -to date...How does it work? If I have to make it only for one date or for range of dates. Please help asap. I have to use this value in a report to pull out delivery document details from likp and lips through the query mentioned above.
    Thanks in advance.
    AM

    Hey Nishanth,
    Thanks for the reply. I made the changes as suggested but when I am entering a date which does not exist in the table, the screen does nothing. Can you suggest something for that.
    Here is my code:
    tables: likp.
    SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE date.
    SELECT-OPTIONS p_date FOR likp-wadat NO-EXTENSION.
    PARAMETERS p_glAccNo(80) TYPE C.
    SELECTION-SCREEN END OF BLOCK b_0.
    DATA: BEGIN OF typ_likp occurs 0,
                     vbeln LIKE likp-vbeln, " Bill Of Lading Number
                     lfdat LIKE likp-lfdat,
                     wadat LIKE likp-wadat,
          END OF typ_likp.
    AT SELECTION-SCREEN ON p_date.
    if p_date[] is NOT INITIAL.
    SELECT vbeln wadat INTO TABLE typ_likp FROM LIKP WHERE wadat IN p_date.
    IF sy-subrc <> 0.
    WRITE: / 'No Values for this date.'.
    Exit.
    ENDIF.
    ELSE.
    WRITE: 'NO ENTRIES HAVE BEEN MADE'.
    ENDIF.
    START-OF-SELECTION.
    SELECT vbeln lfdat wadat INTO TABLE typ_likp fROM LIKP where
    wadat in p_date.
    LOOP AT typ_likp.
    Write: / typ_likp-vbeln, typ_likp-lfdat, typ_likp-wadat,
           / 'I am here.'.
    ENDLOOP.
    Please reply soon. I need to finish this at the earliest.
    Thanks for your help, regards,
    AM

  • Populating a select-options table on INTIALIZATION

    Hello,
    I need to have a report where all of the parameters are already entered.  The parameters (select-options) are shipping points (likp-vstel).  I have a list of 7 shipping points.  How do I go about adding them to the table so_vstel?
    Davis

    Hi,
    In the Initialization event, you can populate default values to select options and parameters.
    Check these links for more details -
    Re: Reports - initialization event
    Re: what is the specific use of initialization event
    Hope this helps.
    ashish

  • Change  select-options lable

    Hi expert ,
    SELECT-OPTIONS : PO_DATE FOR AUFK-ERDAT,
    but i want to write po_date as PRODUCTION ORDER DATE , as i know d default value is 8 characters,i want to know the solution problem.plz help me.

    Hi,
    Goto SE38 --> open your report program --> click menu GOTO --> click Text Elements --> click Selection Texts
    Here you can see al the parameters/selection option included on the selection screen. Change the output string as per your requirement. Now when you execute your program then you wil see the new text displayed on the output screen.
    Hope this helps you.
    Regards,
    Tarun

  • Parameters and Select Option in ABAP OO

    Hi all,
    it's possible to build an application starts with a method of a class thats declares parameters and select-option or I have to do it custom creating a dynpro and some input field as parameters?
    thanks
    enzo

    Just to add detail: the function module RS_REFRESH_FROM_SELECTOPTIONS returns a table of TYPE RSPARAMS_TT.
    The structure of this table is:
    SELNAME
    RSSCR_NAME
    KIND
    RSSCR_KIND
    SIGN
    TVARV_SIGN
    OPTION
    TVARV_OPTI
    LOW
    TVARV_VAL
    HIGH
    TVARV_VAL
    the first field is the name of the selection parameter, the others have the same structure obtained declaring a range with:
    TYPES|DATA <rangetab> TYPE RANGE OF <type>.
    see the help topic http://help.sap.com/saphelp_470/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm

  • Select-options and parameters

    hi,
    In How many ways we can define select-options and parameters.

    hi uday,
    Usually we use PARAMETERS for single value input and
    SELECT-OPTIONS is used to give a range of input values for a single field
    SELECT-OPTIONS implicitly consists of internal table with fields
    OPTIONS
    LOW
    HIGH
    SIGN
    eg:
          DATA: G_VBELN TYPE VBAK-VBELN.
          SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
          PARAMETERS : P_VBELN LIKE VBAK-VBELN.
          SELECT-OPTIONS: S_VBELN FOR G_VBELN.
          SELECTION-SCREEN END OF BLOCK B1.
       o/p:
              P_VBELN: _________________.
             S_VBELN:___________ TO  ____________.
    reward if helpful
    regards.
    shashikanth naram.

  • Parameters has to act as select-options in module pool.

    Hi Folks,
    I have to make material number parameters as select-options in Tcode = CS15.
    & I have to add one more fileld as select-options in the same screen.
    It's in modulpool. Shall i use SCREEN-EXITS for this? what will be the preferable solutions?

    Better not to modify standard SAP code. Check for screen exits/ BADI's for this transaction
    Check these badis
                                                                                    BOM_EXIT             BOM User Exit                                                
    BOM_UPDATE           Maintain BOMS                                                
    CEWB_BOM_CUS_FIELDS  EWB: Customer Fields with BOM Header (Screen Enhancement)    
    CEWB_BOM_UPDATE      Check Bill of Material on Saving                             
    CEWB_ITM_CUS_FIELDS  EWB: Customer Fields with BOM Item (Screen Enhancement)
    and these enhancements
    PCSD0001  Applications development R/3 BOMS                           
    PCSD0002  BOMs: Customer fields in item                               
    PCSD0003  BOMs: Customer fields in header                             
    PCSD0004  BOM comparison                                              
    PCSD0005  BOMs: component check for material items                    
    PCSD0006  Mass changes user exit                                      
    PCSD0007  Check changes in STKO                                       
    PCSD0008  WBS BOM: Customer-specific explosion for creating           
    PCSD0009  Order/WBS BOM, determine URL page                           
    PCSD0010  Order/WBS BOM, determine explosion date                     
    PCSD0011  Knowledge-based order BOM, parallel update                  
    PCSD0012  Customer - Mat. number/mat. number during material exchange 
    PCSD0013  Customer-specific processing of an explosion for BOM browser
    PCSD0014  Knowledge-Based Order BOM: Status
    Edited by: abap on Jan 8, 2009 8:43 AM

Maybe you are looking for