on 01-06-2012 1:36 PM
Hi there,
with respect to this zombie-thread here: http://forums.sdn.sap.com/thread.jspa?threadID=1439734&tstart=0
I have an OVS selection list with seven fields (and I need all of those fields from the user selection from OVS). However, only two of those seven fields must be visible in the selection list. Naive as the OP in the referred thread, I originally thought I could solve this by simply restricting the selection list to 2 columns:
ovs_callback_object->set_configuration(
window_title = 'title'
table_header = 'title'
col_count = 2
row_count = 10 ).
But it didn't work. I then proceeded to break my application by altering different attributes in different class references containing information of the field structure. But this didn't work either...
Could somebody assist me with this? I dare say this must be possible somehow
Cheers, Lukas
Hello Lukas, I dont know if it is what you want, but I created an OVS with one structure in input and showing four fields in result.
Hope it helps.
regards.
TYPES: BEGIN OF y_var,
ds_variant TYPE ztbsd_vr_fil_car-ds_variant. "variante
TYPES: END OF y_var.
TYPES yt_var TYPE STANDARD TABLE OF y_var. "tabela de variantes
TYPES: BEGIN OF y_variant,
aenam TYPE ztbsd_vr_fil_car-aenam, "usuario
ds_variant TYPE ztbsd_vr_fil_car-ds_variant, "variante
aedat TYPE ztbsd_vr_fil_car-aedat, "data de criacao
aeuhr TYPE ztbsd_vr_fil_car-aeuhr. "hora
TYPES: END OF y_variant.
DATA: t_variant TYPE TABLE OF y_variant. "tabela de variantes
DATA: wa_var TYPE y_var. "linha de variantes
"get value of v_variante from context and continue
CASE ovs_callback_object->phase_indicator.
WHEN 1.
wa_var-ds_variant = v_variante.
"input structure with only one field variant
CALL METHOD ovs_callback_object->set_input_structure
EXPORTING
input = wa_var.
WHEN 2.
"Get values for the current user
SELECT aenam ds_variant aedat aeuhr
FROM ZTBVC_TRX_M_C_VR
INTO TABLE t_variant
WHERE aenam = sy-uname.
SORT t_variant BY ds_variant.
DELETE ADJACENT DUPLICATES FROM t_variant COMPARING ds_variant.
CALL METHOD ovs_callback_object->set_output_table
EXPORTING
output = t_variant.
WHEN 3.
"catch result record and populate field scree
ASSIGN ovs_callback_object->selection->* TO <fs_selected> CASTING.
v_variante = <fs_selected>-ds_variant.
wd_this->o_context_helper->set_attribute( EXPORTING i_path = 'PESQUISA_CRITERIO/VARIANTE'
i_value = v_variante ).
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As per Lukas, if there are already 4 fields that are decalred as per your code...is there any way to show only 2 or 3 of them in result list of OVS....instead of commenting those in that strcuture or defining a structure with only requried ones.
>
> Edited by: Lekha on Jan 6, 2012 10:48 PM
That's my point. I have seven field types in lty_stru_list and I programatically need them all at the point of time when the enduser selects an entry from this very selection table. However, the enduser must only see 2 from these 7 fields in his selection table whereas in runtime all seven fields must be available from the user's selection.
types:
begin of lty_stru_input,
* add fields for the display of your search input here
NACHNAME TYPE string,
ORGTEXT TYPE string,
end of lty_stru_input.
types:
begin of lty_stru_list,
* add fields for the selection list here
UNAME type Agr_Users-uname, " must not be visible to the enduser but still selected from selection list
PERNR type P0105-pernr, " must not be visible to the enduser but still selected from selection list
NACHN type P0002-nachn,
ENAME type P0001-ename,
ORGEH type P0001-orgeh, " must not be visible to the enduser but still selected from selection list
ORGTX type T527x-orgtx,
end of lty_stru_list.
Interface-wise it's like pulling teeth. I checked the following IFs so far: IF_WD_OVS, IF_WD_OVS_ALV, IF_WDR_OVS_LISTENER.
None of them seems to provide the means to hide a column, "IF_WD_OVS_ALV" sounded so promising
Any ideas?
Cheers, Lukas
Edited by: Lukas Weigelt on Jan 9, 2012 11:20 AM
Hi, all!
May be it's will be usefull for someone ...
In NW7.0 parameter COL_COUNT is not used while configuring OVS.
You can make Enhancement Implementation in local class LCL_OVS_HANDLER inside CL_WDR_VALUE_HELP_HANDLER in method implementation IF_WDR_OVS_LISTENER~MODIFY_RESULT_VIEW, for example, like this:
DATA: lo_col TYPE REF TO CL_WD_TABLE_COLUMN.
CHECK me->col_count > 0.
DO me->table->cc_columns TIMES.
CHECK sy-index > me->col_count.
lo_col = me->table->get_column( index = sy-index ).
CHECK lo_col IS BOUND.
lo_col->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
ENDDO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valeriy,
It works!!! with this you can use the COL_COUNT for OVS. But my code is a little bit different:
DATA: lo_col TYPE REF TO CL_WD_ABSTR_C_TABLE_COLUMN.
CHECK me->col_count > 0.
DO me->ctable->cc_columns TIMES.
CHECK sy-index > me->col_count.
lo_col = me->ctable->get_column( index = sy-index ).
CHECK lo_col IS BOUND.
lo_col->set_visible( cl_wd_abstr_c_table_column=>e_visible-none ).
ENDDO.
You just need to use the correct type for LO_COL (CL_WD_****_COLUMN), and modify the codes accordingly.
Thanks a lot!
Solved with a workaround... I made a second internal table and connected it to my table for the OVS with a running number. With this I still have a running number seen in the WDA but the sensitive Information is not shown and can still be assigned in the background by this running number.
Cheers, Lukas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As per the thread you posted, the other member says that the person has declared the custom type (using TYPES) havining only the columns required..as below
When you use the OVS, we declare the columns right..define only your columns in this section...not all the columns...
types:
begin of lty_stru_list,
col1 type string,
col2 type string,
end of lty_stru_list.
data:
lt_column_texts type wdr_name_value_list.
I have not tried the above (orignial post) way of hiding the columns...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.