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: 

Message in Search help Exit

Former Member
0 Kudos

Hi All,

We have to create a search help exit to handle a different search scenario which is not handled by the search help alone, hence created the search help exit to achieve this requirement, it is working fine when there is data, when there is no data, we need to give a message as 'No values found', I tried using the exceptions in the search help exit, but is of no use. Can anyone suggest me a good way of handling this.

Rgds,

7 REPLIES 7

Vinod_Chandran
Active Contributor
0 Kudos

Hi,

Try giving a message in the 'Display values' section if the internal table RECORD_TAB is empty.

Thanks

Vinod

0 Kudos

Hi Vinod,

Can you please explain it bit more clearly, I cant pass the message directly in the record_tab when it is empty, am I right?.

Rgds,

0 Kudos

Hi,

You can find this section 'Display values' in the search help exit function module. The internal table RECORD_TAB contains the records to be displayed. If it is empty, that means there is nothing to display. The code should be something like;

if callcontrol-step = 'DISP'.

  • PERFORM AUTHORITY_CHECK TABLES RECORD_TAB SHLP_TAB

  • CHANGING SHLP CALLCONTROL.

IF RECORD_TAB[] IS INITIAL.

MESSAGE ....

EXIT.

ENDIF.

exit.

endif.

Please try this. If you are looking at something else, please explain.

Thanks

Vinod

0 Kudos

Hi Vinod,

I tried the code given by you, but it is not displaying the message when record_tab is blank, I tried changing the call_control-step value in debug mode to check the output, no message was displayed. Kindly suggest if you have any alternative way of handling this.

Thanks for the quick response.

Rgds,

0 Kudos

hi sailatha

I agree with Vinod.

You need to check if recor_itab is empty or not and display message after that.

Again try debugging the code.and check whether program flow logic is moving inside "if condition " or not.

otherwise instead of using the code suggested by Vinod:

if record_itab[] is initial

Message...

endif

Try implemneting it otherway round.

Read internal table index 1.

Then check system field sy-subrc.

if sy-subrc=0 it means Internal table is not empty.

if sy-subrc<>0 it means it could not read 1st row,it is empty.

Example:

read table record_itab index 1

if sy-subrc<>0

Message 'No values found.' TYPE 'i'.

endif.

Regards

Vijay Raheja

0 Kudos

Hi Sailatha,

I have tried this and is working.

Inside the IF condition I have given a success (S) message and is coming during the F4.

Could you try again?

Btw, where are you using this search help?

Thanks

Vinod

Former Member
0 Kudos

Hi Sailatha,

to me it is not clear why you need to send a message at all when the set of possible values is empty. This is a situation that is possible for all search helps and the standard F4 processing can handle it (I think it displays a message, too). Hence, why do you want to produce your own message?

BTW: It seems that you delete entries from the record_tab that have been selected before. It may be helpful to have a look at search help SFLIGHT_MIN_FREE and its exit SAPBC_GLOBAL_F4_SFLIGHT_MIN_FR. There you can find an example how to handle this problem.

Greetings

Stephan