Application Development 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: 

Search Help Exit not triggered in VA01

Jelena
Active Contributor
0 Kudos

We are trying to limit the number of values in the Order Reason (VBAK-AUGRU) based on the document type. This is just a dropdown without any special code in the screen, from what I can see. So far I've followed the steps in this post successfully and added a search help exit. There are some inaccuracies in that post but I figured it out and it works perfectly fine. Once.

The problems start when the users back out to the first VA01 screen (where the order type is entered), enter a different order type and hit Enter. In this case the search help exit is not called at all. At first I thought there was something wrong with my code or maybe order type was not in memory. But the search help exit code is simply not executed, unless the users totally back out from the transaction.

There is another SCN post with the same exact problem but it's just "assumed answered" and the longest response doesn't seem to answer the question:

There are many other posts about the same issue in other transactions, but all are either a different problem or no answer / "answered myself" with no solution. Nothing in the notes either.

Not even sure what to debug - for obvious reasons nothing happens if you do /h before calling the dropdown and exit is called way before that anyway. Completely baffled by such behavior. Any clues on how to force the search help exit to be triggered?

P.S. By the way, there is already a request posted for this functionality, but we need some solution sooner: Order reasons

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

I got it. When a drop down list box is linked to a search help, it's called once at the end of the PBO, but there's a mechanism to call it once (the list of values is buffered in the function group of VRM_SET_VALUES, which is implicitly called by SAP when a field is linked to a search help). If you call the function module VRM_DELETE_VALUES in the PBO, with ID being the field name (VBAK-AUGRU), then SAP will call the search help to retrieve the values again, and thus will call the user exit.

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos

I got it. When a drop down list box is linked to a search help, it's called once at the end of the PBO, but there's a mechanism to call it once (the list of values is buffered in the function group of VRM_SET_VALUES, which is implicitly called by SAP when a field is linked to a search help). If you call the function module VRM_DELETE_VALUES in the PBO, with ID being the field name (VBAK-AUGRU), then SAP will call the search help to retrieve the values again, and thus will call the user exit.

Jelena
Active Contributor
0 Kudos

Thank you, thank you, thank you!!! After I plugged the call for VRM_DELETE_VALUES into USEREXIT_FIELD_MODIFICATION it finally worked.

I'm not quite sure what's the point of allowing search help user exits and then buffering values for the whole transaction. But hopefully the request below will be addressed and no one will have to deal with this again.