on 06-14-2007 6:33 PM
Hello Gurus,
i am trying to do a very simple thing in Webdynpro but it seems to be more complicated than i thought.
I have a simple WebDynpro application embedded in a Portal page.
I am trying to pass 2 parameters (empno and empno1) through the URL which i would like to read it in my WebDynpro component.
The URL looks like this: <b>without URL encoding</b>
The URL also looks like this: <b>with URL encoding</b>
<b>In the WebDynpro component, i retrieve it using the following code:</b> String empNo=WDProtocolAdapter.getProtocolAdapter().getRequestParameter("empno");
msgMgr.reportSuccess("empno in overview is "+empNo);
String empNo1=WDProtocolAdapter.getProtocolAdapter().getRequestParameter("empno1");
msgMgr.reportSuccess("empno1 in overview is "+empNo1);
However, by this approach, i am only able to retrieve the value of the 1st parameter and not the second.
Note: I have tried all the approaches specified in the following doc......Unfortunately nothing works !!!!!
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/be65751c743959e10000000a1553f6/frameset.htm
Can anybody please help.
I would appreciate if you could please send me the corrected URL (if it needs to be corrected) and/or the exact code, instead of pointing me to some other doc.
Very IMP: I have tested this both in EP6 as well as EP7.
Thanks a lot in advance,
Umesh.
Hi Umesh and Sandeep,
Both of u were not getting values because the method used was deprecated
Use the following code
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("param1");
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("param2");
It will return the values fro param1 and param2
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sundeep,
Append url params as
"<i>ampersand</i><b>param1=sundeep<i></b>ampersand</i><b>param2=Sethi</b>"
instead of
<b>"?param1=sundeep</b><i>ampersand</i><b>param2=Sethi"</b>
because the url parameters starts from <b>?SAPtestId=...</b>
So only we have to append URL Param to SAPTestId as <i>ampersand</i><b>param1=..</b> instead of <b>?param1=..</b>
<b>Note:Since the symbol is not coming in the browser, I had used <i>ampersand</i>. Use the symbol instead of that in ur url</b>
Regards
Fahad Hamsa
Hi Fahad,
Thanks for your reply...but doing this gives a runtime error..
I did the following in my JSP
<iframe id="personaldetails" frameborder="0" src="/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fsundeep!2fjava_sap_com_webdynprocomp_com_ibm_wd_HelloApp<b>%26DynamicParameter%3Dsundeep%3D12998%26empno%3D11111</b>"
width="100%" height="1000" >
Note the things in bold...
Now when i ran the application it gave the following iview not found runtime error:
Portal Runtime Error
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
iView not found: pcd:portal_content/sundeep/java_sap_com_webdynprocomp_com_ibm_wd_HelloApp&DynamicParameter=sundeep=12998&empno=11111.
Exception id: 11:47_19/04/09_0006_14617650
See the details for the exception ID in the log file
Other suggestion will be highly appreciated.....
Regards
Sundeep
How did you do the encoding?
The cited article says:
1. We would like to pass two parameters to the Web Dynpro application associated to the NW04s Web Dynpro iView: objectInstanceID and viewMode.
2. The needed values are objectInstanceID=4711 and viewMode=simple
3. To ensure that all values are passed correctly (especially in cases where a value contains special signs like äü#/)(>;:§$)
you have to encode the values one by one
.After that you have to put all parameters together and encode this parameter string again
.5. The encoded value is the needed parameter value of the DynamicParameter parameter.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Armin,
I too have the same problem...Umesh is right ..I think there is a bug in the DynamicParameter approach when we try to pass 2 parameters...I had followed the algorithm u have mentioned and in this case it would be :
%3FDynamicParameter%3Dempno%3D1234%26empno2%3D4321
The above string is:
?DynamicParameter=empno=1234&empno2=4321
I had appended the encoded string at the end of the encoded iview URL
Using DynamicParameter we can pass only one parameter at a time...
Interestingly in the above case only the first parameter i.e empno whose value is 1234 is passed and the other is discarded....
Experts correct me if i am wrong and suggest the right approach..
Regards
Sundeep
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.