on 03-27-2014 4:00 PM
Currently there is not an easy way to add search help functionality to custom fields in Personas. However, Tamas has created a workaround using webRFCs and some minimal ABAP code changes. His blog can be found here:
http://scn.sap.com/community/gui/blog/2014/01/17/search-help-for-a-custom-field-in-personas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Cheryl. I read his blog and followed him. But there is a problem. The first function worked, but the second did not. Curiously, I called the function on the step 5, but it prompted me "Calling the given WEBRFC failed" with the step 2 of the script. I tested the function Z_WEBRFC_READ_DATA_SH and it works well.
Here is the script button:
{"Id":"3deaadeb-7655-4d1a-9b82-df269a920cb1","Actions":[{"ActionCategory":"0","Action":"4099","ControlID":"ses[0]\/wnd[1]\/usrUSRAREA\/loopcntSAPLSDH40600\/ctxtG_SIMFIELDSVALUE[0]","Content":"selvalue"},{"ActionCategory":"0","Action":"1","ControlID":"ses[0]\/wnd[1]\/tbar[0]\/btn[12]","Content":""},{"ActionCategory":"0","Action":"4103","ControlID":"ses[0]","Content":""},{"ActionCategory":"0","Action":"4104","ControlID":"ses[0]","Content":"args.rand = Math.random();"},{"ActionCategory":"0","Action":"4105","ControlID":"ses[0]","Content":"http:\/\/sap.suv.com:8000\/sap\/bc\/webrfc?_FUNCTION=Z_WEBRFC_READ_DATA_SH&_rand={rand}"},{"ActionCategory":"0","Action":"4100","ControlID":"Personas\/f4b26cf4-842a-49f9-a095-668ed7b14aa1","Content":"fieldname"},{"ActionCategory":"1","Action":"4353","ControlID":"Personas\/f4b26cf4-842a-49f9-a095-668ed7b14aa1","Content":"GSDM"},{"ActionCategory":"2","Action":"4100","ControlID":"Personas\/94106d02-2a0a-4355-9b9b-29987c32efd8","Content":"selvalue"},{"ActionCategory":"1","Action":"4353","ControlID":"Personas\/f4b26cf4-842a-49f9-a095-668ed7b14aa1","Content":"YHM"},{"ActionCategory":"2","Action":"4100","ControlID":"Personas\/244eddf2-c06c-43a5-b754-9e8d6233f2fe","Content":"selvalue"}]}
Hi Tamas,
Just a slight correction.
Well the is correct id is ses[0]/wnd[1]/tbar[0]/btn[12]
ONLY THIS ID was changed in one of the kernel patch couple of months back to accommodate future enhancements. Obviously, we had some issues for customers who had recorded their script before that.
For example, Steve posted the following and mentioned about a single issue which was the change in id when he upgraded his kernel.
But in the recent note release, changes were made to detect the OLD id and change to the new one.
In short, if you had a script recorded earlier with old id, it will not impact your script.
Regards,
Sushant
Hi, Tamas,
I found the reason. The function Z_WEBRFC_READ_DATA_SH had a string concatenation error.
CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
The correct code is like:
CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},{"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
Another question is, I can't get any words in Chinese from WebRFC. It returns error when I try it. How can I configure it?
Xin
Thanks for catching this, Xin. I corrected the code in the blog post. Must have been a copy&paste error on my end, because this was always working fine in my prototype.
As for the question about having Chinese text in the response, unfortunately I can't help with that since I have not dealt with such a scenario before. Hopefully someone else will be able to chime in with ideas.
Thread moved to SAP GUI space. The Chinese speaking community, where you previously posted this question, is for content in Chinese only.
Thanks,
Laure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.