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.P
Xavier 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.
Similar Messages
-
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 -
How to assign list of default value for select-option variable???
Hi every one
This is Deepak,
I want to know how to assign list of default value to select-option variable ? please any body tel me solution
for example
select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
Thank you in advance
DeepakHi.
Check the following sample code.
REPORT ztn_test.
" It is example for list populating.
TABLES:knvp.
data: BEGIN OF itab OCCURS 10,
kunnr like knvp-kunnr,
END OF itab.
data: wa_itab like itab.
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
PARAMETERS: s_kunnr(20) type c as LISTBOX VISIBLE LENGTH 40 .
AT SELECTION-SCREEN OUTPUT.
SELECT kunnr from knvp into CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
" I have used loop to populate some values from table
loop at itab into wa_itab.
name = 'S_KUNNR'.
value-key = sy-tabix.
value-text = wa_itab-kunnr.
append value to list.
clear wa_itab.
endloop.
" If u want individaully assign the values change the code as
name = 'S_KUNNR'." Select option name
value-key = 1." Index
value-text = 'VAL1'.
append value to list.
name = 'S_KUNNR'." Select option name
value-key = 2." Index
value-text = 'VAL2'.
append value to list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = name
values = list.
Edited by: tahir naqqash on Feb 21, 2009 4:38 PM -
Default value for select options.
Hi folks
I have to default four values in select-options.
eg.,
S_lfart for likp-lfart, default zse, zin, znd, zps.
Thanks in Advance,
RaoHi,
Go through the following syntax:
SELECT-OPTIONS <sel> FOR <f>
[DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]
[MEMORY ID <pid>]
[LOWER CASE]
[OBLIGATORY]
[NO-DISPLAY]
[MODIF ID <key>]
[NO-EXTENSION]
[NO INTERVALS]
[NO DATABASE SELECTION].
Declares a selection table <sel> for the field <f>. For <sel>, places input fields on the corresponding selection screen. The additions allow you to set a default value, accept input in lowercase, define a required field, suppress or modify the display on the selection screen, restrict the selection table to a line or a selection to a single field, or prevent input from being passed to a logical database
Regards,
Bhaskar -
Specific default values for select-options high and low
Hi
My requirement is in the selection screen i have a select-options field for which i need to give default values as mentioned below.
Description Data Type Default Value Mandatory? Sel Scrn Type
Delivery/BOL Date ekab-bedat 1st DOM to current day Y Range
The datatype is ekab-bedat.
In the low value field ,it should be 1st Date of month(DOM) and in the high value field it should be current day.
Give me the code for the same asap.>
sreedeep.sreekumar wrote:
> Dont mistake my intensions. When i tried to write it in the form of a request it showed me that it cannot me posted beacuse the words that i am using (please,kindly) is not following the terms and conditions of the words to be written in the threads
Sounds quite vague to me.
>
sreedeep.sreekumar wrote:
> I was asking help for this as i am a novice in SAP-ABAP and i couldnt find solutions for it and also i have seen people directly writing codes for the queries.
Becuase you see people posting pieces of code doesn't mean you can ask for a solution asap. Besides, whether you're new or a veteran in ABAP, what you need can be solved with some very basic knowlegde of ABAP. Just use a bit of common sense. -
Providing Default values to Select-Options in WD ABAP
Dear Experts,
Using reusable component WDR_SELECT_OPTIONS im able to create select-options successfully ... I need your guidance to provide default values(type date) on the same select-options.
Thanks a lot.
Regards
Siva Mandapudi.I do not see the relevance of this thread to FPM. Please follow this thread for your solution.
[Default the value in Parameter in wdr_select_options|Default the value in Parameter in wdr_select_options] -
Default values for Select options
Hi All,
I want to have default values X0 and ND for a select-options field.how can i get the same?
Thanks,
Rakesh.Initialization.
s_akont-low = 'X0'.
s_akont-sign = 'I'.
s_akont-option = 'EQ'.
APPEND s_akont.
s_akont-low = 'ND'.
APPEND s_akont. -
How to set default value in select option for ABAP query
Hi experts,
What is the way to set up default values for select-options in ABAP query.
e.g.
I have one field 'Year' in my ABAP query selection screen.
I want value of current year to be appeared here whenever user execute report
Thanks in Advance
-HarkamalHi Harkamal,
execute your Query via SQ01. On Selection-Screen
goto save Variant. Mark your field
as selection variable an press Button election variable.
Take variable from TVARV and use it.
Than save the Variant.
Look at TVARV if the 'Year' is updated to the actualYear!
regards, Dieter -
Restrict F4 help values for select option
Hi All,
How to restrict the F4 help for select option in Webdynpro for ABAP based on some input.
Regards,
Karthick SHi Karthick,
Use OVS help. It will take your inputs for search and give you corresponding search value list.
Refer my blog, it will be helpful.
[OVS Help in WDA|/people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap]
Thanks. -
Select-options in Webdynpro abap
Hi,
I want to use select options in webdynpro abap ,I checked links available in net but want a simple step by step procedure .
-SandeepHi,
What do you mean by simple steps? You need to write little code to add select options in WDA. You can check this wiki for reference: Web Dynpro ABAP - Complex select-options component usages - Code Gallery - SCN Wiki
And there are lot more documents available in SCN. search here
Regards,
Kiran -
Change dropdown values for a field in webdynpro abap
Hi All ,
I need to change dropdown values for a particular field ( Tax code ) in webdynpro component (FITE_VC_RECEIPTS) when selecting expense type. Right now Tax code values are coming with respect to a company code but i need tax code with respect to other company code for two personel numbers .
How can i change dropdown values for this taxcode in webdynpro abap . Please suggest.
Thanks in advance.
Regards,
Sijin K P.Hi All ,
Thanks for reply .
In production taxcodes are coming fine but wrong in dev and quality . ( Australian taxcodes are coming in production for dropdown values but new zealand tax codes in dev and quality )
I have not started doing any changes . Is there any configuration part to change tax codes that can reflect in expense claim portal . Please help ..
Thanks in advance.
Regards ,
Sijin K P. -
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 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 -
One search help for multiple select-options in webdynpro abap
Hi,
I need a way to use one search help for multiple select-options fields. My scenario is :
I have a table for keeping different organizational units' values of different systems. I have pasted some sample data from this table at the end of this mail. On the screen I want to have 1 select-options filed for werks, and 1 select-options filed for vkorg. (In fact I will have more org. unit fields...) In the beginning of my application the user will select sid.
If the user selects ADS as SID, when he opens search-help for the first org. unit (werks), he will see the records with SID: ADS, VARBL = $WERKS, LANGU = SY-LANGU.
If the user selects AGT as SID, when he opens search-help for the second org. unit (vkorg), he will see the records with SID: AGT, VARBL = $VKORG, LANGU = SY-LANGU.
I have created a search-help taking SIDD, VARBL and LANGU as import parameters; used field mapping and bound this search help to my table. I have created 2 context nodes : org1 and org2 having attributes SID, VARBL, VALUE, LANGU .
I have assigned related SID, VARBL and Langu values to these attributes at runtime as I needed. That way, if I use input field and reference to the related context attributes org1-value and org2-value2 accordingly, search help works well as I want.
However, when I use select-options field , I can not bind the field to the context data. I can give reference only to ddic structure. Is there any way to reference to a context attribute? I searched for this in SDN, but could find nothing.
I think I won't be able to use this way. What do you say?
As I read from forums maybe using OVS help will be suitable for me. But I have to use one search-help for all select-options fields. Do you know how I can determine the active select-options field and pass its name (for instance "werks" ) as parameter to this OVS search help. (Also I'll pass SID and LANGU.)
MY TABLE (ZBYYT080) CONTENTS:
SID VARBL VALUE LANGU VTEXT
ADS $WERKS 1 T Werk 0001
ADS $WERKS 11 T OZYAS GIDA URETIM YERI
ADS $WERKS 5501 T BOYA GEBZE FABRİKASI
ADS $WERKS 5502 T BOYA CIGLI FABRİKASI
AGT $WERKS 2301 T KAMLI DAMIZLIK
AGT $WERKS 9601 T PANAR DENIZ URETIM YERI
ADS $VKORG 22 T AA KİMYASALLAR
ADS $VKORG 8001 T İINSAAT BOYALARI
AGT $VKORG 6500 T DAMk St.Org
AGT $VKORG 5400 T PANAR St.Org.
I wish I'm clear enough..
I will be gald if someone answers me as soon as possible...
Thanks İn advance..
MERALHi,
Your ques is how to refer to a DDIC search help to refer to selection screen parameter ?
Am I right ?
If Yes, then in the interface IF_WD_SELECT_OPTIONS
method ADD_SELECTION_FIELD, ADD_PARAMETER_FIELD etc
have importing param like I_VALUE_HELP_TYPE and I_VALUE_HELP_ID, I_VALUE_HELP_MODE, I_VALUE_HELP_STRUCTURE
etc which may help you to link your create DDIC Search help to selection screen params.
this is just a clue from my side. I haven't tried it myself.
You can go to the where used list of this method and find some sample implementations which use these params.
Hope this helps.
Regards
Manas Dua -
How to pass the low value and high values for select options.
Hi,
In selection screen I want to display the first date, last date of this month as a default value in low and high fields. Please exaplain me how.
Thanks and Regards,
SuryahI,
Very thanks ,
I did it what u said now. but those contents does not displaying on the screen.
In this order I write the code. Please explain me
SELECT-OPTIONS s_date FOR likp-wadat_ist.
DATA BEGIN TYPE wadat_ist.
DATA LAST TYPE wadat_ist.
initialization.
s_date-low = BEGIN.
s_date-high = LAST.
at selection-screen output.
CALL FUNCTION 'HRWPC_BL_DATES_MONTH_INTERVAL'
EXPORTING
datum = SY-DATUM
month_pst = '0'
month_ftr = '0'
IMPORTING
BEGDA = BEGIN
ENDDA = LAST
EXCEPTIONS
INVALID_VALUES = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Maybe you are looking for
-
I'm trying to have my display go to my 26" Vizio tv. However, when everything is plugged in, the display isn't showing up on the TV. Any Help?
-
Hi, I can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action. I can access CRM with same user id and password from our office inside the network. I can get th
-
How do I save a Pages doc to my desktop folders?
Hi, I'm new to Mac and Pages and want to save a document to a folder on my desktop. But I don't have Save As as an option in File. I appear to be able to save only to iCloud or Documents essentially. Any suggestions?
-
ITunes 9/iPod OS 3.1.1 combo has too many issues/bugs
After upgrading to iTunes 9 and Touch to 3.1.1 I am having too many issues: iPOD TOUCH: 1. Everytime I launch music, it displays "upgrading library" message and takes eons (5 minutes) to show the library 2. Playlists don't work: most playlists show t
-
Lost all my phone numbers in my iphone 4 and my iclod account was without any numbers. how can i get my contacts back?