Skip to Content
author's profile photo Former Member
Former Member

Row change event in WDP ALV

Dear Experts,

Can anyone help me how to raise event on row change event in WDP ALV.

I have two columns namely ' From date and two date' in my ALV table.

I have defaulted the "from date" to 6 months from current date.So when i change the "From date", the "to date" should be automatically get changed to 6 months from "From date" field.

Thanks

Katrice

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Sep 03, 2013 at 01:56 PM

    Hi,

    In your ALV, Make the From date as input field and create one on_cell_action for that field mean while inside that action get the entered from date and add six month to that data then set that to To_Date field.

    Regards,

    John.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 03, 2013 at 01:23 PM

    Hi Katrice,

    Component SALV_WD_TABLE has several events, two of which may be useful to you, ON_DATA_CHECK or ON_CELL_ACTION. You can see an example of implementing an ALV event in the following document. The document shows how to implement a different ALV event but you'll get the general idea.

    Selection Variables in ALV View Variants

    Cheers,

    Amy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 03, 2013 at 06:22 PM

    Hi Katrice,

    you can use ON_CELL_ACTION_EVENT to achieve ur requirement by following below steps.

    1.Enable Cell Action Event, in the method where you are defining ALV settings as below:

    if_salv_wd_table_settings~set_cell_action_event_enabled ( abap_true ).

    2. Define a new z_event handler method with (ON_CELL_ACTION ) event at the view where you are displaying ALV.

    3. In t he method you will get an imorting parameter r_param, Where u can get column name, values, index of a particular cell .

    for your case you will get the From Date value when u change the default date in that particular cell as below.

    r_param->column = ' From Date Field Name '

    move r_param->*value to fs_newdate.

    move r_param->index = lv_index.

    call method get_static attributes_table, so that you will get the alv table,

    Now read the table, with index = lv_index.

    change TO_DATE = FS_NEWDATE + 6 MONTHS (Use ur logic watever )

    modify the alv_internal_table with TO_DATE.

    Bind the table again with the node to display the modified TO_DATE.

    Hope, You can also on data check also with help of below link

    http://wiki.sdn.sap.com/wiki/display/Snippets/Web+Dynpro+ABAP+-+ALV+Controlling+Standard+Buttons

    Do reward if you find helpful.

    Thanks.


    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.