Adding default value for a select-options in a selection-screen
hello gurus,
i have a report program with the following select-options in a selection-screen block:
select-options: so_site for MyTable-werks.
i want the so_site to have a default value once the program displays. can it be possible?
regards,
sid
Hi sid,
1. Whenever we use select-option,
an internal table of type range is
automatically created.
2. so, in fact, we have to put
record in this internal table.
3. eg. Just copy paste in new program.
4.
report abc.
tables : t001.
select-options : bukrs for t001-bukrs.
initialization.
bukrs-sign = 'I'.
bukrs-option = 'EQ'.
bukrs-low = '1000'.
append bukrs.
regards,
amit m.
Similar Messages
-
Maintaing a default value for a particular field in the selection screen
Hi all,
How to maintain a default value for a particular field in the Selection Screen of a Standard report
Regards
Ajay>
ajay babu wrote:
> Hi all,
>
> How to maintain a default value for a particular field in the Selection Screen of a Standard report
>
> Regards
> Ajay
Create a variant for your standard program and assign this variant to the field 'Start with variant' while creating transaction code for the standard program in the transaction 'SE93'.
Regards
Rajesh. -
Default values for a field in itab
Hello everyone!
In the declaration below,
DATA: BEGIN OF itab OCCURS 0,
belnr LIKE bkpf-belnr,
myField,
END OF itab.
The belnr field will be filled by using SELECT statement but myField will have a default value, for example, "1,000".
Is it possible to do without looping around the itab?
Thanks!> HI,
> We can not set a Default value for a Internal table
> field, after selecting all the records in to the
> Internal table, Loop the internal and pass the
> constant value to that field and modify field
>
>
> Regards
> sudheer
I see.. Is it really necessary to loop? I would like to avoid looping because it takes so much time... -
Default Values for Select-options In Webdynpro-ABAP
Hi Freinds,
Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP.
Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View.
Regards,
Xavier.PXavier Reddy Penta sent me this question via email and I answered it directly yesterday. Here is the solution that I provided to him, so that it is stored with the original question:
I believe your problem is that you are not setting the value into the range correctly. You are setting it directly into the field symbol of the range like such:
<FS> = L_STRING2.
But ranges are deep objects. They have four fields: Sign, Option, High, and Low. This is from the online help:
1. sign of type c and length 1. The content of sign determines for every row whether the result of the condition formulated in the column is included or excluded in the entire resulting set for all rows. Evaluable values are "I" for include and "E" for exclude.
2. option of type c and length 2. option contains the selection option for the condition of the row in form of logical operators. Analyzable operators are "EQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP" if column high is initial, and "BT", "NB" if column high is not initial. With the options "CP" and "NP", the data type of the columns low and high must be of the data type c, and special rules apply for entries on the selection screen.
3. low of the data type defined after FOR. This column is designated for the comparison value or the lower interval limitation.
4. high of the data type defined after FOR. This column is designated for the upper interval limitation.
So when you are moving the value into the field symbol you are setting it into the sign column.
Here is an example of how you can access the components of the range:
* create a range table that consists of this new data element
lt_range_table =
wd_this->lv_sel_handler->create_range_table(
i_typename = l_typename ).
IF l_fieldname = 'CARRID'.
FIELD-SYMBOLS: <tab> TYPE INDEX TABLE,
<struct> TYPE ANY,
<wa> TYPE ANY,
<option> TYPE char2,
<sign> TYPE char1,
<high> TYPE ANY,
<low> TYPE ANY,
<wa_values> TYPE ANY.
ASSIGN lt_range_table->* TO <tab>.
APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
<sign> = 'I'.
<option> = 'EQ'.
<low> = 'AA'.
ENDIF. -
Set of default values for Select-Options
Hi Gurus,
I have a requirement where I need to set default values for select options
ex: SELECT-OPTIONS: S_MTART FOR MARA-MTART
default values must be ERSA - HIBE- FHMI - DIEN - GEST
Please tell me how to do it.
Effective replies will be rewarded with full points
KarthikHi,
For each SELECT-OPTION, you can only specify one DEFAULT.
You must specify the default value g in its internal format, e.g. "SELECT-OPTIONS DATE FOR SY-DATUM DEFAULT '19931224'", not "... DEFAULT '24.12.1993'".
The default value g should normally be a literal because, at runtime when you use SUBMIT, it is transferred to the selection options table sel so early that no value can be assigned to the field g. System fields like SY-DATUM are an exception here because the system usually assigns values to them as soon as the report processing starts.
When you use user-defined selection screens in your programs that you do not call using SUBMIT, the DEFAULT value is transfered when the selection screen is first called. In this case, therefore, you can use other fields g.
regards,
sowjanya
Message was edited by: sowjanya suggula -
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 -
Pass the results from a selection formula to the default values for a parameter field
Post Author: kevans
CA Forum: General
Crystal 10 u2013 SQL 2000
I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all. BUT I donu2019t want this to be a static list where I type in all 40 depts in the default list, I was hoping I could do something more dynamic such a formula field that says u201C if {group.name startswith u2018ITu2019 then {group.name}u201D and then have the parameter field pull from this source.
Iu2019m sure this has been answered in a previous post but Iu2019m not finding it. I see stuff on creating a record selection formula such as u2018if {?group} like u2018IT-Secur*u2019 thenu2026u201D but this leaves too much room for error if people donu2019t type the name correctly. Maybe Iu2019m not using the record selection formula correctly? Sorry if I offend anyone but I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed.Post Author: sharonmtowler
CA Forum: General
if you are creating the parameters in the rpt file, it will only pull values you enter, or directly from the database
in the record selection you can do something like this, so if they only enter the first 2 characters it should pick up only the IT etc.
(if eft(,2)={?parameter} then true else ={?parameter}) -
Default value for selection screen field
Hi all,
I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
How can I do it?
Thanks
RahulHi Rahul,
In the INITIALIZATION event we can set the default values for selection screen fields.
INITIALIZATION.
loop at screen.
if screen-name = 'S_MATNR-LOW'.
CLEAR S_MATNR.
s_matnr-low = '1234'.
s_matnr-option = 'EQ'.
s_matnr-sign = 'I'.
append s_matnr.
CLEAR S_MATNR.
s_matnr-high = '5678'.
s_matnr-option = 'EQ'.
s_matnr-sign = 'I'.
append s_matnr
clear s_matnr.
endif.
endloop.
Hope it helps.
Mark if useful
Regards,
Saumya -
How to hide PNP selection windows and set default values for PNP.
Hi expert,
I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
Many Thanks,Hi
You have mentioned 2 things.
1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
HR Report Category
2. I want to set default value for some selection items - This you need to achieve in initialization event of your program.
How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
Thanks,
Sreeram -
How to set the Default values for Info Objects in Data Selection of InfoPac
Hi All,
Flat file Extracion:
How to set the Default values for Info Objects in Data Selection Tab for Info Package
ex: Fiscal Year Variant Info Object having values 'K4' 'Y2' etc in Flat file
Initially default value(not constant) for this info Object value should be 'K4' in Info Package
If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
Rgds,
CVHi,
suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
haritha -
ALV Grid default values for new rows added with Add/Insert buttons
Hi!
Help, please, to find a way how to set default values for new rows added with Add/Insert buttons in
ALV Grid.I have found salution:
ALV Grid u2013 Insert row function
Sometimes we need to assign some default values when we create a new row in a grid using standard ALV Append row button. In our scenario we will see how to assign default values to Airline Code (CARRID), Flight Connection Number (CONNID) and Flight date (FLDATE) when a new row is created. To do that we need to handle DATA_CHANGED event in the program like mentioned below.
Definition of a class:
Code:
CLASS lcl_event_receiver DEFINITION
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed
e_ucomm.
ENDCLASS. "lcl_event_receiver DEFINITION
Implementation of a class:
Code:
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_DATA_CHANGED.
DATA: dl_ins_row TYPE lvc_s_moce. " Insert Row
FIELD-SYMBOLS: <fs> TYPE table. " Output table
Loop at the inserted rows table and assign default values
LOOP AT er_data_changed->mt_inserted_rows INTO dl_ins_row.
ASSIGN er_data_changed->mp_mod_rows->* TO <fs>.
loop at <fs> into ls_outtab.
ls_outtab-carrid = 'LH'.
ls_outtab-connid = '400'.
ls_outtab-fldate = sy-datum.
MODIFY <fs> FROM ls_outtab INDEX sy-tabix.
endloop.
endloop.
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
Register the events to trigger DATA_CHANGED event when a new row is created.
Code:
CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED. -
How to set the default values for print options
Hi all,
We can set the default value for print options, just like Logical destination、numbers of messages、print immediately and so on, so where we should to maintain these default?Hi Sandy,
This can be done by an abaper by making changes in the driver program. The Driver program feeds all the data which u have mentioned for printing.
if the driver program is standard. copy to an z type and make modification on printer settings on the driver program code.
this will surely solve the issue.
Regards
Gunaseelan -
Default values for files and columns when adding a discoverer porlet
Hi, i'd like to know how to configure the default value for numbers of columns and files when i add a new discoverer porlet in a portal page.
The actual default value is 10 files and 6 columns and i always have to increase it to at least 100x100.
Is there any config file where i can change that?
I've found a configuration.xml in $ORACLE_HOME/discoverer/config/configuration.xml
with a section
<!-- Discoverer Servlet configuration. Defines behaviour of both
discoverer/plus and discoverer/viewer servlets -->
but couldnt find a parameter for those items.
Thanks in advance.
Daniel PerezI think triggers are the best device.
Scott -
Default value for attribute "COUNTRY" in BP_HEAD_SEARCH/MainSearch
Hi Gurus,
Requirement is to set default value for attribute "COUNTRY" in BP_HEAD_SEARCH/MainSearch when user clicks on Corporate Account.
Below is code that i have written in DO_PREPARE_OUTPUT.
Code is working fine and in the debug also i can see the value of COUNTRY is set to DE, but it is not showing on the screen for first time but when i load component second time(Refresh the screen), it shows me value.
Any help would be appreciated. If somebody has otheralternative kindly share.
CALL METHOD super->do_prepare_output( iv_first_time = iv_first_time ).
Calling Super Method
CALL METHOD super->do_prepare_output
EXPORTING
iv_first_time = abap_true.
Data Declatation
DATA :lr_col TYPE REF TO if_bol_bo_col,
lr_current TYPE REF TO if_bol_bo_property_access,
lr_param TYPE REF TO if_bol_bo_property_access,
lr_qs TYPE REF TO cl_crm_bol_dquery_service,
lv_attr_name TYPE name_komp,
lv_sign TYPE bapisign,
lv_option TYPE bapioption,
w_country_exist TYPE c,
w_param TYPE string,
w_value TYPE string,
w_flag TYPE c.
Getting SEARCH Context Node
lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).
Get Selection Parameters
lr_col ?= lr_qs->get_selection_params( ).
Start from first parmaters
lr_current = lr_col->get_first( ).
Clearing Variables
CLEAR : w_country_exist, w_flag, w_param, w_value.
Loop till we have selection paramters
WHILE lr_current IS BOUND. " While loop 1
checking attribute name is COUNTRY then setting some variable
w_param = lr_current->get_property_as_string( 'ATTR_NAME' ).
CASE w_param.
WHEN 'COUNTRY'.
If country is filled then setting variable
w_value = lr_current->get_property_as_string( 'LOW' ).
IF w_value IS NOT INITIAL.
w_country_exist = abap_true.
ENDIF.
When we got COUNTRY attribute then setting flag
w_flag = abap_true.
ENDCASE.
Calling next parameter
lr_current = lr_col->get_next( ).
ENDWHILE. " While loop 1
In below block we are checking is COUNTRY attribute is blank and
we have found COUNTRY attribute in current selection paramters
IF lr_qs IS BOUND. " SEACRCH CONTEXT BOUND
If vairable is blank means DE or any other value is not filled in COUNTRY Attribute
IF w_country_exist IS INITIAL. " w_contry_exist
We have to add selection attribute if we come accross COUNTRY attribute during our search
IF w_flag EQ abap_true. " w_flag
Adding COUNTRY attribute with default value 'DE'
lr_qs->add_selection_param( EXPORTING iv_attr_name = 'COUNTRY'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = 'DE' ).
ENDIF. " w_flag
ENDIF. " w_contry_exist
ENDIF. " SEACRCH CONTEXT BOUND
In below block we will remove COUNTRY attribute when it has blank value
IF lr_qs IS BOUND AND w_country_exist IS INITIAL.
lr_current = lr_col->get_first( ).
WHILE lr_current IS BOUND.
w_param = lr_current->get_property_as_string( 'ATTR_NAME' ).
CASE w_param.
WHEN 'COUNTRY'.
w_value = lr_current->get_property_as_string( 'LOW' ).
IF w_value IS INITIAL.
lr_col->remove( iv_bo = lr_current ).
ENDIF.
ENDCASE.
lr_current = lr_col->get_next( ).
ENDWHILE.
ENDIF.
Edited by: Harsharandeep Singh on Apr 28, 2011 3:44 PMHi,
Try it like this:
DATA:
lr_bo TYPE REF TO if_bol_bo_property_access ,
lv_attr_name TYPE name_komp.
FIELD-SYMBOLS:
<ls_param> TYPE crms_thtmlb_search_criterion.
READ TABLE parameters
ASSIGNING <ls_param>
WITH KEY field = 'COUNTRY'.
IF ( sy-subrc = 0 ).
<ls_param>-value1 = ip_pfct.
ENDIF.
CHECK ( me->parameter_collection IS NOT INITIAL ).
lr_bo = me->parameter_collection->get_first( ).
WHILE lr_bo IS BOUND.
CALL METHOD lr_bo->get_property_as_value
EXPORTING
iv_attr_name = 'ATTR_NAME'
IMPORTING
ev_result = lv_attr_name.
IF lv_attr_name EQ 'COUNTRY' .
CALL METHOD lr_bo->set_property
EXPORTING
iv_attr_name = 'LOW'
iv_value = 'DE'.
EXIT.
ELSE.
lr_bo = me->parameter_collection->get_next( ) .
ENDIF.
ENDWHILE .
Kind regards,
Micha -
Hi,
I am trying to load a datafile to a table using SQL*loader, how can I assign the default values for a coulmn in control file of sql loader, here are datafile and target table i am using
datafile
empid,empname,empdept
1001,clark,123
1002,Mike,123
1003,john,123
1004,bryan,123
desc emp_table
empid number(10)
empname varchar2(30)
empjob varchar2(20)
empdept number(10)
empmgr number(10)
The datafile has the data for only 3 columns in emp_table, there is no data for empjob and empmgr in the datafile.I would like to use default values for them empjob = sales and empmgr = 2001, so how can I set these default values in the control file.
Thanks in advance!!The simplest way is to forget about passing default values in control file. Create table just for this load with DEFAULT constraint for missing columns and load file in this newly created table. Let's call it LDR_TBL. Then "INSERT INTO EMP_TBL SELECT * FROM LDR_TBL; " Make sure you define control file as follows (skipping empjob and empmgr). Oracle will populate "empjob, empmgr" with 'sales',2001 as part of column constraint.
load data
infile 'x.txt'
into table emp_table
fields terminated by ',' optionally enclosed by '"'
(empid,empname,empdept)
When all is done, DROP TABLE LDR_TBL ;
Does this help ?
Maybe you are looking for
-
I would like to create a body of text arranged in two columns so that text that is entered into the first column will, when first col. is full, continue into the second, and when that is full, into a new page, etc. Would you please show me how to se
-
Smart cover interfearing with notification
I Have had my iPad 2 for some time now and I have a smart cover I am running iOS 5.0.1, Now I have my Notifications setup and when I have the smart cover closed and sitting on my desk, coffee table, etc. There is no alert of notifications but the mom
-
Define attribute of element at template
Hi, i have a result xml data as shown below: - <ParameterDatas> - <parameter> <isim>sys.tfs.collectstatistics</isim> <tanim>TFS logon ekraninda istatistikler toplanacak mi?</tanim> <deger>1</deger> </parameter> - <parameter> <isim>sys.tfs.run.mode</i
-
Additional password dialog CE 5
We ve the following problem. When we switch on the WINCE Security Policy with additional password settings. The devices are asking to fill in a password (set a password) all is ok until we reboot (switch off) the mobile device. When it comes up there
-
BugReport: ID CS4 - Ctrl+0
Finally got CS4 Design Premium and have installed. One of the first things I noticed is what seems to be a bug. I searched the forums and found no mention of it though .... The keyboard shortcut Ctrl+0 in ID seems to be set as the command for "Fit Pa