cancel
Showing results for 
Search instead for 
Did you mean: 

FPM_OPEN_DIALOG Event is not populated in the Event Dropdown

former_member374952
Participant
0 Kudos

Hi ,

I have created a Button on the Sap Toolbar and now want to assign the FPM_OPEN_DIALOG  event but cannot see this option for the button created on the Standard Sap toolbar screen .  Is there any specific interface needs to be added in the feeder class ?

However FPM_OPEN_DIALOG option is populated in the dropdown if I create a button on the GUIBB and then assign an event for it . I am clueless why it is not populated when the button is created in the standard sap toolbar .

Here is the screenshot :

Regards,

Vicky

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you tried below code in GET_DEFINITION( ) method of feeder class?

DATA: li_action_line    TYPE fpmgb_s_actiondef. 

* Prepare actions

  li_action_line-id       = '<ACTION_ID>'.  " You can give wahtever name you want to the action ID

  li_action_line-visible  = cl_wd_uielement=>e_visible-visible.

  li_action_line-enabled  = abap_true.


  APPEND li_action_line TO et_action_definition.

Refer this document for your reference.

A Step-by-Step guide to create a simple FPM application using Feeder Class for FORM GUIBB

Thanks

KH

former_member374952
Participant
0 Kudos

Hi Hawkins,


Yes , I have tried that method and it works fine on a normal button but no clue on how to define the event for toolbar buttons on the Standard Sap Screen.


Here is my scenario :


I made the deep copy of  BS_CU_OVP and added the tool bar button also made the copy of feeder class as ZCLASS which inherits all the method from Standard Sap feeder CL_BS_BP_QUERY_RESULT.


Now the Catalog Definition for this screen is loaded from the Standard class CL_BS_BP_QUERY_RESULT which cannot be modified  also I want a way around without any Enhancement to the standard class.

Is there any way where I can define the button event without enhancements ? I  defined it in the Constructor still no luck. The  ET_ACTION_DEFINITION get overrided when get-definition method of CL_BS_BP_QUERY_RESULT gets loaded

Here is the message I get when i try to modify the GET_DEFINITION method  from my ZCLASS .



Regards,

Vicky

former_member374952
Participant
0 Kudos

Hi Hawkins,

I managed to create the event  and appended to the structure et_action_definition. But when I assign the tool bar button to this new even the button gets disabled . I have added the following statements still the button is disabled.

  li_action_line-visible  = cl_wd_uielement=>e_visible-visible.

  li_action_line-enabled  = abap_true.

Regards,

Vicky

Former Member
0 Kudos

Hi ,

Try this.

li_action_line-visible  = cl_wd_uielement=>e_visible-visible.

  li_action_line-enabled  = abap_true.


  APPEND li_action_line TO et_action_definition.

Thanks

KH

former_member374952
Participant
0 Kudos

Hi ,

I have the following code. Still the toolbar button gets disabled if I assign this action . 

DATA: li_action_line    TYPE fpmgb_s_actiondef.

* Prepare actions

  li_action_line-id       = ACTION_NAME'.  " You can give wahtever name you want to the action ID

  li_action_line-visible  = cl_wd_uielement=>e_visible-visible.

  li_action_line-enabled  = abap_true.


  APPEND li_action_line TO et_action_definition

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Vicky,

In GET_DATA method, write below code.

field-symbols : <fs_action_usage> type fpmgb_s_actionusage.


read table ct_action_usage assigning <fs_action_usage> with key id = 'ACTION_NAME'.

IF sy-subrc EQ 0.

      <fs_action_usage>-enabled = abap_true.

       ev_action_usage_changed = abap_true.

ENDIF.

Hope it will work.

Regards,

Naga

former_member374952
Participant
0 Kudos

Hi Nagendra,

Thanks for your response.

After making changes in  get data method the button get enabled  But only after triggering some action .

I have added the Button in the Customer Search Screen ( nwbc )  . the button is disabled initially when the Customer search screen is loaded however  when I click on one the buttons or on a search button the newly created button gets enabled .

I want to enable the button when the Customer Search Screen is loaded initially.

Is the button disable  because the page needs a refresh kind of something to make the visibility happen.

Please let me know

Regards,

Vicky

Former Member
0 Kudos

Hello Vicky,

Try with this code, hope it will workout.

In GET_DEFINITION, no need to set the visibility property.

* Prepare actions

  li_action_line-id            = 'ACTION_NAME'.  " You can give whatever name you want to the action ID

  li_action_line-enabled  = abap_true.


  APPEND li_action_line TO et_action_definition.

Regards,

Naga

former_member374952
Participant
0 Kudos

Hi Nagendra,

I tried with the following code still no luck .

I need to trigger Search Action in the screen everytime to enable the button and then the button gets disabled once an event is fired from it.


Here is the Code :

DATA: LS_ACTION_DEFN   TYPE fpmgb_s_actiondef.

LS_ACTION_DEFN-ID = 'Action_Btn'.

LS_ACTION_DEFN-text = 'Test PROC Data'.

LS_ACTION_DEFN-ENABLED = abap_true.

append LS_ACTION_DEFN to ET_ACTION_DEFINITION.



Screenshot :



Regards,

VIcky

bavinash1
Explorer
0 Kudos

Hello Vicky,

The ideal place to add this button and set this to enabled is get_definition only.

The way this works is

1. Before the page gets loaded, it'll loop across all the get_definitions in the feeder classes the columns are picked up from field catalog and actions from action definition.

You can try the below piece of code.

*----- add button

    APPEND INITIAL LINE TO et_action_definition ASSIGNING <ls_actiondef>.

    <ls_actiondef>-id = <button_id>.

    <ls_actiondef>-imagesrc = <image>.

    <ls_actiondef>-enabled = abap_true.

    <ls_actiondef>-tooltip = text-XXX.


2. GET_DATA is something like PBO, it'll be called again in sequece for all the UIBBs. Yes, we can do some manipulations of buttons and actions here. But the right thing would be to in get_definition.


In case you still want to go ahead with putting the code in get_data, please check if your code is reached before the launch as well.

Hope this helps.


Best Regards,

Avinash Bolisetty