Dynamic modification of select options using JSP
Is there any way other than reloading the page for the selection of one dropdown to dynamically change the contents of another dropdown?
ie selecting United States in one drop down will change another dropdown to list all the states
No there are ways of doing it using javascript. Basically it works like this:
1) load all data that can appear in the second select box in a large array
2) the value of the first select box is an index into that array
3) in the onchange of the first select box, clear the second select box and fill it with new options that you take from the array. Use the value from the first selectbox as the index into that array.
Check this url:
http://www.quirksmode.org/js/options.html
Similar Messages
-
Dynamic select-options using parameter
Hi experts,
It the user selects one value from dropdown list, it should generate one select-option using that name. Is it possible?
for example, (pls see my code).
If user selects 'Malek' from parameter, <b>and press 'ENTER'</b>
<b>select-option should display with that name</b> like
Malek malek-low malek-high
And if user selects some other like 'Amran'. It should generate(and append)
Malek malek-low malek-high
amran amran-low amran-high
and so on....
report c.
data: t_return like ddshretval occurs 0 with header line.
data: begin of t_names occurs 0,
name like usr01-bname,
end of t_names.
parameters : i_inspec like usr01-bname.
at selection-screen on value-request for i_inspec.
perform get_names.
form get_names.
t_names-name = 'Malek'.
append t_names.
t_names-name = 'Amran'.
append t_names.
t_names-name = 'Ow CC'.
append t_names.
t_names-name = 'titbit'.
append t_names.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'T_NAMES-NAME'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'I_INSPEC'
value_org = 'S'
tables
value_tab = t_names.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno with
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
read table t_return index 1.
endform. "GET_NAMES
Reward guaranteed,
thanks
kakiUse At selection-screen output,use screen internal table..
User Dynamic Selection
at selection-screen output.
select single * from t000md.
loop at screen.
case screen-group1.
when 'REL'.
if not p_old is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'BEL'.
if not p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'ARB'.
if p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
when 'MTA'.
if p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
endcase.
endloop. -
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,
SheebaHi 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. -
Select options using OVS empty
Hi all,
I have created a select options dynamically using OVS.
If the output table is empty my OVS appears empty and i don't want that this appears.
The search help must appear only when the output table is not empty.
How do i solve this?
ThanksHi.
My problem has not been repair.
There is no way to disable an OVS at runtime.
See:
cancelling an OVS help?
Thanks a lot. -
Dynamical declaration of SELECT-OPTIONS / RANGE possible
Hi fellow programmers,
does anybody know whether there is a way to declare a
SELECT-OPTION respectively a RANGE dynamically during
runtime? I have both the name of the range to be created
and the DDIC-referencefield stored in variables.
Thanks in advance for your appreciated help.
AndreasHi Andreas,
DYNAMIC PROGAM SHOWS SELECTION-SCREEN.
1 Sap does not allow execution of dynamic programs from memory.
(dynamic means, only in memory, not in database)
2. However, it allows execution of dynamic FORM/ENDFORM.
3. But your requirement is of selection-screen using parameters and select-options.
4. Hence, we can use the concept of DYNAMIC PROGRAM
(build the program code in an internal table)
using command
INSERT REPORT 'ZDYN01' FROM itab.
THIS WILL SAVE / OVERWRITE THE PRGRAM IN DB.
HENCE, BE CAUTIOUS.
5. Just Copy/Paste this sample program
It will generate a dynamic program called ZDYN01.
it will also execute it and
SHOW SELECTION-SCREEN
of the DYNAMIC PROGRAM.
6. You may build up yuour own logic
of constructing selection-screen from
required data stored in tables.
7.
REPORT abc.
Data
DATA : BEGIN OF itab OCCURS 0,
l(72) TYPE c,
END OF itab.
DATA : prog(8) TYPE c.
Make Dynamic Program
CLEAR itab.
itab-l = 'REPORT ABC.'.
APPEND itab.
itab-l = 'PARAMETERS : MATNR LIKE MARA-MATNR.'.
APPEND itab.
itab-l = 'START-OF-SELECTION.'. APPEND itab.
itab-l = 'WRITE :/ MATNR.'. APPEND itab.
Generate Program
INSERT REPORT 'ZDYN01' FROM itab.
COMMIT WORK. "----- COMMIT NECESSARY FOR DB
*------ Call Report
SUBMIT zdyn01 VIA SELECTION-SCREEN.
HOPE THE ABOVE HELPS.
Regards,
Amit M. -
Help on Dynamic values in select options
Hi All,
I need help for the following.
1. I have two select options for fields VBAK-VBELN and VBAK-ERDAT one after the other.
2. When I select VBELN through F4 in the first select option then the corresponding ERDAT should be displayed in second select option.
Please let me know how to do thisUse the below code
tables: pa0000, pa0001.
parameters: p_chk1 as checkbox user-command rusr,
p_chk2 as checkbox user-command rusr,
p_chk3 as checkbox user-command rusr,
p_chk4 as checkbox user-command rusr,
p_chk5 as checkbox user-command rusr.
selection-screen: begin of block blk1 with frame.
select-options: s_pernr for pa0000-pernr modif id ABC,
s_stat2 for pa0000-stat2 modif id DEF,
s_werks for pa0001-werks modif id GHI,
s_persg for pa0001-persg modif id JKL,
s_persk for pa0001-persk modif id MNO.
selection-screen: end of block blk1.
AT SELECTION-SCREEN output.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
IF p_chk1 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'DEF'.
IF p_chk2 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'GHI'.
IF p_chk3 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'JKL'.
IF p_chk4 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'MNO'.
IF p_chk5 = 'X'.
SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*Note
*Titles for check boxes and select options
*P_CHK1 Personal Number
*P_CHK2 Employment Status
*P_CHK3 Personnel Area
*P_CHK4 Employee Group
*P_CHK5 Employee Sub group
*S_PERNR Personal Number
*S_PERSG Employee Group
*S_PERSK Employee Sub group
*S_STAT2 Employment Status
*S_WERKS Personnel Area -
Select Options use in ALV Report in ABAP Webdynpro
Hello Experts,
I Already Done ALV Report In webdynpro with use of view Container UI element.But i do not know ALV report with help of select option.so
Kindly Give Me simple Example of Use in select Option In ALV.
Reply ASAP.
Regards,
Ameya KaradkhedkarFirst you need to add the component WDR_SELECT_OPTIONS to the tab "Used components" of your Web Dynpro component and then also in the properties tab of your view. In the layout you need to create another view container and embed the view WND_SELECTION_SCREEN of the new used component to it.
Then in the WDDOINIT method of your view you can write this code (where SEL_OPT is the given name for the used component) in order to set the select option (This example is a select option for a date):
DATA: lo_cmp_usage TYPE REF TO if_wd_component_usage,
lo_interfacecontroller TYPE REF TO iwci_wdr_select_options,
lo_r_helper_class TYPE REF TO if_wd_select_options,
rt_range_date TYPE REF TO data.
* Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)
lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
* Call method in used controller
lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).
lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).
* Create select option for the date
CALL METHOD lo_r_helper_class->create_range_table
EXPORTING
i_typename = 'DATS'
RECEIVING
rt_range_table = rt_range_date.
CALL METHOD lo_r_helper_class->add_selection_field
EXPORTING
i_id = 'DATS'
it_result = rt_range_date
i_read_only = ABAP_FALSE.
* Hide unnecessary buttons
CALL METHOD lo_r_helper_class->set_global_options
EXPORTING
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_false
i_display_btn_execute = abap_false.
Finally you need to write the following code in the action of the button in order to fetch the range table selected by the user.
DATA: lo_cmp_usage TYPE REF TO if_wd_component_usage,
lo_interfacecontroller TYPE REF TO iwci_wdr_select_options,
lo_r_helper_class TYPE REF TO if_wd_select_options,
rt_date TYPE REF TO data.
FIELD-SYMBOLS: <fs_date> TYPE table.
* Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)
lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
* Call method in used controller
lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).
lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).
* get selected range of inspections date
CALL METHOD lo_r_helper_class->get_range_table_of_sel_field
EXPORTING
i_id = 'DATS'
RECEIVING
rt_range_table = rt_date.
ASSIGN rt_date->* TO <fs_date>.
Then you can use the value that is assigned to the field symbol <fs_date> to continue with your ALV. -
SELECT OPTIONS use in select statement
hi,
I have defined my selection screen in the main program.
selection-screen begin of screen 0101 as subscreen.
selection-screen begin of block b1.
select-options: S_KUNNR for KNA1-KUNNR,
selection-screen end of block b1.
selection-screen end of screen 0101.
then in an include in the same module pool, i try to use this in select statement
SELECT * INTO CORRESPONDING FIELDS OF XXX FROM ZPPP WHERE KUNNR IN S_KUNNR.
I get an error saying " the IN operator with S_KUNNR is neither followed by an internal table nor by a valuelist "..what does this mean ?
thksCheck the sample code...
REPORT ztest_mod.
DATA: kunnr TYPE kunnr.
* Custom Selection Screen 0200
SELECTION-SCREEN BEGIN OF SCREEN 0200 AS SUBSCREEN.
SELECT-OPTIONS: s_kunnr FOR kunnr.
SELECTION-SCREEN END OF SCREEN 0200.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_kunnr-low.
BREAK-POINT.
START-OF-SELECTION.
"in this screen i have a button with function code 'SEARCH'
" and a subscreen area with name sub
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
ENDMODULE. "status_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
DATA: it_kunnr TYPE TABLE OF kna1.
CASE sy-ucomm.
WHEN 'SEARCH'.
SELECT * FROM kna1
INTO TABLE it_kunnr
WHERE kunnr IN s_kunnr.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. "user_command_0100 INPUT
in the flow logic..
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN sub INCLUDING sy-repid '0200'.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Regards
Vijay Babu Dudla -
I need to pass multiple select options using submit and reutrn
dear all,
my requirement is i need to pass multiple values for work center like(biw01,biw02,biw03 etc) for this iam giving as biwl* and biot* for the tcode zpp_hmm ,using this i am going to get total working hours of perticular equiment.
for this iam using submit and return query but iam unable to pass multiple work centers as input.
my code is
DATA : z_budat TYPE RANGE OF budat,
wa_budat LIKE LINE OF z_budat.
wa_budat-low = '20111001'.
wa_budat-sign = 'I'.
wa_budat-option = 'BT'.
wa_budat-high = '20111031'.
APPEND wa_budat TO z_budat.
CLEAR wa_budat.
*wa_budat-High = '20111031'.
*wa_budat-sign = 'I'.
*wa_budat-option = 'BT'.
*append wa_budat to z_budat.
DATA : z_arbpl TYPE RANGE OF arbpl,
wa_arbpl LIKE LINE OF z_arbpl.
wa_arbpl-low = 'BIWL*'.
wa_arbpl-sign = 'I'.
wa_arbpl-option = 'EQ'.
APPEND wa_arbpl TO z_arbpl.
CLEAR wa_arbpl.
wa_arbpl-high = 'BIOT'.
*wa_arbpl-sign = 'I'.
*wa_arbpl-option = 'BT'.
*APPEND wa_arbpl TO z_arbpl.
SUBMIT zpp_rep_hemm_perf WITH s_bukrs = '1004' WITH s_budat IN z_budat WITH s_werks = 'SMJT'
with S_ARBPL IN Z_ARBPL USING SELECTION-SCREEN '1000' AND RETURN.
but my doubt is whether it is corect or wrong what ever i am passing inputs for arbpl.
thanks in advance.You can pass all parameter (rsparams-kind = 'P') and select-options (rsparams-kind = 'S') as a single internal table of type RSPARAMS. Go on appending the field names and values as rows and pass using SELECTION-TABLE parameter of SUBMIT command.
I gave appending one set of selection values for s_budat field but you can go on appending more values for s_budat and other fields.
DATA: lt_rsparams TYPE TABLE OF rsparams,
ls_rsparams TYPE rsparams.
CLEAR ls_rsparams.
ls_rsparams-selname = 'S_BUDAT'.
ls_rsparams-kind = 'S'.
ls_rsparams-sign = 'I'.
ls_rsparams-option = 'BT'.
ls_rsparams-low = '20111001'.
ls_rsparams-high = '20111031'.
APPEND ls_rsparams TO lt_rsparams.
SUBMIT zpp_rep_hemm_perf WITH SELECTION-TABLE lt_rsparams
USING SELECTION-SCREEN '1000'
AND RETURN. -
Hi,
I have two Select-Options for Kunnr and Bukrs.
My requirement is that,
when I select a particualar Kunnr in the Select Option the Corresponding Bukrs must appear in the F4 for the S_BUKRS.
Can someone help please.
Thanks,
Supriya Manik.You might have to code a search help exit to achieve this purpose.
In the KUNNR search help, have the exit export the selected value to parameter ID KUN.
Then, from the BUKRS search help, read this value and pass it to the KUNNR field in the F4.
You can find more info on search help exits at:
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm
Hope this helps.
Sudha -
Dynamic Values for Select Option
Hi,
My requirement is that i have to set
yesterday for the low range of select option
and today for the high range.
I tried the selection variables and found that
only low range can be specified in the
selection variable.
Thanks,
SivaHi,
You mean default display variant.
Then try this.
data w_variant TYPE disvariant.
PARAMETERS P_LAYOUT LIKE DISVARIANT-VARIANT.
INITIALIZATION.
*Get Default display variant
PERFORM F100_DISPLAY_DEFAULT_VARIANTS.
FORM f100_display_default_variants.
w_variant-report = sy-repid.
w_variant-handle = c_handle.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = w_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc EQ 0.
p_layout = w_variant-variant.
ENDIF.
ENDFORM. -
Dynamic SQL for selection-option???
Hi,
I am trying to select a table from the parameters (range ) , but every time i run it give me a dump witn error in where ...(itab)
First i declare :
data : cond(72) TYPE C,
itab LIKE TABLE OF cond .
select-options: p_auart FOR vbak-auart ,
p_vkorg FOR vbak-vkorg.
--->
If not p_auart is initial.
cond = 'auart IN p_auart' .
APPEND cond To itab.
endif.
the i do select:
Select * from vbak where (itab).
---> I give a dum in where clause....
So could you please help me out of this
ThanksHi Friend,
Make the following corrections.Your code will work fine.
By the statement- 'itab LIKE TABLE OF cond .' you meant to create a table of the type 'COND' which should be a structure.
So, here lies the problem.In your case COND is a char type variable and you are trying to mimic the table 'itab' from it.
As a rule of thumb,a table should mimic a std., table or a structure.
So remove the following lines:
data : cond(72) TYPE C,
itab LIKE TABLE OF cond .
Include the following lines:
type: begin og itab_record,
cond(72) TYPE C,
end of itab_record."Declaration of structure itab_record.
data: itab type standard table of itab_record initial size 0 with header line."Declaration of the table itab which mimics the structure itab_record.
Modify these two statements,
cond = 'auart IN p_auart' .
APPEND cond To itab.
to
itab_record-cond = 'auart IN p_auart' .
append itab_record.
Other lines are exact,make these changes,execute it and seek my assistance if necessary.
Regards,
Lakshmanan -
Create select-options using internal table
Hello,
I have number of table-fields in one internal table.
I need to create select-options on screen for each of the table field in that internal table.
Can anybody please provide a code for it ?
Thanks.hi,
you can create in this way :
select-options: <name> for itab-<field name>.
example code:
TABLES: vbak. " standard table
TYPE-POOLS: slis.
*-- Structure to hold data from table
TYPES: BEGIN OF tp_itab1,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
werks LIKE vbap-werks,
lgort LIKE vbap-lgort,
END OF tp_itab1.
*-- Data Declaration
DATA: t_itab1 TYPE TABLE OF tp_itab1.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
* Selection Screen *
*--Sales document-block
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
s_posnr FOR vbap-posnr,
s_werks FOR vbap-werks,
s_lgort FOR vbap-lgort.*
SELECTION-SCREEN END OF BLOCK b1.
hope it will help you
regards
Rahul sharma
Edited by: RAHUL SHARMA on Sep 19, 2008 8:25 AM -
Dynamic retrieval in list boxes using JSP
Dear All,
I have a list box in a form which is created by extracting data from oracle database. There are approximately 26000 records which are added dynamically in the list box. There are five rows in the form and each row has to have a list box with all records. Now if i retrieve all records for all list boxes, the page takes high time to load. I also tried using String array to read once and write them using loops in list box. But even then the loading time is quiet high. Is there some better way so that the page loads fast enough. I am using Oracle Database and the table is indexed.
Thanks & Regards,
Gagan AroraWell, it's big enough to make any page slow... but you can try to load all the list boxes in the client side with javascript.
i make that usually, create a javascript strings array and on the "onLoad" event fill all the list boxes with the values in that array.
but anyway is too much data. -
Dears,
I used select statement like
select rnn
pucustctycode
into table gt_zgrrnnh
from zgrrnnh
where rnn in s_rnn
and lrcdate gt gv_update
and deleteind eq space.
and
select rnn
pucustctycode
appending table gt_zgrrnnh
from zgrrnnh
where rnn in s_rnn
and lrcdate eq gv_update
and lrctime gt gv_uptime
and deleteind eq space.
in my program. and now i want to combinate them using just one select.
and the different select conditions is lrdate and lrtime. and the firest selections has no limit to lrtime, but just limit to lrdate.
Anyone could help me how to use select ............when ..........(...........or............)?
Thanks a lot.
Julie.Change your select query like this:
Select time also, u have to change your internal table Strucutre.
SELECT rnn
pucustctycode
lrctime
INTO TABLE gt_zgrrnnh
FROM zgrrnnh
WHERE rnn IN s_rnn
AND lrcdate GE gv_update
AND deleteind EQ space.
from this you will all the data irrespective of time , but you have time field in your internal table .
Now Loop at your internal table and delete those records whoes LRCTIME is less than GV_UPTIME.
This is one way, i am sure there can be many ways to do this.
One has to keep trying...
Let me know ,if you face further issue..
Regards,
Mayank
Maybe you are looking for
-
Microsoft exchange no longer works with ipad and iphone
Have the new ipad and iphone 4. Software 6.1.3. Since two days email and calender are no longer synchronised and it is impossible to send email. We use microsoft exchange server and Outlook. Up till 2 days ago all worked perfectly and settings have
-
How to configure the Business Systems & Technical Systems into PI 7.0
Dear All Kindly let me know how to configure the Business Systems and Technical Systems into PI 7.0 any word document/PDF would be very helpful. Regards Blue
-
Invalid Web Address in WAP application
Hi all I have made a WAP application. A user will create his account with user id and password. But when i click register link , An error "*Invalid Web Address*" comes. I have checked that in url there is no special character. Application is running
-
I cannot print a 4 X 6 photo in Elements 12 but can in 11. I just bought a new printer but I do not think it is the printers problem. Any help would be appreciated
-
MAC OS X 6.0.7. & Win XP + Office
I just picked up the macbook pro- my first mac. I understand parallel should work nicely with XP (hopefully). So, I picked up XP. I will be transferring (hopefully) files from an old PC running Win 98 (not 98SE) with Office 2000. Should I attempt to