Remove screen values for select options after report runs
I have a report that runs and when it is finished there is garbage in 3 select-option fields. I put it there because i want the report to run if the field is blank. here is a sample of that code.
IF SO_APS = ' '.
SO_APS = 'IEQn'.
APPEND SO_APS.
ENDIF.
what happens is that there is an displayed after the report is finished, and I don't want to confuse the end users.
You can try clearing it as the last statement.
clear SP_APS. Refresh SO_APS.
If that doesn't work, then try FREE MEMORY as the last executable statement.
Regards,
Rich Heilman
Similar Messages
-
Empty selection options after report run
Hi,
After the execution of my abap report sap returns to the selection options screen in which all the selected values from the run are still mentioned. How can i refresh the selection screen (so no values in the selection options after the report run) ?
this is the code (all parameters as you can see) :
parameters : p_matnr like mara-matnr default ''.
parameters : p_werks like mard-werks default 'XYZ',
p_lgort like mard-lgort default ''.
selection-screen skip 1.
parameters : p_qty like sy-tabix default 1.
selection-screen skip 1.
parameters : p_file like RLGRAP-FILENAME memory id GXD.
with regardshi
i tried for select-options try for parameters
at selection-screen .
if sy-ucomm = 'ONLI'. " Only when execute is pressed
v_low = s_kunnr-low.
v_high = s_kunnr-high . " Hang on to this for select statement
clear s_kunnr[].
clear s_kunnr. " Clear the screen parameter
endif.
for your program
data : matnr like mara-matnr, " variables are taken so that we can have the values for further operations
werks like mard-werks,
lgort like mard-lgort,
qty like sy-tabix,
file like RLGRAP-FILENAME.
at selection-screen.
if sy-ucomm = 'ONLI'. " Only when execute is pressed
matnr = p_matnr.
clear p_matnr.
werks = p_werks.
clear p_werks.
lgort = p_lgort.
clear p_lgort.
qty = p_qty.
clear p_qty.
file = p_file.
clear p_file.
endif.
start-of-selection. " write what ever code you have for the start-of-selection
NOTE "Remove the memory id for p_file otherwise it will not be cleared
regards
prasanth -
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 -
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. -
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. -
Read Screen values in Select options
Hi Experts,
I am using FM 'DYNP_VALUES_READ' for reading the Screen values. The problem is, this FM runs fine for parameters where single value is returned but in case of Select-options where i have ranges, How to use this FM?
Help will be appreciated
Regards
SourabhHi ,
Thanks for your valuable inputs.
I have acheived my requirements with FM 'DYNP_VALUES_READ' itself.
Here is how i have acheived this. I have passed both LOW and HIGH in the internal table it_fieldvalues.As a result i got both the values of the ranges.
REFRESH it_fieldvalues.
it_fieldvalues-fieldname = 'S_AEDAT-LOW'.
APPEND it_fieldvalues.
CLEAR it_fieldvalues.
it_fieldvalues-fieldname = 'S_AEDAT-HIGH'.
APPEND it_fieldvalues.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TRANSLATE_TO_UPPER = 'X'
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
TABLES
dynpfields = it_fieldvalues
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Sourabh -
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. -
Setting screen attributes for select-option in subscreen
Hello SDN Community, I have researched this extensively in forums and found much helpful information in getting the select-option working in a subscreen. Also found information that discussed using standard AT SELECTION-SCREEN statements to process the sub-screen with.
I encountered problems when that from the LOOP AT SCREEN within the AT SELECTION-SCREEN OUTPUT, I set the INPUT/OUPUT attributes to zero, the field was still open for input when it displayed. For when I do this on other fields of my screen, they are "greyed out".
Has anyone any experience setting field attributes from within loop at screen for embedded select-option subscreen? Would appreciate any insight you might have.
Thank you,
Dean Atteberry.
P.S.- I put this thru the debugger and I can see the INPUT and OUTPUT attributes getting changed. But when displays, it is like the change didn't happen.
Full description of my processing below...
I have a screen with four radio-buttons. Under the first radio-button is my embedded subscreen with one SELECT-OPTION for AUFNR. Under the other three radio-buttons are single fields declared regular way in main screen.
In my PBO of main screen I have loop at screen that enables/disables INPUT and OUPTUT attributes based on which radio-button is selected. This prevents confusion from user entering values in fields other than the one the radio-button is selected for.
For my embedded select-option subscreen, I have an AT SELECTION-SCREEN OUTPUT statement in which I have a LOOP AT SCREEN. Within that, based on radio-buttons, I either enable or disable the INPUT and OUTPUT attributes for the S_AUFNR-LOW and S_AUFNR-HIGH fields.
Edited by: Dean Atteberry on Mar 25, 2009 4:39 PM>> I think that you are trying to change select options within main screen, whereby it should be
>> changed in PBO of that subscreen. You said you do it in AT SELECTION-SCRREN OUTPUT which
>> will be only applicable for selection screen (I guess your main screen here). Do loop at screen in
>> PBO module of this subscreen not in PBO of the selection screen and see if that helps.
Hi Marcin, thank you for your reply. My "main screen" is not my "selection screen". Please allow me to further clarify...
My "main screen" has four radio buttons with a subscreen area under the first one and single fields under the others.
My "subscreen" is auto-generated by Selection-Screen and Select-Options statements which are in my TOP module.
I call my auto-generated select-option subscreen in my PBO with...
call subscreen sca_ordr including sy-repid scr_0121.
and in my PAI with...
call subscreen sca_ordr.
In order to do LOOP AT SCREEN for my system-generated select-option subscreen, I use the AT SELECTION-SCREEN OUTPUT event in which to put my loop.
When I walk thru this in the debugger, I can see it setting INPUT/OUTPUT fields to zero, but when the screen displays, there are no changes to my subscreen.... Fields should be "greyed out" instead they are open for intput.
Doing my best to accurately describe in as few words as possible. Thank you for your ideas!
Dean. -
Keep previous values for Select-Options
I am using macros to populate my selections with the previously entered values. Everything works fine until I want to delete the previous selections for so_snp via the Trash Can button. The selections come back. The issue seems to be that the selections are deleted from the so_snp range but then the AT SELECTION-SCREEN OUTPUT executes makro_get_range which re-populates the so_snp selection from the data stored in the buffer because so_snp is initial. How do I get the AT SELECTION-SCREEN code to execute first so that the makro_set_range can clear out the shared buffer for '/SAPAPO/PT_PLAN_SNP'. I have included excerpts from my ABAP program.
Any help would be appreciated. I struggled with this all day long.
Best regards,
Sandy
DEFINE makro_get_range.
initialization
clear:
lv_line,
lv_key.
import SET/GET-parameter from shared buffer
if &2[] is initial.
concatenate sy-uname &1 '_T' into lv_key.
import &2[] from shared buffer indx(st) id lv_key.
if sy-subrc eq 0.
read table &2 index 1.
endif.
endif.
if &2 is initial.
get parameter id &1 field &2.
if sy-subrc ne 0 and &2 is initial.
refresh &2[].
endif.
if not &2 is initial
and &2[] is initial.
append &2.
endif.
endif.
END-OF-DEFINITION.
DEFINE makro_set_range.
initialization
clear:
lv_line,
lv_key.
concatenate sy-uname &1 '_T' into lv_key.
export SET/GET-parameter to shared buffer
describe table &2[] lines lv_line.
if lv_line gt 1.
export &2[] to shared buffer indx(st) id lv_key.
else.
delete from shared buffer indx(st) id lv_key.
set parameter id &1 field &2.
endif.
END-OF-DEFINITION.
SELECT-OPTIONS so_snp FOR /sapapo/matloc-planner_snp.
AT SELECTION-SCREEN OUTPUT.
makro_get_range '/SAPAPO/PT_PLAN_SNP' so_snp.
AT SELECTION-SCREEN.
makro_set_range '/SAPAPO/PT_PLAN_SNP' so_snp.Can you set a flag to indicate that it needs to be done only once like below?
AT SELECTION-SCREEN OUTPUT.
IF v_flag_get_done_once IS INITIAL.
*-- get the values from the shared buffer
makro_get_range '/SAPAPO/PT_PLAN_SNP' so_snp.
v_flag_get_done_once = 'X'.
ELSE.
*-- user manipulated the selection screen values, so
* don't do it again. Do Nothing.
ENDIF.
Srinivas -
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. -
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. -
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. -
Input Negative values in selection screen for select-options field
I am not able enter negative values for
SELECT-OPTIONS V_ERFMG FOR MSEG-ERFMG.
It says negative values are not allowed but I need to check for negative values. Kindly provide me solution.You can't put the negative values here...because the Domain which is attached to MSEG-ERFMG has not the "Sign" checkbox on.
Try with this code:
tables:wbrp.
SELECT-OPTIONS V_ERFMG FOR WBRP-menge.
Regards,
Naimesh Patel
Maybe you are looking for
-
Videos keep downloading even after closing Firefox.
Hello, I just signed in because I have a weird issue, so this is my first post here: Recently I noticed my internet connection suddenly was getting very slow, I thought it was some problem with my internet provider but the problem was getting very fr
-
WMS : How to Process Sales Order Released before Turning on WMS
Hello Gurus, How to process sales orders released before WMS enable flag is turned on in the new WMS enviournment in Oracle 11.5.10 ?
-
Removing 3D Dock Reflection and/or Changing 2D Dock Background Color
Has anyone figured out a way to do either (or both) of the following: -remove reflections from the 3D dock -adjust the dark gray color of the 2D dock ? This is the last step I need to make the Dock visually tolerable for me. It would seem that both a
-
Account ID field is not display in FB60
Hi, In FB60 transaction, Accound Id is not display in the Payment Tab, but house bank is displaying. Is there any configuration to be done, let me know what to do? Thanks
-
Bank problem while importing BP master data
Hi im importing BP master data.before importing i've given 3 banks in the system.now in temp for house bank and default bank i've given "-1". error is [OCRD.BankCode]Application-defined or object-defined error65171 Please solve it.