cancel
Showing results for 
Search instead for 
Did you mean: 

Power list: new action in standard power list

christoph_nagl
Participant
0 Kudos

Hi,

I need some help in creating new actions in a standard power list.

I would like to update a standard power list and add a new action, but the action will not displayed in the list. I updated the feeder class method GET_ACTIONS with this code:

IF c_action_defs IS INITIAL.

*{   INSERT         SDEK900590                                        1

*   " CNA: add hardcoded function for creating a new action

    ls_powl_action-actionid       = 'create_delivery'.

    ls_powl_action-cardinality    = 'S'.

    ls_powl_action-enabled        = abap_true.

    ls_powl_action-placement      = '2'.

*     ls_powl_action-placementindx = .

*     ls_powl_action-imagesource   = .

    ls_powl_action-text          = 'Lieferung anlegen'.

    ls_powl_action-tooltip       = 'Drücken Sie diesen Button um eine Lieferung anzulegen.'.

*     ls_powl_action-add_separator = .

*     ls_powl_action-act_choices   = .



       APPEND ls_powl_action TO c_action_defs.

But the actions will not be displayed in the webdynpro. Maybe somebody can help me.

Thanks!

BR,
Christoph

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christoph,

1. Hope you are add the code in pos exit of get_actions.

2. ls_powl_action-placement      = '2'. Did you checked the fixed domain values of placement?

    The structure is POWL_ACTDESCR_STY-PLACEMENT and the value should be 'B'

    i.e on toolbar.

3. You can give placement idex as in where you want to place your button

4. Also button id should be in CAPS   ie change 'create_delivery' to 'CREATE_DELIVERY'

   

Hope it helps.

Bhanu

christoph_nagl
Participant
0 Kudos

Hi,

Thanks for the fast response!

What do you mean with the first poin "add the code of the pos exit of get_actions". I marked the point where I added the code below with XXX

METHOD if_powl_feeder~get_actions.



  DATA: lr_db          TYPE REF TO cl_wdkq_db_accessor,

        lt_actions     TYPE wdkqactions_tty,

        ls_powl_action TYPE powl_actdescr_sty.



  FIELD-SYMBOLS: <fs_action> TYPE wdkqactions_sty.





  IF c_action_defs IS INITIAL.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


*   get query specific actions

    CALL METHOD cl_wdkq_db_accessor=>get_instance

      EXPORTING

        iv_powl_type    = i_type

      RECEIVING

        result          = lr_db

      EXCEPTIONS

        type_not_exists = 1

        OTHERS          = 2.



    IF sy-subrc <> 0.

      RETURN.

    ENDIF.



*   get toolbar actions

    CLEAR lt_actions.

    lt_actions = lr_db->get_toolbar_actions( ).



    LOOP AT lt_actions ASSIGNING <fs_action>.





      ls_powl_action-actionid       = <fs_action>-actionid.

      IF <fs_action>-cardinality = 'S' OR

         <fs_action>-cardinality = 'M'.

        ls_powl_action-cardinality    = 'S'.

      ELSE.

        ls_powl_action-cardinality    = 'I'.

      ENDIF.

      ls_powl_action-placement      = <fs_action>-action_type.

      ls_powl_action-enabled        = abap_true.

*     ls_powl_action-placementindx = .

*     ls_powl_action-imagesource   = .

      ls_powl_action-text          = <fs_action>-text.

      ls_powl_action-tooltip       = <fs_action>-text.

*     ls_powl_action-add_separator = .

*     ls_powl_action-act_choices   = .

      APPEND ls_powl_action TO c_action_defs.



    ENDLOOP.





    e_actions_changed = abap_true.

  ENDIF.

ENDMETHOD.

After my changed I activated the class and set a breakpoint but does not work.

Thanks!

Former Member
0 Kudos

Since you are enhancing the standard POWL class i just wanted to confirm if you are enhancing in post exit method.

Are you saying the method is not triggered when you run your application?

christoph_nagl
Participant
0 Kudos

Hi,

yes the method is not triggered. I set also in the GET_objects method a breakpoint but also this method is not triggered. But the standard powerlist works fine.

Thx,

Christoph

Former Member
0 Kudos

Then you are not using the correct feeder class.

Way to find the feeder class:

T-code  POWL_TYPE contain the Feeder class name assigned to the POWL type . you can chek the POWL type with description and find the feeder calss associated to it & put a break poit in GET_OBJECT_DEFINITION method and ensure that feeder is exact one .

or

Go to POWL_UI_COMP webdynpro component , navigate to MASTER_CONTENT view method tab .

you can find ONACTIONREFRESH_CURRENT event in the method tab set a break point  in the     lr_model->refresh_current( ).

and Click the "Refresh " button from the POWL table which you want to find the feeder class , you will get the POWL type inside the method ( variable name-  ms_current_query-type ) . now go to POWL_TYPE tcode and find your feeder class which is assigned to this POWL TYPE

christoph_nagl
Participant
0 Kudos

Hi,

yes I did this you described to find ou the correct feeder class. The feeder class is "CL_POWL_INFOSET_QUERY".

When I set in the GET_OBJECT_definition the break point the application never entries.

How do you start the power list?

I go to PFCG to the role "SAP_NBPR_WAREHOUSEMANAGER-M1" and start from the menu structure the power list. When I click "execute" the internet explorer opens and the power list is shown.

But the SAP break point will never be active.

BR,

Christoph

christoph_nagl
Participant
0 Kudos

Hi,

now it works. I always created a session breakpoint but I have to create an external breakpoint that the application will stop at the breakpoint.

Now I try to add the action.

Thanks for your support.

One additional question:

How can I access the selected row of the power list because I want to call a webservice and as parameter I want to access to data of the selected row.

BR,

Christoph

Former Member
0 Kudos

I dont know much about the webservice. I think you can close this thread and open a new one for that.

Bhanu

christoph_nagl
Participant
0 Kudos

Hi Bhanu,

thanks for your help.

During my tests occured following questions:

- How can I use an existing power list in my personal webdynpro application? Which component I have to use?

- How can I connect 2 powerlists ?

- How can I implement something when a row was selected in the powerlist (row selection listener..)

Thanks for your great help!

BG,

Christoph