cancel
Showing results for 
Search instead for 
Did you mean: 

Row change event in WDP ALV

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184958
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Hello John,

Thanks for your prompt reponse.I have done the code changes according to you.But "ON_CELL_ACTION" event is getting triggered only if i select "From date" from F4 help on clicking on "Enter" key.

I want to raise event as soon as i select value from F4 help.Please help me how to achive this?

Thanks

Katrice

m_aravindan
Active Participant
0 Kudos

Hi Katrice ,

          

          Just have a look into this Document by Kiran, it may give you a good idea..

http://scn.sap.com/docs/DOC-44817

Best Regards

Aravindan M

Former Member
0 Kudos

Hi ,

Try using  ON_DATA_CHECK event of ALV.

Thanks

Vijay

Former Member
0 Kudos

Hello Aravindan,

Interface if_wd_view_controller does not have method register_on_enter_for_f4.

Thanks

Katrice

m_aravindan
Active Participant
0 Kudos

Hi Katrice ,

              See the comment on that Document by Chris Paine.

"For those who aren't yet at 7.4 level - here's a blog I wrote 3 years ago which basically shows how to do the same thing on a 7.1 stack "

Firing a WDA event on using a Search Help - how to do it, without an NDA

Best Regards

Aravindan

Former Member
0 Kudos

Thanks John,

For your helpful solution.


Thanks
Katrice

Former Member
0 Kudos

Thanks Aravindan,

For your helpful solution.


Thanks
Katrice

Former Member
0 Kudos

Thanks Vijay,

For your helpful solution.


Thanks
Katrice

Answers (2)

Answers (2)

0 Kudos

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.


amy_king
Active Contributor
0 Kudos

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.

Cheers,

Amy

Former Member
0 Kudos

Hello Amy,

Thanks for your prompt reponse.I have done the code changes according to you.But "ON_CELL_ACTION" event is getting triggered only if i select "From date" from F4 help on clicking on "Enter" key.

I want to raise event as soon as i select value from F4 help.Please help me how to achive this?

Thanks

Katrice

amy_king
Active Contributor
0 Kudos

Hi Katrice,

Try ON_DATA_CHECK. If that too doesn't fire when you want, you may want to create an event handler method for each of the ALV events and set breakpoints in them just to see when they fire and find out if any of the ALV events can be used for what you want.

Also, if you want to capture the date value right after F4 help, the view's hook method wddomodifyview may work for you if no ALV event does since it gets executed upon return from F4 help.

Cheers,

Amy

Former Member
0 Kudos

Thanks Amy,

For your helpful solution.


Thanks
Katrice