05-23-2013 10:25 PM
Hello,
I've a ALV report, and I want to know how Can I clear the SELECT OPTION values after send parameters? I have done: cleare P_option[] But this does not allow me select a range in the SELECT OPTION because this removes the values.
I did think use: FREE MEMORY but this remove all parameters into my reports.
Do you have any idia to solve this?
thanks
05-24-2013 6:06 AM
Hi Luis,
The Select Options in SAP are treated as internal table of type SELOPT. Since it is an internal table, you cannot clear the contents using CLEAR statement directly. Instead use,
REFRESH P_OPTION[].
This will clear the select option.
Thanks,
Ankit.
05-24-2013 2:26 AM
hi,
Can you please be more specific. May be give your code snippet. That should clarify the issue better.
Cheers,
Arindam
05-24-2013 2:30 AM
Hi Luis,
Your question is not very clear to me. If you just want to clear the values in a select-option just do:
CLEAR: P_OPTION[ ], P_OPTION.
You will need to clear the header line as well as the table content.
Otherwise, please share a bit of code.
Cheers,
Custodio
@zcust01
05-24-2013 6:06 AM
Hi Luis,
The Select Options in SAP are treated as internal table of type SELOPT. Since it is an internal table, you cannot clear the contents using CLEAR statement directly. Instead use,
REFRESH P_OPTION[].
This will clear the select option.
Thanks,
Ankit.
05-24-2013 8:52 AM
05-24-2013 6:26 AM
hi,
as ankit said select-options is an internal table .hear the name of select-options You assign also assigned to the internal table with the structure of select-options, with fields sign,option low,high.
as clear statement clear's workarea and not internal table , so it cant clear select-options too.
to clear select-options use Refresh statement .
05-24-2013 8:53 AM
05-24-2013 7:07 AM
05-24-2013 9:36 AM
Hi, when u use select option it actualy craetes an internal table with header line that has sign option low and hig values okay.
now suppose name of my select option is s_matnr.
so if i write clear: s_matnr it is actually claering only the work area, but u may argue how is it work area, it is because this is a legacy ABAP code that generates itab and wa with same name.
so, to clear entire content of select option write CLEAR: s_matnr[]. or refresh: s_matnr.
now, if you want to claer out any on eparticular entry in s_matnr[] or make modifications you can do that too.
Thanks,
05-24-2013 10:34 AM
Hi Luis ,
Try with this below code,
You can clear the contents of select-options
TABLES:
SPFLI.
SELECT-OPTIONS :
S_CARRID FOR SPFLI-CARRID.
START-OF-SELECTION.
REFRESH:
S_CARRID.
I used refresh for s_carrid since internally it is an internal table.
05-24-2013 12:17 PM
05-24-2013 12:29 PM
Hi Luis,
The selection screen values can only be cleared in the selection screen events.
I am assuming that you once you have executed your report and when you come back to selection screen you want the value cleared.
So use at selection-screen output.
At selection-screen output.
clear : p_option[ ], p_option.
Hope it helps
05-24-2013 3:01 PM
Hi Luis,
Use CLEAR : P_option,P_option[].
Reason : If you are using CLEAR : P_option only then it will clears the work area only.
If you are using CLEAR : P_option[] only then it will clears the internal table only(but P_option-low or
P_option-high will have the value). So it is better to use above mentioned code.
Above scenario is same for REFRESH also.
Regards,
Shaiksha Vali.
05-24-2013 3:23 PM
05-27-2013 6:27 AM
Hi Luis,
You can use clear for clearing the table type and structure type both.
Refresh is obsolete now.
Kind Regards,
RK
05-27-2013 6:33 AM
hi Lucis,
if u want clear selection screen , code should be at selection screen output event./
sample code.
at selection-screen output.
if r_tbt = 'X' .
clear : p_werks,s_werks-low,p_lgort.
refresh s_werks.
perform sub_screen_tbt.
elseif r_mbt = 'X'.
clear : p_werks,s_werks-low,p_lgort.
refresh s_werks.
perform sub_screen_mbt.
elseif r_tbm = 'X'.
clear : p_werks,s_werks-low,p_lgort.
refresh s_werks.
perform sub_screen_tbm.
endif.
Suresh
05-27-2013 7:06 AM
I've a ALV report, and I want to know how Can I clear the SELECT OPTION values after send parameters? I have done: cleare P_option[] But this does not allow me select a range in the SELECT OPTION because this removes the values.
Ok CLEAR p_options[] refresh the whole range, what is your exact requirement, remove one record of the range, then try to manage it as the internal table behind with a DELETE p_option INDEX index, or can you elaborate on your requirement ?
Regards,
Raymond
05-27-2013 7:08 AM
Hi Luis,
What is your exact requirement? What are you trying to do? When you have already tried with clear statement, everyone is suggesting you to try with the same statement again? Anyhow, what is the requirement? Please make us clear.
Thanks
Purnand