Skip to Content

add a button choice on alv toolbar in wda

Hello Experts,

I want add a button choice on alv toolbar. I already insert the choice button indeed I see the button correctly.

Now I want insert the list of action with the following code:

<<

>>

With this code my web-interface retuns this message: "500 SAO INTERNAL SERVER ERROR. ERROR ACCESS via null object reference not possible. (termination rabax_state)". The dump is in "cl_wdr_utilities=>construct_mime_url".

Do you have any ideas? Do you have any examples?

Thanks in advance.

Best Regards,

Marino

code.jpg (23.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Jun 06, 2014 at 11:48 PM

    Hello,

    the problem isn't "the line set_image_source". The problem was the order, the correct order is:

    <<

    CREATE OBJECT lr_button_choice.

    lr_button_choice->set_image_source( 'ICON_CHANGE' ). "#EC *

    lr_button_choice->set_text( value = 'Modifica' ).

    lr_button_choice->set_tooltip( value = 'Modifica Attributi').


    CREATE OBJECT lr_menu_action_item

    EXPORTING

    id = 'MOD_NOTE'." TYPE REF TO cl_salv_wd_menu_action_item.

    lr_menu_action_item->set_text( 'Note').

    lr_button_choice->add_choice( EXPORTING value = lr_menu_action_item ).

    CREATE OBJECT lr_menu_action_item

    EXPORTING

    id = 'MOD_CONTO'." TYPE REF TO cl_salv_wd_menu_action_item.

    lr_menu_action_item->set_text( 'Conto').

    lr_button_choice->add_choice( EXPORTING value = lr_menu_action_item ).

    lr_function = wd_this->salv_incassi->if_salv_wd_function_settings~create_function( id = 'MOD')."creating the function for alv button

    lr_function->set_editor( lr_button_choice ).


    >>


    Thanks very much.

    Best Regards,

    Marino

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 05, 2014 at 06:50 PM

    Hi,

    I guess in the image source you have to provide the web Icon name. using ~Icon/<name>

    lr_action_change->set_image_source( value = '~Icon/GreenLed' ).

    Regards,

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 06, 2014 at 03:36 AM

    Hi Marino,

    Try to comment the line set_image_source and check if everything works fine.

    Regards,

    Rama

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2014 at 04:09 AM

    Hi Marino,

    Check this below code.

    data: ls_choice TYPE ig_componentcontroller=>element_choice,

    nd_choice TYPE REF TO if_wd_context_node,

    nd_choice = nd_my_functions->get_child_node( name = wd_this->wdctx_choice ).

    el_choice = nd_choice->get_element( ).

    ls_choice-wa_value = '01'.

    APPEND ls_choice TO lt_choice.

    nd_choice->bind_table( lt_choice ).

    DATA:lr_button_choice TYPE REF TO cl_salv_wd_fe_button_choice.

    DATA:lr_choice TYPE REF TO cl_salv_wd_menu_action_item.

    lr_function = l_value->if_salv_wd_function_settings~create_function_right( id = 'MYBUTTONCHOICE' ).

    CREATE OBJECT lr_button_choice.

    EXPORTING

    sel_action_item_elementname = 'CHOICE.WA_VALUE'.

    lr_button_choice->set_text( value = 'Filter' ).

    lr_button_choice->set_tooltip( value = 'Filter').

    lr_button_choice->set_sel_action_itm_elementname( 'CHOICE.WA_VALUE' ).

    CREATE OBJECT lr_choice

    EXPORTING

    id = 'CHOICE'. "CREATE OBJECT lr_choice the object id have to refer to name of node.

    lr_choice->set_text( 'Esito Positivo' ).

    lr_choice->set_image_source( value = 'ICON_GREEN_LIGHT').

    lr_button_choice->add_choice( lr_choice ).

    lr_function->set_editor( lr_button_choice ).

    Thanks

    KH

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.