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

SALV Message on data changed

Former Member
0 Likes
2,346

I have an SALV table and I want to display a message every time the work center category is changed.

*The user cannot directly change the work_center_category from this SALV,another user if he goes to IW32 and manually changes the wc_cat,the user should have a pop up MESSAGE 'CAS was changed.' TYPE 'I'.

The value is going to be changed in IW32 but the message to be displayed in my current SALV table.

Can anybody help me how to do this?

1 ACCEPTED SOLUTION
Read only

Ankit_Maskara
Product and Topic Expert
Product and Topic Expert
1,674

Are you copying the run data of ALV to some custom table beacuse otherwise how can you be sure that work center category has been changed between last ALV run and now. If you can track the data changes then should be easy because before every next run of ALV you can compare the data and show message. Also, you can consider appending a new column for message to show data changed information in ALV beacuse you may have data getting changed for multiple work center catergories.

8 REPLIES 8
Read only

Ankit_Maskara
Product and Topic Expert
Product and Topic Expert
1,675

Are you copying the run data of ALV to some custom table beacuse otherwise how can you be sure that work center category has been changed between last ALV run and now. If you can track the data changes then should be easy because before every next run of ALV you can compare the data and show message. Also, you can consider appending a new column for message to show data changed information in ALV beacuse you may have data getting changed for multiple work center catergories.

Read only

DoanManhQuynh
Active Contributor
0 Likes
1,674

To show message on changed in ALV, you have to handle onchange event and check which field is changed. Search for it, there are alot of sample out there.

The requirement to show popup on ALV based on change in iw32 i really dont understand your concept...but when user1 edit on ALV and want to check if data actually changed while he working then you have to select data from table and compare yourself.

Read only

RaymondGiuseppi
Active Contributor
1,674

As the change of the order is not executed in your transaction, you report should look for changes since last display.

  • You can start the hunt for changes in an event such as PAI/PBO on a refresh function, or periodically if you use a class such as CL_GUI_TIMER to raise an event every n seconds.
  • If you display too many orders to allow a frequent full reload of displayed data for performance, you could first look for change documents created since last display (e.g. CDHDR with OBJECTCLAS = 'ORDER', memorize the last CHANGENR value at first display of table and after each partial reload, look for available indexes on CDHDR on your system to optimize) and only update changed records before refreshing display.

Of course some high-level Abapper could also play with Abap (messaging) Channels to handle communication between transaction that update order and transaction that display orders...

Read only

0 Likes
1,674

The idea is to show a pop up every time the users displays an order,it doesn't matter how many rows there are different the pop up is going to be only one.If you could please provide me with an example that would be great,since I am new and I don't really know how to handle these events.

You also don't have to refresh the alv everytime,the condition should fire everytime the user displays the order.

Thank You in Advance!

Read only

0 Likes
1,674
  • To raise/handle timer event, look at demo program SAP_TIMER_DEMO (45 lines)
  • To find if one of the tracked fields has been changed, select order changed from cdhdr as written, optimizing with a 'changenr > last_changenr' then select fields changed from cdpos (cluster) with keys of cdhdr looking for your field(s)
Read only

0 Likes
1,674

the program is only to display a message at a specific time,I dont understand how it can handle the IW32 changes in wc_cat

Read only

1,674

raymond.giuseppi gave you 2 pieces to achieve your goal (3 if you count ABAP Channels): you should put them together

  1. Timer to trigger event
  2. Event to read data and show the popup

Read only

0 Likes
1,674

This is just a sample in order to show you how easily you can use the CL_GUI_TIMER class to trigger an event every second.

Now you have to start coding activating the class initially and handling the event to

  • look for changes
  • run again the class.

Or look for another solution.