Skip to Content
avatar image
Former Member

ALV + webdynpro

Hey all,

I made a simple Web Dynpro application that does the following:

//example: User gives in name of a xbox-game, clicks on search and then he gets the info in an ALV table...

This works all fine.

.but I would like the user to be able to click on the game he wants (in the alv table) and that he can order this..

so I want to know what the user selected in the alv-table and use this information...

I have searched a lot, but haven't find anything that I understand or can use...

Maybe other ideas to make a sort of a product-ordering-program? (simple,little version....)

Hope someone can help me...

Kind Regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 08, 2010 at 03:25 PM

    Can be done in 2 ways:

    a) You create a button( function ) on ALV toolbar named as Order, and when user selects the ALV row and click on Order button required functionality is triggered

    b) Other way could be to create a button " Order" in each row of a ALV ( Button Column ), and then on press of button do the user action.

    I would prefer option 1, to implement this, you can read the lead selected element from the context node bound to ALV ( check the method of interface if_wd_context_node ), to create button on ALV you have to write a code something like this

    *-----create details button for ALV
          ID     = 'BTN_DISPLAY_DET'
          VALUE  = display_function ).
    * set button and tool tip text
      CREATE OBJECT lo_own_button.
      lo_own_button->set_text( LV_BUTTON_TEXT ).
          VALUE = LV_BUTTON_Tooltip.
      display_function->set_editor( lo_own_button  ).

    data declaration are as follows:

    DATA: display_function TYPE REF TO CL_SALV_WD_FUNCTION,

    lo_own_button TYPE REF TO cl_salv_wd_fe_button.

    Once you have created you own button you can create an event handler for ON_FUNCTION event of ALV and based on the button ID r_param->id, you can write the respective code in the block for that button id.

    Hope this helps


    Manas Dua

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 08, 2010 at 06:00 PM


    Refer to the below links which will be useful-

    Hope it helps.



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 09, 2010 at 07:05 AM

    you can create the corresponding column as link to action


    lo_cmp_usage = wd_this->wd_cpuse_alv_isr( ).

    IF lo_cmp_usage->has_active_component( ) IS INITIAL.

    lo_cmp_usage->create_component( ).


    lo_interfacecontroller = wd_this->wd_cpifc_alv_isr( ).

    lv_value = lo_interfacecontroller->get_model(


    *------get object of column to set as link to action

    CALL METHOD lv_value->if_salv_wd_column_settings~get_column


    id = 'DOC_NUM'


    value = l_column.

    CREATE OBJECT lr_link1.

    CALL METHOD lr_link1->set_text_fieldname


    value = 'DOC_NUM'.

    CALL METHOD l_column->set_cell_editor


    value = lr_link1.

    *-------hide column chck

    CALL METHOD lv_value->if_salv_wd_column_settings~delete_column


    id = 'CHCK'.

    and then create a methode in you view to handle on_click evend of alv

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      To get the selected row from ALV, just use the code wizard( CTRL + F7 ) to read the context node which is bound to that ALV, method get_static_attributes of if_wd_context_node will be generated which will give you attributes corresponding to the selected row of ALV.