cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the settings of a View which is not the standard one

Former Member

Hi everybody,

I'd like to put a filter in a view which ist not the [Standard] one.

The Method if_salv_wd_filter~create_filter_rule works fine, but only for the Standard one.

Is there any way I can do it?

Thank you,

Christian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

Dear Christian,

here's what I would suggest you should do

1) create a Application Configuration and Component Configuration for your WD

2) Personalize these configurations as you pretend. Guess you know how to do this - launch the configuration in Administration Mode and then personalize it.

3) Now that you have your Config. Personalized, all you have to do is the enhancement to add the filter (same code you shared with us). But the difference is that you will only run that piece of code if the WD is running with the configuration you have created (the personalized one).

So for example on your method WDDOMODIFYVIEW you could have this draft code


DATA: l_myconfig     type string.

l_myconfig = wdr_task=>client_window->get_parameter( 'sap-wd-configId' ).

IF l_myconfig = 'THE_ID_OF_YOUR_PERSONALIZED_CONFIGURATION'.
 put your filter code here
ENDIF.

Voila.

Hope this helps.

Kind Regards

/Ricardo Quintas

Former Member
0 Kudos

Dear Ricardo,

thank you for your detailed and very useful answer.

As you kindly suggested I put my code for the filter-building in the WDDOMODIFYVIEW. When I launch the application I see no filterline on my default view "Overview", only if I switch to "Standardview" and back to "Overview" I can see the desiderd filterline. But I would like to see it as default, too. Nevertheless this is already a progress.

Regarding your suggested Application and Component Configurations, I created them but I don't know what I should set in it, since I already took my "settings" (the filter-building) for my SALV in the WDDOMODIFYVIEW.

I would be very pleased if you could me further suggest.

Thank you so much.

Christian

Former Member
0 Kudos

Ciao Christian

I have recently discussed about App. and Comp. configuration on a SDN post.

You can check it here

[;

On that post I go into more detail regarding how to apply Configurations.

Please check it and let me know if it helps.

Kind Regards

/Ricardo Quintas

Former Member
0 Kudos

Ciao Riccardo,

Thank you for your post, I saw it. Below a piece of it:

<<

How do you Configure a WD4A ?

You need to click on a Application Configuration or Component Configuration on your WD4A on SE80.

And then you will be taken (on your browser) to the App. and Comp. Configuration environment.

And it is there that you can do some changes to your WD.

>>

I still don't really know what I should do in the App. and Comp. Configuration environment, what sort of changes to WD I have to do.

Below what I did so far:

In the screen "Application Configuration <my_app_configuration>" all the Components-Usage are listed in the Tabstrip "Structure".

I select the one that I need and choose the created Configuration "<my_comp_configuration>".

The button "Go to Component Configuration" is now clickable.

I click on it and I jump to the screen "Editor for the Web Dynpro Abap Component Configuration".

Here I'm asked which Component I would like to configure and I choose

Component SALV_WD_TABLE Conf-ID <my_comp_configuration>

( which is also the only option)

I click on "Change" and I jump to another Screen, "Component Configuration <my_comp_configuration>", with 3 Tabstrips: Attributes, Component-Defined, Web Dynpro Built-In.

In the last one Views and their Elements are listed. Here I have the possibility to do some settings to VIEW_ALL->TABLE for example.

But I don't know which of these elements I should set, and in which way. I don't even know if I'm in the right screen at all to do such changes that I need.

Best Regards,

Christian

Former Member
0 Kudos

Can you elaborate more on this

Former Member
0 Kudos

So, normally we have this:

CALL METHOD lr_config->if_salv_wd_field_settings~get_field

EXPORTING

fieldname = 'MATNR'

RECEIVING

value = lr_field.

CALL METHOD lr_field->if_salv_wd_filter~set_filter_allowed( abap_true ).

CALL METHOD lr_field->if_salv_wd_filter~create_filter_rule

EXPORTING

included = 'X'

operator = 'EQ'

low_value = '4711'

That puts a filter (4711) in a certain colum (MATNR) of the STANDARD View (See please the Dropdown-Box above the ALV).

The fact is, I don't want to have the filter in the Standard view, but in a personalized one.

Regards,

Christian

Former Member
0 Kudos

Hi Baldari,

If you dont want to filter.. just pass abap_false to this..

CALL METHOD lr_field->if_salv_wd_filter~set_filter_allowed( abap_false ).

If will remove filter..

Cheers,

Kris.

Former Member
0 Kudos

Hi kissnas,

who said I want to remove filter? Please read again my requirement.

Regards,

Christian

Former Member
0 Kudos
The fact is, I don't want to have the filter in the Standard view

Regards

Kris

Former Member
0 Kudos

Did you copy the whole sentence? You didn't:

"The fact is, I don't want to have the filter in the Standard view, but in a personalized one."

Anyhow it doesn't matter what happens to standard view, I'd like to set filters to a personalized one.

Regards,

Christian