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 User Exit (if "one" entry in hit list, skip hit list and export)

Former Member
0 Kudos

Hi everyone,

I hope you can help me. I spent many hours on this one but I just could not find a solution (by myself and by searching google and searching the SCN).

Problem like thread subject.

I have the requirement to create a search help using search help exit. Done so far. My search help works fine. There´s a Sel Opt and I get the hit list with several entries. "But" I have one problem. If there is only one entry I have to skip the hit list and just export the value straight to the caller.

I just don´t get it to work. I used the function module F4UT_PARAMETER_RESULTS_PUT but there was no value in shlp-interface-value. Record Tab was written, but value is not exported.

Maybe you got some hints for me?`

Best regards

Dominik

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

After call of the FM so putting entries back to record_tab, did you also set callcontrol-step = 'RETURN' when only one record ?


Regards,

Raymond

8 REPLIES 8

PeterJonker
Active Contributor
0 Kudos

Hi Dominik,

Are you using the search help on a selection screen ?

In that case you could maybe do something with the INITIALIZATION event. Like performing a select on the table which is also used with the search help, do the actions you now do in the search help exit and then check the result. If there is only one entry left you fill the selection screen with that value, otherwise do nothing.

Might that be an option ?

0 Kudos

Hi Peter,

thank you for replying.

No, it´s a search help created via SE11, which will be used for a column in alv grid.

Best regards,

Dominik

raymond_giuseppi
Active Contributor
0 Kudos

After call of the FM so putting entries back to record_tab, did you also set callcontrol-step = 'RETURN' when only one record ?


Regards,

Raymond

0 Kudos

Hi Raymond,

yes, I tried that. I called the function module F4UT_PARAMETER_RESULTS_PUT and after that I wrote callcontrol-step = 'RETURN'.

But the value was not exported. Value was set in record_tab, but there was no value in shlp-interface-value.

If I use the hit list everything´s fine.

Best regards,

Dominik

0 Kudos

Hi Dominik,

Try with not calling the FM F4UT_PARAMETER_RESULTS_PUT, if record_tab has one record then just change callcontrol-step = 'RETURN'.

0 Kudos

Hi Aruna,

I have one entry in record_tab because I use the function module F4UT_PARAMETER_RESULTS_PUT. This function module does do the writing in record_tab.

If I don´t call this fm then I had to try to fill record_tab manually and I could imagine that things would be worse then

Best regards,

Dominik

0 Kudos

What did you pass in SOURCE_TAB parameter in F4UT_PARAMETER_RESULTS_PUT call ?

Regards,

Raymond

0 Kudos

Hi Raymond,

I passed as followed:

***CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'

***  EXPORTING

***       PARAMETER         = 'DOC_ID'

***       VALUE             = ls_disp_data-doc_id

***       fieldname         = 'DOC_ID'

***  TABLES

***       SHLP_TAB          = SHLP_TAB

***       RECORD_TAB        = RECORD_TAB

***        SOURCE_TAB       = lt_disp_data

***  CHANGING

***       SHLP              = SHLP

***       CALLCONTROL       = CALLCONTROL

***  EXCEPTIONS

***       PARAMETER_UNKNOWN = 1

***       OTHERS            = 2.

LT_DISP_DATA is filled with one entry only. DOC_ID is the name of the field I want the value to be set.

Update: It´s fixed. I reset the whole thing. I did set callcontrol-step = 'RETURN' after function call, "but" at the end of the coding there was a leftover from previous tries (an empty if callcontrol-step = 'RETURN' -shell). By setting this condition explicitly the "standard flow" was interrupted.

So, in short: I had to delete the empty if-condition for callcontrol-step = RETURN and then it worked.

Thank you all for your feedback, hints and suggestions!

Best regards,

Dominik