cancel
Showing results for 
Search instead for 
Did you mean: 

Notification of customer code changing

Former Member
0 Kudos

Hi all!

I have a problem. I need to do some action after the customer code has been changed in Service Call.

I used to catch Choose From List event in SAP 2007. But in the 8.8 there is new functionality: users can type several first signs of the customer code and a hint appears. There are the first 10 codes in the hint which are start with the entered by the user signs. Then if a value is chosen, it is transferring to the customer field in the Service Call form, but no Choose From List Event fires.

I looked all events, which fire in these steps using Event Logger, but there is no one appropriate for me.

Did anybody have the same problem?

Thanks in advance, Alexander.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Would it be possible to use the Validate event or can they add the document without leaving the field?

Former Member
0 Kudos

Dear njmog1,

thanks for your reply.

Even if a user chooses customer's code via hint list and updates the Service Call then by pressing Enter, the Validate event will fire. But in this way another problem appears.

The fact is that I have to refresh some additional data, which is located on the Service Call form, every time CardCode changes. If the user changes CardCode and doesn't leave anywhere from the item, no reaction from my addon will follow since Validate event doesn't raise. Users may decide that all data is correct and filled. When the Update button is pressed, Validate event raises, additional data changes and only then Service call updates with the additional data. These changes can simply been missed by users.

Maybe there is any other solution?

best regards, Alexander.

Former Member
0 Kudos

When they are choosing from the Hint List, there must be some event raised?

I haven't seen it, so do they click it? Browse with arrows and hit tab? Would you be able to track it in that way?

And what order do the events fire in if the click "update" - is it Item_Pressed = Before action -> Validate before action -> validate before action = false -> Item pressed before action = false?

If that is the order, you could try and work it using global variables... You can see from my suggestions that it is not going to be a tidy solution, you are going to need a workaround!

(on a side note, this hint list doesn't fire the "picker clicked" event, does it?)

Former Member
0 Kudos

Hint list is a form with type "-9876". The problem is that this form appears in all hints in all documents. Moreover it used with the selection list of combo buttons. Unfortunately, this form doesn't have any logical links to the form where it's opened (DBDataSources for instance).

When they choose a value from hint list, CLICK, FORM_CLOSE, FORM_UNLOAD events occur for the additional form. Then FORM_ACTIVATE event fires for the Service Call form.

The order of events is: CLICK (BeforeAction = true), VALIDATE (BeforeAction = true), VALIDATE (BeforeAction = false), CLICK (BeforeAction = false), ITEM_PRESSED (BeforeAction = true), DATA_UPDATE(true), DATA_UPDATE (false), VALIDATE (false).

I realize that a workaround should be used to manage the situation. I think to follow these steps:

1. catch GOT_FOCUS event with the CardCode Item and remember its value.

2. catch VALIDATE event and check whether CardCode has changed (pVal.ItemChanged is always false in this case). If the values differ, clear additional data on the form. Otherwise do nothing.

3. catch LOST_FOCUS event of CardCode item and set remembered value to String.Empty for instance.

4. catch DATA_UPDATE event and check saved CardCode value. If its empty (that means focus was moved from CardCode item and its changing was processed), data can be saved. Otherwise the user pressed Enter and started saving data process (and could miss the additional data disappearing). I'll show warning message in this case and ask if the changes should be committed.

Answers (0)