Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV: data_changed event

Former Member
0 Likes
1,242

Hi everyone!

I have the following problem:

I created a DYNPRO with one ALV grid and several "ordinary" fields. The ALV is editable.

Now I try to sum up some fields of the ALV grid and put the sum into one of the ordinary DYNPRO fields. When the <i>data_changed</i> event is fired the sum is calculated correctly and put into the global field associated with the DYNPRO field. However, the value change is not shown on the DYNPRO.

When I press <i>ENTER</i> while the cursor is in the "ordinary" DYNPRO area and not in the ALV Grid, the data change is shown correctly. Debugging shows that no PBO/PAI for the DYNPRO is executed when the data in the ALV is changed, so I assume there is no value transport between the global field and the DYNPRO.

What am I doing wrong?

Regards, Joerg

7 REPLIES 7
Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

Hi Joerg

To achieve this you should define ALV events as application events. Or you should reset the same screen using 'LEAVE TO SCREEN X' at the end of data_changed event.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Read only

0 Likes
1,096

Hi Serdar,

You mean it is possible to "hand through" ALV events to the normal dynpro flow? How?

And one more thing, slightly off-topic: How can I put hyperlinks in my posts? When I insert a link to http://www.sdn. it shows as a huge link in one line. Can I abbreviate it somehow?

Regards, Joerg

Read only

0 Likes
1,096

Hi Joerg,

when you register the event data_changed you need to set the flag appl_event to 'X'.

regards

Siggi

Read only

0 Likes
1,096

Hi Joerg,

Here is the other way how to achieve the processing of PAI/PBO of the main DYNPRO, which contains ALV. It works fine for me, so you could consider this possibility as well. Inside the event handling method you could do this call:


       CALL METHOD cl_gui_cfw=>set_new_ok_code
         EXPORTING
           new_code = 'ENTE'
         IMPORTING
           rc       = l_rc.

You should deal rather carefully with it - put it better in a method like

HANDLE_DATA_CHANGED_FINISHED

.

Instead of 'ENTE' you should use the command code defined in your dynpro and better suited for such a "refresh" functionality, but I'm afraid it can not be empty code string.

Hope this helps, regards, Sergei

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

Hi Joerg

Yes, defining events as application events handles events through the PAI flow where you call "cl_gui_cfw=>dispatch".

Secondly, you can insert URLs between the tag "[ url<i>=<url></i>]<i><URL text></i>[ /url]". (Omit the blanks just after "["s).

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Read only

Former Member
0 Likes
1,096

Dear Joerg,

I made a lot of work with editable alv grids, but using the function REUSE_ALV_GRID_DISPLAY. This function has a property for triggering user command after editing a cell. I've checked the code behind that option and I believe you should register the following event:

call method grid->register_edit_event

exporting i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Of course you also need to set a handler for this event...

Hope this helps,

Ofer

Read only

0 Likes
1,096

Ofer,

I had the same problem.. Solved by your solution.. Thanks a lot