cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger button event w/o a button

Former Member
0 Kudos

Hi,

I intend to trigger a standard toolbar event of ALV without clicking a button ( Closing the Settings Dialog Box ). Could you please let me know, any class thru which we can trigger this?

Pagal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

It is after you already selected a value from ALV?

Is this value transferred to your input field?

Please clarify.

I think you can monitor the changes in context using the context change log.

Look it up here. I am not sure.

regards

Yuval Peery

Former Member
0 Kudos

Hi Yuval,

Thank you for your response!

Lets say my ALV is in view 1 and there is another view called view 2. If a user clicks on Settings button (top right of ALV) and then goes to view 2. In view 2 he does what he wants and come back to view 1. Then the Settings Box which was opened previously is still present. But, my requirement is to close this Dialog Box when the user comes back from View 2 to View 1. Thank You.

Regards,

Pagal

Former Member
0 Kudos

Hi

1. Take a look here.

2. And here is the event that you can use

3. Check this explanation, too.

4. Here's a good tutorial you may want to read

Basically I understand that when your user clicks the copy pushbutton

which triggers an event that enables you to navigate to view2, but

it does not shut down the dialog box. What should be done is to use

OK or Cancel. This should close your dialog box and triggers an eventhandler

that takes you to view2.

Please clarify is this what is happening.

regards

yuval

Former Member
0 Kudos

Hi Yuval,

Ok, heres my complete scenario.

I am using a GAF FPM, in one of the steps of the steps of this GAF, there is an ALV.

When the user clicks on a button on the FPM toolbar, I need to navigate to the initial screen of FPM with a refresh. For this, I assumed there is a standard event of the FPM 'FPM_GOTO_START'. But when we use this event, it just goes back to start, but does not reset the ALV in my case. This is the reason that I am facing issues.

To handle this issue, I have decided to use this solution, trigger an event which cleans up the ALV filters (SORT, AGGR and Column Selection), which works fine as expected. But unfortunately SAP does not provide me with an interface to trigger 'SALV_WD_SETTINGS_CLOSE' without the click of a button on ALV. This is what I need. Could you please guide me as to how could I raise this event without having a button in the ALV toolbar? Thank You.

Regards,

Pagal

chengalarayulu
Active Contributor
0 Kudos

Hi,

I hope PROCESSEVENT method of FPM interface would resolve your problem, please check. Here you can get easily Event which is currently firing/navigating, so that you can easily do your own operations.

Former Member
0 Kudos

Hi Pagal

I am lookingg into the matter and as far as I understand after cleaning all filters
you want to close the settings view, so that only the ALV table remains open.

Since this is much like pressing the 'cancel' button on the settings view

I now have to search for a way to call the method onaction_cancel on the

settings view.

Please confirm

yuval

Former Member
0 Kudos

Hi Pagal

After you trigger an event which cleans up the ALV filters (SORT, AGGR and Column Selection), which works fine as expected you can perhaps get reference to the used components as follows:

a. since you already have a reference to salv_wd_table you can try to

   dive in

b. when you press setting class Salv-wd_table calls component 'salv_wd_layout_ui'

      using the method 'on_view_get_settings'.

  

        So to get a reference to this view use following code:

       data: lr_view  type ref to if_salv_wd_view.

       

         lr_view = ***salv_wd_table***wd_component_controlloer***->          

        r_component- >if_salv_wd_component~get_view(  'view_service_I ' ).

        'now trigger the action 'onCancel'

         lv_view->on_action ( name = 'onCancel'

        t_parameters = 'cl_salv_wd_param_service_ui ' ).

See if this gets you anywhere....

regards

yuval

Former Member
0 Kudos

Hi Yuval,

You hit the nail on its head! That is indeed what I am currently looking for!

Regards,

Pagal

Former Member
0 Kudos

Hi Yuval,

I think the said procedure would work in my case, but the only problem is I am unable to get the reference of R_COMPONENT of the ALV Usage SALV_WD_TABLE. Can you please help me get the reference to that? Thanks.

Regards,

Pagal

Former Member
0 Kudos

Hi Pagal

Debugging the system I found out:

R_COMPONENT - is an internal attribute, so you cannot get reference to it.

salv_wd_table in its wdDoInt method creates an object and initializes

this attribute, which in turn, can get a reference to the settings view.

If we have no reference to the settings view, we are back at square one.

What you can do, if this is really important for you, is perhaps change SAP's

original component and make this global attribute public. Beware howerver

that when you upgrade your system you will have to do it once again .

Just wondering: why is it so important for you to close this

setting view automatically? Why can't the user press OK

after he selects his settings?

regards

yuval

Former Member
0 Kudos

Hi Yuval,

When you say 'change SAP'soriginal component and make this global attribute public', do you mean take the access key to the component SALV_WD_TABLE and change the attribute to public or would it be possible with an enhancement?

Regards,

Pagal

Former Member
0 Kudos

Hi Pagal

Yes, you probably have to change the DC with an access key.

I do not know about enhancement.

regards

yuval