cancel
Showing results for 
Search instead for 
Did you mean: 

Search help problem

bzakaria
Participant
0 Kudos

Hello,

I created a search help to display the deliveries.

I succeeded to display deliveries from the 'LIPS' table. but my problem is that I want to display the deliveries by the connected user plant.

For example. a user USER1 belongs to the plant PL1, and USER2 belongs to the plant PL2. I want when USER1 connects the search help only displays deliveries that have WERKS = 'PL1'. and WERKS = 'PL2' for the USER2.

NB : I have a correspondence table between the users and the plants (and other information).

regards,

Accepted Solutions (1)

Accepted Solutions (1)

DoanManhQuynh
Active Contributor

I think there are 2 way you can use:

1. Use search help exit: copy fm F4IF_SHLP_EXIT_EXAMPLE and change it as you desire. the explanation there is very clear. this way is recommended.

2. Use parameter ID: incase you only want this for specific program, you can set WERKS as your search help input parameter and use parameter WRK as default value, then inside program determine user plant and set value to parameter ID.

bzakaria
Participant
0 Kudos

quynh.doanmanh Thank you for your answer.

I want to use the second. because the first is based on the characters of STRING, and in my case the plant is not in the list displayed for the users (but it is in the parameters of the search help).

Thank you for giving me an clair example of a set value to parameter ID of a search help (I do not find on the internet a clear answer).

Jelena
Active Contributor

bzakaria - it seems that you can simply define a search help in the dictionary and use a memory parameter WRK as input for it, as suggested by Quynh Doan Manh.

Parameter values can be assigned in the user profile, if the user predominantly works with just one Plant. That will make data entry easier for them in many transactions. If you use WRK parameter in the search help ion SE11 and it's set in the user profile then you don't need to do any additional programming. Otherwise refer to ABAP Help (example in the link above) for more information about working with parameters.

bzakaria
Participant
0 Kudos

@ quynh.doanmanh , it's good, I found how to pass parameters to search help in this link.

Set a parameter value using Search help exit

Thank you !

Answers (2)

Answers (2)

former_member1716
Active Contributor

zakaria bi,

Did you use the SEARCH HELP EXIT option available in Search help? Also explain more on the approach you took.

Recommend you to go through the below Link for its implementation.

SEARCH_HELP_EXIT

Regards!

bzakaria
Participant
0 Kudos

Thank you satishkumarbalasubramanian for your answer.

I already tried the link you gave me. but I did not find how to delete deliveries that belong to other plants, or load in the search help only deliveries that belong to the plant of the user.

former_member557245
Participant
0 Kudos

Hellov

FUNCTION ZMM_ART_SHELP_EXIT_WSTAW.
*"----------------------------------------------------------------------
*"*"Local Interface:0
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(CALLCONTROL) TYPE DDSHF4CTRL
*"----------------------------------------------------------------------

CASE CALLCONTROL-STEP.
WHEN 'SELONE'.

WHEN 'PRESEL1'.

WHEN 'SELECT'.

WHEN 'DISP'.

IF SY-UNAME EQ 'XXXX'" get the user
LOOP AT RECORD_TAB.
IF RECORD_TAB-STRING+3(2) NE 'SA' . ""check the data for corresponding user
DELETE RECORD_TAB INDEX SY-TABIX."" delete the data
ENDIF.
ENDLOOP.

ENDIF.
WHEN 'RETURN'.
WHEN OTHERS.
ENDCASE.


ENDFUNCTION.