Download Android App of sapabap-vamsi

sapabap-vamsi : Download Android App for Mobiles

Sunday, August 14, 2011

Demo on Search help exit for the material...


Search help exits are used to restrict the standard search help returned values according to users’ requirement.
Example:
Scenario: When User1 require only Material type as Finished goods and User2 require only Material type as Raw material, for this scenario we can use search help exit.
Go to SE11, select the search help radio button.
To restrict the values for Material by Material type search help name is: MAT1T_E
Click on change button.


For this create a function module, write the logic according to the requirement and place the function module in marked location.
 Function module structure definition: Create a parameters in changing and Tables tabs as follows.

Write the following code in the source code tab.


Code:
DATA : WA_TEMP LIKE RECORD_TAB,
       IT_TEMP LIKE RECORD_TAB OCCURS 0.
IF CALLCONTROL-STEP = 'DISP'.
IF SY-UNAME = 'XXXXXX'.
LOOP AT RECORD_TAB INTO WA_TEMP WHERE STRING+3(4) = 'FERT'.
APPEND WA_TEMP TO IT_TEMP.
CLEAR: WA_TEMP.
ENDLOOP.
CLEAR: RECORD_TAB[].
RECORD_TAB[] = IT_TEMP[].
CLEAR: IT_TEMP[].
ELSEIF SY-UNAME = 'YYYYYY'.
LOOP AT RECORD_TAB INTO WA_TEMP WHERE STRING+3(4) = 'ROH'.
APPEND WA_TEMP TO IT_TEMP.
CLEAR: WA_TEMP.
ENDLOOP.
CLEAR: RECORD_TAB[].
RECORD_TAB[] = IT_TEMP[].
CLEAR: IT_TEMP[].
ENDIF.
ENDIF.
Save and activate it.
Then place the Function module above location in SE11.
Testing:
Go to any Transaction which has material number.
Ex: ME21N. Press F4 on Material Field.
User1 Result:

User2 Result: 









No comments:

Post a Comment