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 this
Use 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
Similar Messages
-
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. -
How to get the values of Select-options from the screen.
The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.
Hi,
Refer this following code..this will solve your problem...
"Following code reads value entered in s_po select options and willprovide search
"help for s_item depending upon s_po value.
REPORT TEST.
TABLES : ekpo.
DATA: BEGIN OF itab OCCURS 0,
ebelp LIKE ekpo-ebelp,
END OF itab.
SELECT-OPTIONS s_po FOR ekpo-ebeln.
SELECT-OPTIONS s_item FOR ekpo-ebelp.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
DATA:
dyn_field TYPE dynpread,
temp_fields TYPE TABLE OF dynpread,
zlv_dynpro TYPE syst-repid.
zlv_dynpro = syst-repid.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = zlv_dynpro
dynumb = syst-dynnr
request = 'A'
TABLES
dynpfields = temp_fields
EXCEPTIONS
OTHERS = 0.
LOOP AT temp_fields INTO dyn_field.
IF dyn_field-fieldname EQ 'S_PO-LOW'.
SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
WHERE ebeln EQ dyn_field-fieldvalue.
EXIT.
ENDIF.
ENDLOOP. -
Getting values from select option
Hi,
I have a requirement where the user is going to pass values in select-option in low and high. lets say s_bwart(movement types).
now i have to fetch this bwart values into an internal table.
my internal table will be having only one field that is bwart. so how do i populate my internal table with those values. could any body help me in this.
Thanks in advance
nehaHi, when using SELECT-OPTIONS, use can pretty much do any kind of selection he wants, including ranges, and excluding values, so the best way to handle it is to select from the data base when the user executes the report. for example.
data: begin of ibwart occurs 0,
bwart type mseg-bwart,
end of ibwart.
select-options: s_Bwart for mseg-bwart.
start-of-selection.
select bwart into table ibwart
from <b>T156</b>
where bwart in s_bwart.
Regards,
Rich Heilman -
How to Captured Value into Select-Options Range Table Without "Enter"
Hi,
I defined a set of Select-Options in the Web Dynpro. I found that the value for the Select-Options will not be captured whenever I manually type in the value instead of choosing it from F4 Help Drop Down.
However, this problem can be resolved if I manually type in the value for Select-Options in the Selection Field and I press "Enter". Without pressing "Enter" value will not be captured.
Any solution for this issue? Please help.Hi Kris,
My problem is only when the user key in the value themselves rather than choosing it from Select-Options drop down value. Most of the time user will know what value to key in and will skip the step to choose from the Drop Down List. Thus, if this happen, the value keyed in by the user will not be able to capture into the range table.
I am using this logic to capture the value for selection item:
wd_this->m_helper->get_selection_screen_items(
IMPORTING et_selection_screen_items = lt_sel_item ).
* Values From Selection Screen
LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
CASE <fs_sel_item>-m_id.
WHEN `PERNR`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_pernr>.
WHEN `BUKRS`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_bukrs>.
WHEN `STAT2`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_stat2>.
WHEN `WERKS`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_werks>.
WHEN `BTRTL`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_btrtl>.
WHEN `PERSG`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persg>.
WHEN `PERSK`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persk>.
WHEN `ABKRS`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_abkrs>.
WHEN `BEGDA`.
ASSIGN <fs_sel_item>-m_value->* TO <fs_begda>.
ENDCASE.
ENDLOOP.
E.g. User key in the BUKRS without using the Drop Down Value provided by the Select-Options. For this case, <fs_bukrs> table will be initial as no value is captured.
Edited by: Girish Nabar on Apr 21, 2011 8:55 AM -
Passing value to select options screen.
Hi All,
Can anybody help me how to pass a value to select option screen from another screen?
It's like a user enters a value in a input field and press a button to navigate to the next screen which contains the select option fields.How can i show the value enterd in the previous screen to be shown in one of teh input field in the select option screen.Hi,
Store the values that you have to pass in a global variable declared in component controller and
Use the following piece of code in the second view,
DATA: lt_range_table TYPE REF TO data,
rt_range_table TYPE REF TO data,
read_only TYPE abap_bool,
typename TYPE string.
* create a range table that consists of this new data element
lt_range_table = lo_r_helper_class->create_range_table( i_typename = 'MATNR' ).
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'. "Default sign which you want to give
<option> = 'EQ'. "Default option you want to give
<low> = 'M-01'." pass your valriable name here
*<high> = 'High_value'.
* add a new field to the selection
lo_r_helper_class->add_selection_field( i_id = 'S_MATNR'
i_description = 'Material'
it_result = lt_range_table ).
Regards,
Radhika. -
Difference between Multiple single values and Selection option variables
Hi !
Can any one tell me the difference between variable types:
Multiple single values and Selection option?
I used each one of them for selecting values for a characteristic but could not notice a difference in choosing values.
Is there some difference in functionality or can they be used interchageably?
Regards,
Sri HarshaHarsha,
When you go for slection option, in the variable input screen you will be having a button in the last where you can give your slections. There you can maintain either multiple single values and Multiple intervals or else not equal to also..
Just check out there... you will be having tabs for each..
Assign Points if it helps
Gattu -
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 -
Values of select-option in various variants
Hi all,
does anybody know a report to determine the values of a specific select-option in various variants of a program?
I know the function module RS_VARIANT_CONTENTS to get the values of select-options in one variant of a program (TABLES-parameter VALUTAB), but I need it for many variants (like a prgram which calls the function module for all variants of a program).
Does anybody know a possibility?
Thanks
DanielYou will probably have to write your own code for this. You could still check the where-used-list of RS_VARIANT_CONTENTS (or related function modules in the same function group) to see if there is any available standard program for your purpose.
If you find one, please let us know here in this thread.
Thomas -
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 -
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 -
How to pass values to select options of custom transactions?
I have to call custom transaction-ZMM_POST from my custom report.
I have to pass values to select options(Not to parameters) of ZMM_POST from my report only.
Please tell me how to pass values to select options of custom transactions?Have you tried this?
DATA: T_RSPARAMS TYPE STANDARD TABLE OF RSPARAMS WITH HEADER LINE.
T_RSPARAMS-SELNAME = "S_BUKRS".
T_RSPARAMS-KIND = "S".
T_RSPARAMS-SIGN = "I".
T_RSPARAMS-OPTION = "BT".
T_RSPARAMS-LOW = "100".
T_RSPARAMS-HIGH = "300"
APPEND T_RSPARAMS.
SUBMIT Z_DUMMY WITH SELECTION-TABLE T_RSPARAMS.
Greetings,
Blag. -
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. -
Issue when reading values of Select-options for Dynamic F4
Hi All,
I have provided dynamic F4 help on class name (ESTCAT) and characteristic name (ATNAM). Both are select options with no intervals. The class name should be entered to get the F4 help for characteristic name, else an message would appear to select a class name first. My message is coming when i press F4 on characteristic name without giving any class name. This is correct but if i enter the class name after this message and do an F4 for characteristic name, it still shows the same message which is not correct. The reason is the class name entered is not captured in the FM RS_REFRESH_FROM_SELECTOPTIONS output table and it is captured only if i hit enter after entering the class name.
Is it possible to get the class name in the FM output without hitting enter or any other way to resolve this issue?
Thanks in advance,
Srilakshmi.In Flow Logic
PROCESS ON VALUE-REQUEST.
FIELD itab-connid MODULE f4_get.
In Program
MODULE f4_get INPUT.
DATA : fnam TYPE string,
fval TYPE string.
* lin TYPE i.
DATA : BEGIN OF f4_tab OCCURS 0,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
END OF f4_tab.
CLEAR lin.
GET CURSOR FIELD fnam VALUE fval LINE lin. " This gives the Current Line in Table Control
DATA : dynpread TYPE TABLE OF dynpread WITH HEADER LINE.
REFRESH dynpread.
CLEAR dynpread.
dynpread-fieldname = 'ITAB-CARRID'.
dynpread-stepl = lin. " You need to pass this line Value here
APPEND dynpread.
CLEAR dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11
IF sy-subrc IS INITIAL.
READ TABLE dynpread WITH KEY fieldname = 'ITAB-CARRID'.
IF sy-subrc IS INITIAL.
SELECT carrid connid FROM sflight
INTO TABLE f4_tab
WHERE carrid = dynpread-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'ITAB-CONNID'
value_org = 'S'
TABLES
value_tab = f4_tab
ENDIF.
ENDIF.
ENDMODULE. " f4_get INPUT
Regards
Surendra P
Maybe you are looking for
-
How to return a message in a boolean method?
I am looking to return a message other than true or false using a boolean method. Is that possible to do without displaying the true, or false? private boolean search(Node node, int id){ if (node == null) return false;
-
Time and date on the laptop is not in accordance with the current.
1. Product Name and Number HP G42-360TX 2. Operating System installed (if applicable) Windows 7 64-bit 3. Error message (if any) Time and date on the laptop is not in accordance with the current 4. Any changes made to your system before the issue occ
-
What could cause an object to have a gray box print behind an object? I use IDcs2. When I design a page and print as an eps, then distill to pdf, I notice a gray-hazy box that appears behind objects. Most of the time the objects are non-filled boxes
-
Screen resolution changed only in the browser after update of version 9.0.1 how do I change it back?
-
I set up her device with a unique id for her. In case if it is lost or stolen, would like to locate quickly.