Challenge
You want to search for Documents, which are linked to Material Masters. Your search starts with search criteria for Material Masters.
Solution
You can use Smartlists to define your own search following these steps:
- Create your own macro file "search_mat2dis.txt" in directory <ECTR Installation Directory>\customize\scripts\macros\wizard with this content:
input_mask = GET_MASK_INPUT("MAT2DIS","Search Documents via Material","MAT","test")
search_results = SEARCH( "mat", input_mask )
transform_results = TRANSFORM_SET( search_results, "mat_to_doc" )
documents = KEYLIST_FROM_SET(transform_results)
WRITE_RESULTLIST(documents) Define your own search mask and start with System -> Maintain Search Masks
- Create new Mask for Material. Name of mask must be the same as in step 1 ...GET_MASK_INPUT("MAT2DIS","Search Documents ...
- Add search fields to the search mask and save
Define a new Query
- Select your macro within the new query:
- The search mask appears, where you can enter your search criteria into the search mask:
- The result shows all Documents, which are linked to a Material with description = "*forklifter*"
To change the search parameter you can simply click in the context menu and select "Edit Search parameter".
Dictionary und Icon
Dictionaries can be defined as follow:
plm.macro.wizard.value.for.<filename> = <your text>
Icons can be defined as follow:
plm.macro.wizard.icon.for.<filename> = <icon>
6 Comments
McKenzie Cutshall
Very nice! Is there any way to add a Document Type search field so we can search by Material Number, but for only specific Document Types. Also, whenever we select Edit Search Parameters, it brings up a dialog where we have to select Load Available Masks again. Should it not automatically load the Mask?
Waldemar Tribus
you can extend the macro file with "FILTER" command:
filter_params = PARAMETER_MAP("doc_fields")
filter_params.DOCUMENTTYPE = "UGM"
filtered_results = FILTER(transform_results, "doc", filter_params )
Please take a look in Operations Guide (<ECTR_INST_DIR>\documentation\Manuals\en), chapter 5.8 Macros and Smartlists for more.
or:
filter_params = PARAMETER_MAP("doc_fields")
doc_type = ASK_USER("field", "Input doc type")
filter_params.DOCUMENTTYPE = doc_type
McKenzie Cutshall
Awesome! I will give that a try. I think if I was able to get SAP Enterprise Search working, with ECTR, this would not even be an issue. I've been given conflicting information on whether this "should" work, via Enterprise Search, or not. It works great in the CAD Desktop. We just need the same in ECTR. Thank you so much for your help!
Waldemar Tribus
If you want to use ES and ES is already setup in your SAP system, you can try this:
Edit the file <ECTR_INST_DIR>\customize\config\default.txt
find this lines:
# Define the search method for the Quick search in ECTR desktop
# DB = data base (default)
# ES = Enterprise/Embedded Search
plm.doc.cdesk.srv.search.searchmethod = DB
change DB to ES:
plm.doc.cdesk.srv.search.searchmethod = ES
Now the Quick Search (Menu "System" - "Quick Search" or just ctrl-f) will use Enterprise Search to find documents.
Quick Search is only able to find documents.
McKenzie Cutshall
Yep. I've tried that. I realize it should only find documents, and that's fine, but I want to search using the Material Master number that is linked to the Document via Objects Links, as well as search by Change Number. Currently, I can't get any results with that method, even if I just search for a document number. It works in the WebUI and in CAD Desktop. I will probably have to open another SAP Support Ticket, I guess.
Former Member
This is a search example based on material properties.
You can filter the results by document type. (Select smartlist -> filter results in Object Browser)
If the search mask exists, the mask have to be automatically loaded.